[Avida-SVN] r2925 - in branches/matt/PairwiseEpistasis: Avida.xcodeproj source/analyze

ruppmatt at myxo.css.msu.edu ruppmatt at myxo.css.msu.edu
Fri Nov 7 11:26:27 PST 2008


Author: ruppmatt
Date: 2008-11-07 14:26:27 -0500 (Fri, 07 Nov 2008)
New Revision: 2925

Modified:
   branches/matt/PairwiseEpistasis/Avida.xcodeproj/project.pbxproj
   branches/matt/PairwiseEpistasis/source/analyze/cAnalyze.cc
Log:
Added nan as a place holder for neighbhorhood landscaping.

Modified: branches/matt/PairwiseEpistasis/Avida.xcodeproj/project.pbxproj
===================================================================
--- branches/matt/PairwiseEpistasis/Avida.xcodeproj/project.pbxproj	2008-11-07 15:01:31 UTC (rev 2924)
+++ branches/matt/PairwiseEpistasis/Avida.xcodeproj/project.pbxproj	2008-11-07 19:26:27 UTC (rev 2925)
@@ -739,7 +739,7 @@
 		DCC315CE076253A5008F7A48 /* environment.rotate */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = environment.rotate; sourceTree = "<group>"; };
 		DCC315D0076253A5008F7A48 /* task_event_gen.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.cc; sourceTree = "<group>"; };
 		DCC315D1076253A5008F7A48 /* task_event_gen.old.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.old.cc; sourceTree = "<group>"; };
-		DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
+		DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */

Modified: branches/matt/PairwiseEpistasis/source/analyze/cAnalyze.cc
===================================================================
--- branches/matt/PairwiseEpistasis/source/analyze/cAnalyze.cc	2008-11-07 15:01:31 UTC (rev 2924)
+++ branches/matt/PairwiseEpistasis/source/analyze/cAnalyze.cc	2008-11-07 19:26:27 UTC (rev 2925)
@@ -7003,6 +7003,8 @@
  * perform 1-NN lanscaping around each genotype, keeping the last mutation
  * to occur fixed.  Output will be one file per genotype that lists 
  * the fitnesses of each genotype.
+ * Updated 7 November 2008:  Adding nan place-holders for comparison of neighborhoods
+ *                           between parent and child genotypes.
  * Arguments
  *    suffix = "1.NN"  The prefix of each file
  *    num_trials [= 1] default number of trials for plasticity
@@ -7011,6 +7013,8 @@
 {
   cString file_suffix;
   int     num_trials;
+  double  zero = 0.0;
+  double  xnan = 0.0/zero;  //Generate a nan
   
   file_suffix  = (cur_string.GetSize() == 0) ? "-1.NN" : cur_string.PopWord();
   num_trials   = (cur_string.GetSize() == 0) ? 1      : cur_string.PopWord().AsInt();
@@ -7075,17 +7079,19 @@
     //For each site in the child genotype
     for (int k = 0; k < new_genotype.GetSize(); k++){
       
-      //If this site contains the last mutation, skip it
-      if (cur_mut < num_muts && mut[cur_mut] == k){
-        cur_mut++;  //Increment our mutation list
-        continue;    //Go to the next mutation
-      }
+      //If this site contains the one of the last mutations, flag it
+      bool mut_site = (cur_mut < num_muts && mut[cur_mut++] == k) ? true : false;
       
       //Assuming this site isn't a recent mutant, mutate it to everything it can be
       for (int c = 0; c < inst_set.GetSize(); c++){
-        //If the "change" is the same as the original, skip it.
-        if (cInstruction(c).GetSymbol() == old_genotype[k])
+        // If the "change" is the same as the original or is our current mutation
+        // then supply a nan.
+        if (mut_site || cInstruction(c).GetSymbol() == old_genotype[k])
+        {
+          df.WriteAnonymous(xnan);
+          df.Endl();
           continue;
+        }
         new_genotype = old_genotype;
         new_genotype[k] = cInstruction(c).GetSymbol();
         cPhenPlastGenotype pp(new_genotype, num_trials, m_world, m_ctx);




More information about the Avida-cvs mailing list