[Avida-SVN] r3228 - in branches/goings: source/cpu support/config

goingssh at myxo.css.msu.edu goingssh at myxo.css.msu.edu
Mon May 4 18:44:46 PDT 2009


Author: goingssh
Date: 2009-05-04 21:44:46 -0400 (Mon, 04 May 2009)
New Revision: 3228

Modified:
   branches/goings/source/cpu/cHardwareBase.cc
   branches/goings/support/config/analyze.cfg
   branches/goings/support/config/avida.cfg
   branches/goings/support/config/events.cfg
Log:


Modified: branches/goings/source/cpu/cHardwareBase.cc
===================================================================
--- branches/goings/source/cpu/cHardwareBase.cc	2009-05-04 23:51:57 UTC (rev 3227)
+++ branches/goings/source/cpu/cHardwareBase.cc	2009-05-05 01:44:46 UTC (rev 3228)
@@ -498,6 +498,7 @@
   if (phenotype.CopyTrue() == true) return false;
 	
   const double parent_fitness = m_organism->GetTestFitness(ctx);
+  const tArray<int>& parenttasks = phenotype.GetCurTaskCount();
   const double neut_min = parent_fitness * (1.0 - m_organism->GetNeutralMin());
     const double neut_max = parent_fitness * (1.0 + m_organism->GetNeutralMax());
       
@@ -530,7 +531,20 @@
         if (ctx.GetRandom().P(m_organism->GetRevertPos())) revert = true;
         if (ctx.GetRandom().P(m_organism->GetSterilizePos())) sterilize = true;
       }
-	  if (ctx.GetRandom().P(m_organism->GetRevertTaskLoss())) revert = true;
+	  // check if child has lost any tasks parent had AND not gained any new tasks
+	  if (ctx.GetRandom().P(m_organism->GetRevertTaskLoss())) {
+	    const tArray<int>& childtasks = test_info.GetTestPhenotype().GetCurTaskCount();
+	    bool del = false;
+	    bool added = false;
+	    for (int i=0; i<childtasks.GetSize(); i++)
+	      if (childtasks[i] > parenttasks[i]) {
+		added = true;
+		break;
+	      }
+	      else if (childtasks[i] < parenttasks[i])
+		del = true;
+	    revert = (del && !added);
+	  }
       
       // Ideally, we won't have reversions and sterilizations turned on at the
       // same time, but if we do, give revert the priority.
@@ -618,10 +632,6 @@
 	  revert = (del && !added);
   }
  
-
-  
-  if (ctx.GetRandom().P(m_organism->GetRevertTaskLoss())) revert = true;
-  
   // Ideally, we won't have reversions and sterilizations turned on at the
   // same time, but if we do, give revert the priority.
   if (revert == true) {

Modified: branches/goings/support/config/analyze.cfg
===================================================================
--- branches/goings/support/config/analyze.cfg	2009-05-04 23:51:57 UTC (rev 3227)
+++ branches/goings/support/config/analyze.cfg	2009-05-05 01:44:46 UTC (rev 3228)
@@ -8,3 +8,9 @@
 #
 #############################################################################
 
+LOAD data2/detail-1000.pop
+LOAD data2/historic-1000.pop
+
+    FIND_LINEAGE 
+    RECALCULATE
+    DETAIL lineage.html depth fitness task.0 task.1 task.2 task.3 task.4 task.5 task.6 task.7 task.8 html.sequence

Modified: branches/goings/support/config/avida.cfg
===================================================================
--- branches/goings/support/config/avida.cfg	2009-05-04 23:51:57 UTC (rev 3227)
+++ branches/goings/support/config/avida.cfg	2009-05-05 01:44:46 UTC (rev 3228)
@@ -248,7 +248,7 @@
 REVERT_DETRIMENTAL 0.0     #   0.0 to 1.0; Probability of reversion.
 REVERT_NEUTRAL 0.0         # 
 REVERT_BENEFICIAL 0.0      # 
-REVERT_TASKLOSS 1.0
+REVERT_TASKLOSS 0.0
 STERILIZE_FATAL 0.0        # Should any mutations clear (kill) the organism?
 STERILIZE_DETRIMENTAL 0.0  # 
 STERILIZE_NEUTRAL 0.0      # 

Modified: branches/goings/support/config/events.cfg
===================================================================
--- branches/goings/support/config/events.cfg	2009-05-04 23:51:57 UTC (rev 3227)
+++ branches/goings/support/config/events.cfg	2009-05-05 01:44:46 UTC (rev 3228)
@@ -23,7 +23,7 @@
 u 0:100:end PrintResourceData      # Track resource abundance.
 
 # A few data files not printed by default
-# u 0:100 PrintDominantGenotype      # Save the most abundant genotypes
+ u 0:100 PrintDominantGenotype      # Save the most abundant genotypes
 # u 100:100:end PrintErrorData       # Std. Error on averages.
 # u 100:100:end PrintVarianceData    # Variance on averages.
 # u 100:100:end PrintTotalsData      # Total counts over entire run.
@@ -31,6 +31,6 @@
 # u 100:100:end PrintTasksQualData   # Task quality information
 
 # Setup the exit time and full population data collection.
-u 50000:50000 SavePopulation         # Save current state of population.
-u 50000:50000 SaveHistoricPopulation # Save ancestors of current population.
-u 100000 exit                        # exit
+u 1000:1000 SavePopulation         # Save current state of population.
+u 1000:1000 SaveHistoricPopulation # Save ancestors of current population.
+u 5000 exit                        # exit




More information about the Avida-cvs mailing list