[Avida-SVN] r2207 - branches/dkdev/source/main

dknoester at myxo.css.msu.edu dknoester at myxo.css.msu.edu
Sat Nov 17 07:01:50 PST 2007


Author: dknoester
Date: 2007-11-17 10:01:49 -0500 (Sat, 17 Nov 2007)
New Revision: 2207

Modified:
   branches/dkdev/source/main/cAvidaConfig.h
   branches/dkdev/source/main/cPopulation.cc
Log:
Added a minimum required age for a deme to replicate, in order to ensure that the deme is exposed to varying environmental conditions.

Modified: branches/dkdev/source/main/cAvidaConfig.h
===================================================================
--- branches/dkdev/source/main/cAvidaConfig.h	2007-11-17 14:57:23 UTC (rev 2206)
+++ branches/dkdev/source/main/cAvidaConfig.h	2007-11-17 15:01:49 UTC (rev 2207)
@@ -169,8 +169,8 @@
   CONFIG_ADD_VAR(GERMLINE_RANDOM_PLACEMENT, int, 0, "Whether the seed for a germline is placed randomly within the deme; 0=no.");
   CONFIG_ADD_VAR(GERMLINE_COPY_MUT, double, 0.0075, "Probability of copy mutations occuring during germline replication.");
   CONFIG_ADD_VAR(FILL_DEME_ON_REPLICATE, int, 0, "Whether to fill the source and target demes upon replication.");
-
   CONFIG_ADD_VAR(MAX_DEME_AGE, int, 500, "The maximum age of a deme (in updates) to be used for age-based replication (default=500).");
+  CONFIG_ADD_VAR(MIN_DEME_AGE, int, 0, "The minimum req'd age of a deme (in updates) for it to replicate (default=0).");
   CONFIG_ADD_VAR(TRACK_GENOTYPES, int, 0, "Whether genotypes are tracked graphically.");
   CONFIG_ADD_VAR(TWOCELLS_MIN_REGION_RATIO, double, 0.2, "Ratio of size of two-cells region to environment size.");
   CONFIG_ADD_VAR(TWOCELLS_SEQUENTIAL_REGION, int, 0, "Whether the region is sequential or random; 1=sequential.");

Modified: branches/dkdev/source/main/cPopulation.cc
===================================================================
--- branches/dkdev/source/main/cPopulation.cc	2007-11-17 14:57:23 UTC (rev 2206)
+++ branches/dkdev/source/main/cPopulation.cc	2007-11-17 15:01:49 UTC (rev 2207)
@@ -979,6 +979,12 @@
        && (source_deme.GetBirthCount() < source_deme.GetSize())) {
       continue;
     }
+    
+    // In some cases, we want to guarantee that the deme sticks around for at 
+    // least a certain amount of time.
+    if(source_deme.GetAge() < m_world->GetConfig().MIN_DEME_AGE.Get()) {
+      continue;
+    }
 
     // Test this deme to determine if it should be replicated.  If not,
     // continue on to the next deme.




More information about the Avida-cvs mailing list