[Avida-SVN] r3467 - development/source/main

dk at myxo.css.msu.edu dk at myxo.css.msu.edu
Tue Oct 13 04:56:36 PDT 2009


Author: dk
Date: 2009-10-13 07:56:36 -0400 (Tue, 13 Oct 2009)
New Revision: 3467

Modified:
   development/source/main/cAvidaConfig.h
   development/source/main/cPopulation.cc
Log:
Added config option to override calculated deme fitnesses for competition, while still recording the calculated fitness for stats -- to facilitate control runs.

Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h	2009-10-12 14:59:07 UTC (rev 3466)
+++ development/source/main/cAvidaConfig.h	2009-10-13 11:56:36 UTC (rev 3467)
@@ -306,6 +306,7 @@
   CONFIG_ADD_VAR(NUM_DEMES, int, 1, "Number of independent groups in the\npopulation (default=1).");
 	CONFIG_ADD_VAR(DEMES_COMPETITION_STYLE, int, 0, "Select how the demes compete\n0=Fitness proportional\n1=Tournament");
   CONFIG_ADD_VAR(DEMES_TOURNAMENT_SIZE, int, 0, "Number of demes that participate in a tournament");
+	CONFIG_ADD_VAR(DEMES_OVERRIDE_FITNESS, int, 0, "Whether the calculated fitness is used\n0=yes (default)\n1=no (all fitnesses=1)");
   CONFIG_ADD_VAR(DEMES_USE_GERMLINE, int, 0, "Whether demes use a distinct germline (default=0).");
   CONFIG_ADD_VAR(DEMES_PREVENT_STERILE, int, 0, "Whether to prevent sterile demes from\nreplicating (default=0 or no).");
   CONFIG_ADD_VAR(DEMES_RESET_RESOURCES, int, 0, "Reset resources in demes on replication. \n0 = reset both demes \n1 = reset target deme \n2 = deme resources remain unchanged\n");

Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc	2009-10-12 14:59:07 UTC (rev 3466)
+++ development/source/main/cPopulation.cc	2009-10-13 11:56:36 UTC (rev 3467)
@@ -1282,6 +1282,14 @@
 		return;
 	}
 	
+	// to facilitate control runs, sometimes we want to know what the fitness values
+	// are, but we don't want competition to depend on them.
+	if(m_world->GetConfig().DEMES_OVERRIDE_FITNESS.Get()) {
+		for(int i=0; i<static_cast<int>(fitness.size()); ++i) {
+			fitness[i] = 1.0;
+		}		
+	}	
+	
 	// Number of demes (at index) which should wind up in the next generation.
 	std::vector<unsigned int> deme_counts(deme_array.GetSize(), 0);						
 	




More information about the Avida-cvs mailing list