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

barrick at myxo.css.msu.edu barrick at myxo.css.msu.edu
Sun Aug 12 14:14:09 PDT 2007


Author: barrick
Date: 2007-08-12 17:14:09 -0400 (Sun, 12 Aug 2007)
New Revision: 1926

Modified:
   development/source/cpu/cHardwareBase.cc
   development/source/cpu/cHardwareBase.h
   development/source/cpu/cHardwareCPU.cc
   development/source/cpu/cHardwareCPU.h
   development/source/main/cAvidaConfig.h
   development/source/main/cMutationRates.cc
   development/source/main/cMutationRates.h
   development/source/main/cOrganism.cc
   development/source/main/cOrganism.h
   development/source/main/cPhenotype.cc
   development/source/main/cPopulation.cc
Log:
* simplified HardwareCPU promoter model/regulation.
* option for slip mutations to occur on h-copy
* the return of REQUIRED_BONUS to divide



Modified: development/source/cpu/cHardwareBase.cc
===================================================================
--- development/source/cpu/cHardwareBase.cc	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/cpu/cHardwareBase.cc	2007-08-12 21:14:09 UTC (rev 1926)
@@ -797,11 +797,12 @@
 }
 
 // @JEB Check implicit repro conditions -- meant to be called at the end of SingleProcess
-void cHardwareBase::CheckImplicitRepro(cAvidaContext& ctx)         
+void cHardwareBase::CheckImplicitRepro(cAvidaContext& ctx, bool exec_last_inst)         
 {  
   if( (m_world->GetConfig().IMPLICIT_REPRO_TIME.Get() && (organism->GetPhenotype().GetTimeUsed() >= m_world->GetConfig().IMPLICIT_REPRO_TIME.Get()))
    || (m_world->GetConfig().IMPLICIT_REPRO_CPU_CYCLES.Get() && (organism->GetPhenotype().GetCurBonus() >= m_world->GetConfig().IMPLICIT_REPRO_CPU_CYCLES.Get()))
-   || (m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get() && (organism->GetPhenotype().GetCPUCyclesUsed() >= m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get())) )
+   || (m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get() && (organism->GetPhenotype().GetCPUCyclesUsed() >= m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get()))
+   || (m_world->GetConfig().IMPLICIT_REPRO_END.Get() && exec_last_inst ))
   {
     Inst_Repro(ctx);
   }

Modified: development/source/cpu/cHardwareBase.h
===================================================================
--- development/source/cpu/cHardwareBase.h	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/cpu/cHardwareBase.h	2007-08-12 21:14:09 UTC (rev 1926)
@@ -182,7 +182,7 @@
   bool Inst_Nop(cAvidaContext& ctx);  // A no-operation instruction that does nothing! 
   
   // -------- Implicit Repro Check/Instruction -------- @JEB
-  void CheckImplicitRepro(cAvidaContext& ctx);
+  void CheckImplicitRepro(cAvidaContext& ctx, bool exec_last_inst = false);
   virtual bool Inst_Repro(cAvidaContext& ctx);
 };
 

Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/cpu/cHardwareCPU.cc	2007-08-12 21:14:09 UTC (rev 1926)
@@ -454,6 +454,24 @@
     if(!m_has_energy_costs && inst_energy_cost[i]) m_has_energy_costs = true;
   }
 #endif   
+
+  if (m_world->GetConfig().PROMOTERS_ENABLED.Get())
+  {
+    // Ideally, this wouldn't be hard-coded
+    cInstruction promoter_inst = m_world->GetHardwareManager().GetInstSet().GetInst(cStringUtil::Stringf("promoter"));
+    promoter_search_pos = 0;
+    promoter_inst_executed = 0;
+    promoter_pos.Resize(0);
+    promoter_active.Resize(0);
+    for (int i=0; i<GetMemory().GetSize(); i++)
+    {
+      if ( (GetMemory())[i] == promoter_inst)
+      {
+        promoter_pos.Push(i);
+        promoter_active.Push(true);
+      }
+    }
+  }
 }
 
 void cHardwareCPU::cLocalThread::operator=(const cLocalThread& in_thread)
@@ -485,6 +503,8 @@
 
 void cHardwareCPU::SingleProcess(cAvidaContext& ctx)
 {
+  int last_IP_pos = IP().GetPosition();
+
   // Mark this organism as running...
   organism->SetRunning(true);
   
@@ -541,6 +561,11 @@
         exec = !( ctx.GetRandom().P(m_inst_set->GetProbFail(cur_inst)) );
       }
       
+      //Add to the promoter inst executed count before executing the inst (in case it is a terminator)
+      if (m_world->GetConfig().PROMOTERS_ENABLED.Get() == 1) {
+        promoter_inst_executed++;
+      }
+
       if (exec == true) SingleProcess_ExecuteInst(ctx, cur_inst);
       
       // Some instruction (such as jump) may turn m_advance_ip off.  Usually
@@ -552,20 +577,24 @@
       
       // In the promoter model, there may be a chance of termination
       // that causes execution to start at a new instruction (per instruction executed)
-      if ( m_world->GetConfig().PROMOTERS_ENABLED.Get() ) {
+      if ( m_world->GetConfig().PROMOTERS_ENABLED.Get() == 1 ) {
         const double processivity = m_world->GetConfig().PROMOTER_PROCESSIVITY_INST.Get();
         if ( ctx.GetRandom().P(1-processivity) ) Inst_Terminate(ctx);
       }
+      
     } // if exec
     
     // In the promoter model, there may be a chance of termination
     // that causes execution to start at a new instruction (per cpu cycle executed)
     // @JEB - since processivities usually v. close to 1 it doesn't
     // improve speed much to combine with "per instruction" block
-    if ( m_world->GetConfig().PROMOTERS_ENABLED.Get() )
+    if ( m_world->GetConfig().PROMOTERS_ENABLED.Get() == 1 )
     {
       const double processivity = m_world->GetConfig().PROMOTER_PROCESSIVITY.Get();
-      if ( ctx.GetRandom().P(1-processivity) ) Inst_Terminate(ctx);
+      if ( ctx.GetRandom().P(1-processivity) ) 
+        Inst_Terminate(ctx);
+      if ( m_world->GetConfig().PROMOTER_MAX_INST.Get() && (promoter_inst_executed >= m_world->GetConfig().PROMOTER_MAX_INST.Get()) ) 
+        Inst_Terminate(ctx);
     }
     
   } // Previous was executed once for each thread...
@@ -578,7 +607,7 @@
   }
   
   organism->SetRunning(false);
-  CheckImplicitRepro(ctx);
+  CheckImplicitRepro(ctx, last_IP_pos > IP().GetPosition());
 }
 
 // This method will handle the actual execution of an instruction
@@ -683,6 +712,16 @@
   fp << "  Mem (" << GetMemory().GetSize() << "):"
 		  << "  " << GetMemory().AsString()
 		  << endl;
+      
+  if (m_world->GetConfig().PROMOTERS_ENABLED.Get())
+  {
+    fp << "Promoters:";
+    for (int i=0; i<promoter_pos.GetSize(); i++)
+    {
+      fp << " " << promoter_pos[i] << "-" << promoter_active[i]; 
+    }
+    fp << endl;
+  }    
   fp.flush();
 }
 
@@ -1249,7 +1288,7 @@
   
   // Handle Divide Mutations...
   Divide_DoMutations(ctx, mut_multiplier);
-  
+
   // Many tests will require us to run the offspring through a test CPU;
   // this is, for example, to see if mutations need to be reverted or if
   // lineages need to be updated.
@@ -2495,6 +2534,8 @@
   // these checks should be done, but currently they make some assumptions
   // that crash when evaluating this kind of organism -- JEB
 
+  if (organism->GetPhenotype().GetCurBonus() < m_world->GetConfig().REQUIRED_BONUS.Get()) return false;
+  
   // Setup child
   cCPUMemory& child_genome = organism->ChildGenome();
   child_genome = GetMemory();
@@ -2534,11 +2575,12 @@
   
   if (m_world->GetConfig().DIVIDE_METHOD.Get() == DIVIDE_METHOD_SPLIT) m_advance_ip = false;
   
-  organism->ActivateDivide(ctx);
+  const bool parent_alive = organism->ActivateDivide(ctx);
   
   //Reset the parent
-  if (m_world->GetConfig().DIVIDE_METHOD.Get() == DIVIDE_METHOD_SPLIT) Reset();
-
+  if (parent_alive) {
+    if (m_world->GetConfig().DIVIDE_METHOD.Get() == DIVIDE_METHOD_SPLIT) Reset();
+  }
   return true;
 }
 
@@ -4036,12 +4078,17 @@
   }
   
 //  cpu_stats.mut_stats.copies_exec++;
-  
   write_head.SetInst(read_inst);
   write_head.SetFlagCopied();  // Set the copied flag...
   
   read_head.Advance();
   write_head.Advance();
+  
+  //Slip mutations
+   if (organism->TestCopySlip(ctx)) {
+    read_head.Set(ctx.GetRandom().GetInt(organism->GetGenome().GetSize()));
+  }
+  
   return true;
 }
 
@@ -4202,6 +4249,53 @@
 // Adjust the weight at promoter positions that match the downstream nop pattern
 void cHardwareCPU::RegulatePromoterNop(cAvidaContext& ctx, bool up)
 {
+  const int max_distance_to_promoter = 10;
+  
+  // Look for the label directly (no complement)
+  // Save the position before the label, so we don't count it as a regulatory site
+  int start_pos = IP().GetPosition(); 
+  ReadLabel();
+  
+  // Don't allow zero-length label matches. These are too powerful.
+  if (GetLabel().GetSize() == 0) return;
+ 
+  cHeadCPU search_head(IP());
+  do {
+    search_head++;
+    cHeadCPU match_head(search_head);
+
+    // See whether a matching label is here
+    int i;
+    for (i=0; i < GetLabel().GetSize(); i++)
+    {
+      match_head++;
+      if ( !m_inst_set->IsNop(match_head.GetInst() ) 
+        || (GetLabel()[i] != m_inst_set->GetNopMod( match_head.GetInst())) ) break;
+    }
+  
+    // Matching label found
+    if (i == GetLabel().GetSize())
+    {
+      //Check eack promoter
+      int start_pos = match_head.GetPosition();
+      int end_pos = start_pos + max_distance_to_promoter;
+      int circle_end = end_pos % GetMemory().GetSize(); //annoying circular genomes
+
+      for (int j=0; j<promoter_pos.GetSize(); j++)
+      {
+        if ( (promoter_pos[j] >= start_pos) && (promoter_pos[j] < end_pos) ) promoter_active[j] = up;
+        if ( (circle_end != end_pos) &&  (promoter_pos[j] >= 0) && (promoter_pos[j] < circle_end) ) promoter_active[j] = up;
+
+      }
+    }
+  } while ( start_pos != search_head.GetPosition() );
+}
+
+
+/* Alternate version, cleanup later @JEB
+// Adjust the weight at promoter positions that match the downstream nop pattern
+void cHardwareCPU::RegulatePromoterNop(cAvidaContext& ctx, bool up)
+{
   static cInstruction promoter_inst = GetInstSet().GetInst(cStringUtil::Stringf("promoter"));
   const int max_distance_to_promoter = 10;
   
@@ -4240,22 +4334,21 @@
           {
             organism->GetPhenotype().RegulatePromoter(change_head.GetPosition(), up);
           }
-          /*
           else
           {
             // I can't seem to get resizing promoter arrays on memory allocation to work.
             // Promoter weights still get unsynched from the genome size somewhere. @JEB
-            cout << change_head.GetPosition() << endl;
-            cout << organism->GetPhenotype().GetCurPromoterWeights().GetSize() << endl;
-            cout << GetMemory().GetSize() << endl;
-            cout << GetMemory().AsString() << endl;
+            //cout << change_head.GetPosition() << endl;
+            //cout << organism->GetPhenotype().GetCurPromoterWeights().GetSize() << endl;
+            //cout << GetMemory().GetSize() << endl;
+            //cout << GetMemory().AsString() << endl;
           }
-          */
         }
       }
     }
   } while ( start_pos != search_head.GetPosition() );
 }
+*/
 
 // Adjust the weight at promoter positions that match the downstream nop pattern
 void cHardwareCPU::RegulatePromoterNopIfGT0(cAvidaContext& ctx, bool up)
@@ -4276,18 +4369,59 @@
   GetHead(nHardware::HEAD_READ).Set(read_head_pos);
 
   // We want to execute the promoter that we land on.
+  promoter_inst_executed = 0;
   m_advance_ip = false;
   organism->GetPhenotype().SetTerminated(true);
   
   //organism->ClearInput();
   
+  // Find the next active promoter
+  int started_search_pos = promoter_search_pos;
+  
+  while (promoter_pos.GetSize() > 0) // conditional infinite loop, breaks out
+  {
+    promoter_search_pos++;
+    promoter_search_pos %= promoter_active.GetSize();
+    if (promoter_active[promoter_search_pos]) break;
+    if (started_search_pos == promoter_search_pos) break;
+  } 
+  
+  //Can't find a promoter -- start at the beginning of the genome (or die! or sleep!)
+  if ((promoter_pos.GetSize() == 0) || ((promoter_search_pos == started_search_pos) && (!promoter_active[promoter_search_pos])))
+  {
+    IP().Set(0);
+  }
+  else
+  {
+    IP().Set(promoter_pos[promoter_search_pos]);
+  }
+  
+  return true;
+}
+
+/* Older version... @JEB
+// Move execution to a new promoter
+bool cHardwareCPU::Inst_Terminate(cAvidaContext& ctx)
+{
+  // Reset the CPU, clearing everything except R/W head positions.
+  const int write_head_pos = GetHead(nHardware::HEAD_WRITE).GetPosition();
+  const int read_head_pos = GetHead(nHardware::HEAD_READ).GetPosition();
+  m_threads[m_cur_thread].Reset(this, m_threads[m_cur_thread].GetID());
+  GetHead(nHardware::HEAD_WRITE).Set(write_head_pos);
+  GetHead(nHardware::HEAD_READ).Set(read_head_pos);
+
+  // We want to execute the promoter that we land on.
+  m_advance_ip = false;
+  organism->GetPhenotype().SetTerminated(true);
+  
+  //organism->ClearInput();
+  
   // Get the promoter weight list
   double total_weight = 0;
   tArray<double> w = organism->GetPhenotype().GetCurPromoterWeights();
   for (int i = 0; i < w.GetSize(); i++) {
     total_weight += w[i];
   }
- 
    
   // If there is no weight (for example if there are no promoters)
   // then randomly choose a starting position
@@ -4314,6 +4448,7 @@
   }  
   return true;
 }
+*/
 
 bool cHardwareCPU::Inst_Promoter(cAvidaContext& ctx)
 {

Modified: development/source/cpu/cHardwareCPU.h
===================================================================
--- development/source/cpu/cHardwareCPU.h	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/cpu/cHardwareCPU.h	2007-08-12 21:14:09 UTC (rev 1926)
@@ -138,6 +138,12 @@
   bool m_advance_ip;         // Should the IP advance after this instruction?
   bool m_executedmatchstrings;	// Have we already executed the match strings instruction?
   
+  // Promoter model
+  int promoter_search_pos;      //site to begin looking for the next active promoter from
+  int promoter_inst_executed;   //num inst executed since last termination
+  tArray<int> promoter_pos;     //positions with promoter instructions
+  tArray<bool> promoter_active; //whether each promoter is active (same size as promoter_pos)
+  
   bool SingleProcess_ExecuteInst(cAvidaContext& ctx, const cInstruction& cur_inst);
   
   // --------  Stack Manipulation...  --------
@@ -520,6 +526,7 @@
   bool Inst_GetUpdate(cAvidaContext& ctx);
 
   //// Promoter Model ////
+  
   void GetPromoterPattern(tArray<int>& promoter);
   void RegulatePromoter(cAvidaContext& ctx, bool up);
   bool Inst_UpRegulatePromoter(cAvidaContext& ctx) { RegulatePromoter(ctx, true); return true; }

Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/main/cAvidaConfig.h	2007-08-12 21:14:09 UTC (rev 1926)
@@ -245,13 +245,16 @@
   CONFIG_ADD_VAR(REQUIRED_TASK, int, -1, "Task ID required for successful divide.");
   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(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_GROUP(MUTATION_GROUP, "Mutations");
   CONFIG_ADD_VAR(POINT_MUT_PROB, double, 0.0, "Mutation rate (per-location per update)");
   CONFIG_ADD_VAR(COPY_MUT_PROB, double, 0.0075, "Mutation rate (per copy)");
+  CONFIG_ADD_VAR(COPY_SLIP_PROB, double, 0.0, "Slip rate (per copy)");
   CONFIG_ADD_VAR(INS_MUT_PROB, double, 0.0, "Insertion rate (per site, applied on divide)");
   CONFIG_ADD_VAR(DEL_MUT_PROB, double, 0.0, "Deletion rate (per site, applied on divide)");
   CONFIG_ADD_VAR(DIV_MUT_PROB, double, 0.0, "Mutation rate (per site, applied on divide)");
@@ -375,6 +378,7 @@
 
   CONFIG_ADD_GROUP(PROMOTER_GROUP, "Promoters");
   CONFIG_ADD_VAR(PROMOTERS_ENABLED, int, 0, "Use the promoter/terminator execution scheme.\nCertain instructions must also be included.");
+  CONFIG_ADD_VAR(PROMOTER_MAX_INST, int, 20, "Maximum number of instructions to execute before terminating.");
   CONFIG_ADD_VAR(PROMOTER_PROCESSIVITY, double, 1.0, "Chance of not terminating after each cpu cycle.");
   CONFIG_ADD_VAR(PROMOTER_PROCESSIVITY_INST, double, 1.0, "Chance of not terminating after each instruction.");
   CONFIG_ADD_VAR(PROMOTER_BG_STRENGTH, double, 0, "Probability of positions that are not promoter\ninstructions initiating execution (promoters are 1).");

Modified: development/source/main/cMutationRates.cc
===================================================================
--- development/source/main/cMutationRates.cc	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/main/cMutationRates.cc	2007-08-12 21:14:09 UTC (rev 1926)
@@ -33,6 +33,7 @@
 {
   exec.point_mut_prob = world->GetConfig().POINT_MUT_PROB.Get();
   copy.mut_prob = world->GetConfig().COPY_MUT_PROB.Get();
+  copy.slip_prob = world->GetConfig().COPY_SLIP_PROB.Get();
   divide.ins_prob = world->GetConfig().INS_MUT_PROB.Get();
   divide.del_prob = world->GetConfig().DEL_MUT_PROB.Get();
   divide.mut_prob = world->GetConfig().DIV_MUT_PROB.Get();
@@ -53,6 +54,7 @@
 {
   exec.point_mut_prob = 0.0;
   copy.mut_prob = 0.0;
+  copy.slip_prob = 0.0;
   divide.ins_prob = 0.0;
   divide.del_prob = 0.0;
   divide.mut_prob = 0.0;
@@ -73,6 +75,7 @@
 {
   exec.point_mut_prob = in_muts.exec.point_mut_prob;
   copy.mut_prob = in_muts.copy.mut_prob;
+  copy.slip_prob = in_muts.copy.slip_prob;
   divide.ins_prob = in_muts.divide.ins_prob;
   divide.del_prob = in_muts.divide.del_prob;
   divide.mut_prob = in_muts.divide.mut_prob;
@@ -80,7 +83,7 @@
   divide.divide_mut_prob = in_muts.divide.divide_mut_prob;
   divide.divide_ins_prob = in_muts.divide.divide_ins_prob;
   divide.divide_del_prob = in_muts.divide.divide_del_prob;
-  divide.divide_slip_prob = in_muts.divide.divide_slip_prob;;
+  divide.divide_slip_prob = in_muts.divide.divide_slip_prob;
   divide.parent_mut_prob = in_muts.divide.parent_mut_prob;
   inject.ins_prob = in_muts.inject.ins_prob;
   inject.del_prob = in_muts.inject.del_prob;

Modified: development/source/main/cMutationRates.h
===================================================================
--- development/source/main/cMutationRates.h	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/main/cMutationRates.h	2007-08-12 21:14:09 UTC (rev 1926)
@@ -49,6 +49,7 @@
   // ...during an instruction copy...
   struct sCopyMuts {
     double mut_prob;
+    double slip_prob;
   };
   sCopyMuts copy;
 
@@ -96,6 +97,7 @@
   bool TestCopyMut(cAvidaContext& ctx) const { return ctx.GetRandom().P(copy.mut_prob); }
   bool TestCopyIns(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.ins_prob); }
   bool TestCopyDel(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.del_prob); }
+  bool TestCopySlip(cAvidaContext& ctx) const { return (copy.slip_prob == 0.0) ? 0 : ctx.GetRandom().P(copy.slip_prob); }
   bool TestDivideMut(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.divide_mut_prob); }
   bool TestDivideIns(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.divide_ins_prob); }
   bool TestDivideDel(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.divide_del_prob); }

Modified: development/source/main/cOrganism.cc
===================================================================
--- development/source/main/cOrganism.cc	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/main/cOrganism.cc	2007-08-12 21:14:09 UTC (rev 1926)
@@ -541,7 +541,9 @@
       return false; //  (divide fails)
     } 
   }
-
+  
+  if (GetPhenotype().GetCurBonus() < m_world->GetConfig().REQUIRED_BONUS.Get()) return false;
+  
   const int required_reaction = m_world->GetConfig().REQUIRED_REACTION.Get();
   if (required_reaction != -1 && m_phenotype.GetCurTaskCount()[required_reaction] == 0) {
     Fault(FAULT_LOC_DIVIDE, FAULT_TYPE_ERROR,

Modified: development/source/main/cOrganism.h
===================================================================
--- development/source/main/cOrganism.h	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/main/cOrganism.h	2007-08-12 21:14:09 UTC (rev 1926)
@@ -254,6 +254,7 @@
   bool TestCopyMut(cAvidaContext& ctx) const { return m_mut_rates.TestCopyMut(ctx); }
   bool TestCopyIns(cAvidaContext& ctx) const { return m_mut_rates.TestCopyIns(ctx); }
   bool TestCopyDel(cAvidaContext& ctx) const { return m_mut_rates.TestCopyDel(ctx); }
+  bool TestCopySlip(cAvidaContext& ctx) const { return m_mut_rates.TestCopySlip(ctx); }
   bool TestDivideMut(cAvidaContext& ctx) const { return m_mut_rates.TestDivideMut(ctx); }
   bool TestDivideIns(cAvidaContext& ctx) const { return m_mut_rates.TestDivideIns(ctx); }
   bool TestDivideDel(cAvidaContext& ctx) const { return m_mut_rates.TestDivideDel(ctx); }

Modified: development/source/main/cPhenotype.cc
===================================================================
--- development/source/main/cPhenotype.cc	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/main/cPhenotype.cc	2007-08-12 21:14:09 UTC (rev 1926)
@@ -297,7 +297,7 @@
   cur_task_time.SetAll(0.0);  // Added for time tracking; WRE 03-18-07
   for (int j = 0; j < sensed_resources.GetSize(); j++)
 	      sensed_resources[j] =  parent_phenotype.sensed_resources[j];
-  SetupPromoterWeights(_genome, true);
+  //SetupPromoterWeights(_genome, true);
   cur_trial_fitnesses.Resize(0); 
   cur_trial_bonuses.Resize(0); 
   cur_trial_times_used.Resize(0); 
@@ -431,7 +431,7 @@
   sensed_resources.SetAll(0);
   cur_sense_count.SetAll(0);
   cur_task_time.SetAll(0.0);
-  SetupPromoterWeights(_genome, true);
+  //SetupPromoterWeights(_genome, true);
   cur_trial_fitnesses.Resize(0);
   cur_trial_bonuses.Resize(0); 
   cur_trial_times_used.Resize(0); 
@@ -661,7 +661,7 @@
     cpu_cycles_used = 0;
     time_used = 0;
     neutral_metric += m_world->GetRandom().GetRandNormal();
-    SetupPromoterWeights(_genome, true);
+    //SetupPromoterWeights(_genome, true);
   }
 
   if (m_world->GetConfig().GENERATION_INC_METHOD.Get() == GENERATION_INC_BOTH) generation++;
@@ -725,7 +725,7 @@
   cur_sense_count.SetAll(0); 
   cur_task_time.SetAll(0.0);
   sensed_resources.SetAll(-1.0);
-  SetupPromoterWeights(_genome, true);
+ //SetupPromoterWeights(_genome, true);
   cur_trial_fitnesses.Resize(0); 
   cur_trial_bonuses.Resize(0); 
   cur_trial_times_used.Resize(0); 
@@ -1666,7 +1666,7 @@
     cpu_cycles_used = 0;
     time_used = 0;
     neutral_metric += m_world->GetRandom().GetRandNormal();
-    SetupPromoterWeights(_genome, true);
+    //SetupPromoterWeights(_genome, true);
   }
 
   if (m_world->GetConfig().GENERATION_INC_METHOD.Get() == GENERATION_INC_BOTH) generation++;

Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc	2007-08-10 20:34:47 UTC (rev 1925)
+++ development/source/main/cPopulation.cc	2007-08-12 21:14:09 UTC (rev 1926)
@@ -418,8 +418,10 @@
 void cPopulation::ActivateOrganism(cAvidaContext& ctx, cOrganism* in_organism, cPopulationCell& target_cell)
 {
   assert(in_organism != NULL);
-  assert(in_organism->GetGenome().GetSize() > 1);
-  
+  assert(in_organism->GetGenome().GetSize() >= 1);
+//  assert(in_organism->GetGenome().GetSize() >= 1);
+
+
   in_organism->SetOrgInterface(new cPopulationInterface(m_world));
   
   // If the organism does not have a genotype, give it one!  No parent




More information about the Avida-cvs mailing list