[avida-cvs] avida(kaben) CVS commits: /current/source/main birth_chamber.cc config.cc config.hh

kaben avida-cvs at alife.org
Mon Dec 22 19:03:04 PST 2003


kaben		Mon Dec 22 11:03:04 2003 EDT

  Modified files:              (Branch: kaben)
    /avida/current/source/main	birth_chamber.cc config.cc config.hh 
  Log:
  
  Sync with cvs commit on branch HEAD by dule123 Thu Dec 11 14:13:04 2003 EDT
  
  
  
Index: avida/current/source/main/birth_chamber.cc
diff -u avida/current/source/main/birth_chamber.cc:1.10.2.1 avida/current/source/main/birth_chamber.cc:1.10.2.2
--- avida/current/source/main/birth_chamber.cc:1.10.2.1	Mon Dec 15 10:05:44 2003
+++ avida/current/source/main/birth_chamber.cc	Mon Dec 22 11:03:03 2003
@@ -24,6 +24,9 @@
 #ifndef TOOLS_HH
 #include "tools.hh"
 #endif
+#ifndef CONFIG_HH
+#include "config.hh"
+#endif
 
 using namespace std;
 
@@ -72,7 +75,10 @@
   genome_waiting = false;
 
   // How many crossovers should be do? For now, 0 or 1
-  if (parent.GetPhenotype().CrossNum() ==0) {
+  // Also check the probability of recombination in case
+  // it is less then 1 
+  if (parent.GetPhenotype().CrossNum() ==0 || 
+	cConfig::GetRecombProb() < g_random.GetDouble()) {
     child_array.Resize(2);
     child_array[0] = new cOrganism(wait_entry.genome, pop_interface,
 				   environment);
@@ -83,6 +89,7 @@
     return true;
   }
   else {
+
     cCPUMemory genome0 = wait_entry.genome;
     cCPUMemory genome1 = child_genome;
 
Index: avida/current/source/main/config.cc
diff -u avida/current/source/main/config.cc:1.68.2.2 avida/current/source/main/config.cc:1.68.2.3
--- avida/current/source/main/config.cc:1.68.2.2	Mon Dec 22 10:43:18 2003
+++ avida/current/source/main/config.cc	Mon Dec 22 11:03:03 2003
@@ -58,6 +58,7 @@
 double cConfig::divide_del_prob;
 double cConfig::parent_mut_prob;
 int cConfig::special_mut_line;
+double cConfig::recomb_prob;
 int cConfig::num_instructions;
 int cConfig::hardware_type;
 int cConfig::max_cpu_threads;
@@ -177,6 +178,8 @@
 		   "0 = Divide leaves state of mother untouched.\n1 = Divide resets state of mother (after the divide, we have 2 children)\n2 = Divide resets state of current thread only(does not touch possible parasite threads)");
   repro_group->Add(generation_inc_method, "1", "GENERATION_INC_METHOD",
 		   "0 = Only the generation of the child is\n    increased on divide.\n1 = Both the generation of the mother and child are\n    increased on divide (good with DIVIDE_METHOD 1).");
+  repro_group->Add(recomb_prob, "1", "RECOMBINATION_PROB",
+		   "probability that recombination will happen when div-sex is used");
 
 
   // Divide Restrictions Group.
@@ -218,9 +221,9 @@
   muts_group->Add(parent_mut_prob, "0.0", "PARENT_MUT_PROB",
 		  "Per-site, in parent, on divide");
   muts_group->Add(special_mut_line, "-1", "SPECIAL_MUT_LINE",
-		  "If this is >= 0, ONLY this line is mutated");
+                  "If this is >= 0, ONLY this line is mutated");
+
 
-  
   // Mutation reversions group
   cConfigGroup * rev_group = new cConfigGroup("Mutation Reversion");
   rev_group->SetComment("These slow down avida a lot, and should be set to 0.0 normally.");
Index: avida/current/source/main/config.hh
diff -u avida/current/source/main/config.hh:1.61.2.3 avida/current/source/main/config.hh:1.61.2.4
--- avida/current/source/main/config.hh:1.61.2.3	Mon Dec 22 10:43:18 2003
+++ avida/current/source/main/config.hh	Mon Dec 22 11:03:03 2003
@@ -226,6 +226,7 @@
   static int death_method;
   static int alloc_method;
   static int divide_method;
+  static double recomb_prob;
   static int required_task;
   static int lineage_creation_method;
   static int generation_inc_method;
@@ -348,6 +349,7 @@
   static int GetDeathMethod() { return death_method; }
   static int GetAllocMethod() { return alloc_method; }
   static int GetDivideMethod() { return divide_method; }
+  static double GetRecombProb() { return recomb_prob; }
   static int GetRequiredTask() { return required_task; }
   static int GetLineageCreationMethod() { return lineage_creation_method; }
   static int GetGenerationIncMethod() { return generation_inc_method; }






More information about the Avida-cvs mailing list