[Avida-SVN] r2203 - branches/dkdev/source/main
dknoester at myxo.css.msu.edu
dknoester at myxo.css.msu.edu
Sat Nov 17 06:16:45 PST 2007
Author: dknoester
Date: 2007-11-17 09:16:44 -0500 (Sat, 17 Nov 2007)
New Revision: 2203
Modified:
branches/dkdev/source/main/cAvidaConfig.h
branches/dkdev/source/main/cPopulation.cc
Log:
Moved deme sterility check to earlier in the replication process, and turned it into a config option.
Modified: branches/dkdev/source/main/cAvidaConfig.h
===================================================================
--- branches/dkdev/source/main/cAvidaConfig.h 2007-11-15 15:30:14 UTC (rev 2202)
+++ branches/dkdev/source/main/cAvidaConfig.h 2007-11-17 14:16:44 UTC (rev 2203)
@@ -165,6 +165,7 @@
CONFIG_ADD_VAR(DEMES_HAVE_MERIT, int, 0, "Whether or not demes apply a merit to their members; 0=off");
CONFIG_ADD_VAR(DEME_REPLICATION_TRIALS, int, 1, "The number of trials that a deme must go through before replication is allowed.");
CONFIG_ADD_VAR(DEME_RESEED_ON_NEW_TRIAL, int, 0, "Whether to reseed the deme from the germline on a new trial; 0=no");
+ CONFIG_ADD_VAR(DEME_PREVENT_STERILE, int, 1, "Whether to prevent the deme from replicating if its organisms are sterile; 0=no");
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.");
Modified: branches/dkdev/source/main/cPopulation.cc
===================================================================
--- branches/dkdev/source/main/cPopulation.cc 2007-11-15 15:30:14 UTC (rev 2202)
+++ branches/dkdev/source/main/cPopulation.cc 2007-11-17 14:16:44 UTC (rev 2203)
@@ -972,7 +972,14 @@
// Doesn't make sense to try and replicate a deme that *has no organisms*.
if(source_deme.IsEmpty()) continue;
-
+
+ // Config option to unconditionally fail the replication if organisms within the deme
+ // didn't replicate.
+ if(m_world->GetConfig().DEME_PREVENT_STERILE.Get()
+ && (source_deme.GetBirthCount() < source_deme.GetSize())) {
+ continue;
+ }
+
// Test this deme to determine if it should be replicated. If not,
// continue on to the next deme.
switch (rep_trigger) {
@@ -1000,8 +1007,7 @@
}
case 3: {
// Replicate old demes (deme-age), but don't replicate sterile demes.
- if((source_deme.GetAge() < m_world->GetConfig().MAX_DEME_AGE.Get())
- || (source_deme.GetBirthCount() < source_deme.GetSize())) {
+ if(source_deme.GetAge() < m_world->GetConfig().MAX_DEME_AGE.Get()) {
continue;
}
source_deme.AddTrial(0.0);
More information about the Avida-cvs
mailing list