[Avida-SVN] r3122 - in development/source: cpu main

jbarrick at myxo.css.msu.edu jbarrick at myxo.css.msu.edu
Sun Jan 18 09:27:43 PST 2009


Author: jbarrick
Date: 2009-01-18 12:27:43 -0500 (Sun, 18 Jan 2009)
New Revision: 3122

Modified:
   development/source/cpu/cHardwareCPU.cc
   development/source/main/cAvidaConfig.h
Log:
new config option to require exact copy for divide to succeed

Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc	2009-01-16 18:41:14 UTC (rev 3121)
+++ development/source/cpu/cHardwareCPU.cc	2009-01-18 17:27:43 UTC (rev 3122)
@@ -1423,6 +1423,11 @@
   cGenome & child_genome = m_organism->ChildGenome();
   child_genome = cGenomeUtil::Crop(m_memory, div_point, div_point+child_size);
   
+  // Make sure it is an exact copy at this point (before divide mutations) if required
+  if (m_world->GetConfig().REQUIRE_EXACT_COPY.Get() && (m_organism->GetGenome() != child_genome) ) {
+    return false;
+  }
+  
   // Cut off everything in this memory past the divide point.
   m_memory.Resize(div_point);
   

Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h	2009-01-16 18:41:14 UTC (rev 3121)
+++ development/source/main/cAvidaConfig.h	2009-01-18 17:27:43 UTC (rev 3122)
@@ -371,12 +371,12 @@
   CONFIG_ADD_VAR(IMMUNITY_TASK, int, -1, "Task providing immunity from the required task.");
   CONFIG_ADD_VAR(REQUIRED_REACTION, int, -1, "Reaction ID required for successful divide.");
   CONFIG_ADD_VAR(REQUIRED_BONUS, double, 0.0, "Required bonus to divide.");
+  CONFIG_ADD_VAR(REQUIRE_EXACT_COPY, int, 0, "Require offspring to be an exact copy (only divide mutations allowed).");
   CONFIG_ADD_VAR(IMPLICIT_REPRO_BONUS, int, 0, "Call Inst_Repro to divide upon achieving this bonus. 0 = OFF");  
   CONFIG_ADD_VAR(IMPLICIT_REPRO_CPU_CYCLES, int, 0, "Call Inst_Repro after this many cpu cycles. 0 = OFF");  
   CONFIG_ADD_VAR(IMPLICIT_REPRO_TIME, int, 0, "Call Inst_Repro after this time used. 0 = OFF");  
   CONFIG_ADD_VAR(IMPLICIT_REPRO_END, int, 0, "Call Inst_Repro after executing the last instruction in the genome.");  
   CONFIG_ADD_VAR(IMPLICIT_REPRO_ENERGY, double, 0.0, "Call Inst_Repro if organism accumulates this amount of energy.");    
-
   
   CONFIG_ADD_GROUP(MUTATION_GROUP, "Mutations");
   CONFIG_ADD_VAR(POINT_MUT_PROB, double, 0.0, "Mutation rate (per-location per update)");




More information about the Avida-cvs mailing list