[Avida-cvs] [Avida2-svn] r328 - in trunk/source: cpu support

brysonda@myxo.css.msu.edu brysonda at myxo.css.msu.edu
Wed Sep 28 16:37:58 PDT 2005


Author: brysonda
Date: 2005-09-28 19:37:58 -0400 (Wed, 28 Sep 2005)
New Revision: 328

Modified:
   trunk/source/cpu/cHardwareSMT.cc
   trunk/source/support/genesis.smt
Log:
SMT: Apparently something assumes that cCPUMemory objects will always have size > 0. Just set a Nop-A entry for now.

Modified: trunk/source/cpu/cHardwareSMT.cc
===================================================================
--- trunk/source/cpu/cHardwareSMT.cc	2005-09-28 19:08:57 UTC (rev 327)
+++ trunk/source/cpu/cHardwareSMT.cc	2005-09-28 23:37:58 UTC (rev 328)
@@ -752,7 +752,7 @@
   }
   
   if (end_pos < MIN_INJECT_SIZE) {
-    GetMemory(mem_space_used) = cGenome(0); 
+    GetMemory(mem_space_used) = cGenome('a'); 
     Fault(FAULT_LOC_INJECT, FAULT_TYPE_ERROR, "inject: new size too small");
     return false; // (inject fails)
   }
@@ -786,7 +786,7 @@
   //************** CALL ENDS HERE ******************//
 	
   //reset the memory space which was injected
-  GetMemory(mem_space_used) = cGenome(0); 
+  GetMemory(mem_space_used) = cGenome('a'); 
 	
   for(int x=0; x<nHardware::NUM_HEADS; x++) {
 		GetHead(x).Reset(IP().GetMemSpace(), this);
@@ -1566,14 +1566,13 @@
 {
   int write_head_pos = GetHead(nHardware::HEAD_WRITE).GetPosition();
   
+  // DDD - change to allow ???
   // We're going to disallow division calls from memory spaces other than zero 
   // for right now -law
-  if(IP().GetMemSpace()!=0)
-    return false;
+  if(IP().GetMemSpace() != 0) return false;
 	
   // Make sure this divide will produce a viable offspring.
-  if(!Divide_CheckViable(GetMemory(IP().GetMemSpace()).GetSize(), 
-												 write_head_pos, mem_space_used)) 
+  if(!Divide_CheckViable(GetMemory(IP().GetMemSpace()).GetSize(), write_head_pos, mem_space_used)) 
     return false;
   
   // Since the divide will now succeed, set up the information to be sent
@@ -1600,7 +1599,7 @@
   bool parent_alive = organism->ActivateDivide();
 	
   //reset the memory of the memory space that has been divided off
-  GetMemory(mem_space_used) = cGenome(0); 
+  GetMemory(mem_space_used) = cGenome('a'); 
 	
   // 3 Division Methods:
   // 1) DIVIDE_METHOD_OFFSPRING - Create a child, leave parent state untouched.

Modified: trunk/source/support/genesis.smt
===================================================================
--- trunk/source/support/genesis.smt	2005-09-28 19:08:57 UTC (rev 327)
+++ trunk/source/support/genesis.smt	2005-09-28 23:37:58 UTC (rev 328)
@@ -11,8 +11,8 @@
 END_CONDITION_MODE 0    # End run when ...
                         # 0 = MAX_UPDATES _OR_ MAX_GENERATIONS is reached
                         # 1 = MAX_UPDATES _AND_ MAX_GENERATIONS is reached
-WORLD-X 30              # Width of the world in Avida mode.
-WORLD-Y 30              # Height of the world in Avida mode.
+WORLD-X 60              # Width of the world in Avida mode.
+WORLD-Y 60              # Height of the world in Avida mode.
 RANDOM_SEED 0           # Random number seed. (0 for based on time)
 HARDWARE_TYPE 2         # 0 = Original CPUs
                         # 1 = New, Stack-based CPUs




More information about the Avida-cvs mailing list