[Avida-SVN] r2161 - in branches/energy/source: cpu main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Tue Oct 30 06:31:59 PDT 2007


Author: beckma24
Date: 2007-10-30 09:31:58 -0400 (Tue, 30 Oct 2007)
New Revision: 2161

Modified:
   branches/energy/source/cpu/cTestCPUInterface.h
   branches/energy/source/main/cPopulation.cc
Log:
Changed return values of GetCellID and GetDemeID in cTextCPUInterface.  The old return values cause seg faults when they are used to lookup information in containers.  Problem stems from injected organisms being ran through the test CPU.  Also, fixed bug in loging of germline

Modified: branches/energy/source/cpu/cTestCPUInterface.h
===================================================================
--- branches/energy/source/cpu/cTestCPUInterface.h	2007-10-29 19:33:43 UTC (rev 2160)
+++ branches/energy/source/cpu/cTestCPUInterface.h	2007-10-30 13:31:58 UTC (rev 2161)
@@ -44,8 +44,8 @@
   cTestCPUInterface(cTestCPU* testcpu) : m_testcpu(testcpu) { ; }
   virtual ~cTestCPUInterface() { ; }
 
-  int GetCellID() { return -1; }
-  int GetDemeID() { return -1; }
+  int GetCellID() { return 0; }
+  int GetDemeID() { return 0; }
   void SetCellID(int in_id) { ; }
   void SetDemeID(int in_id) { ; }
 

Modified: branches/energy/source/main/cPopulation.cc
===================================================================
--- branches/energy/source/main/cPopulation.cc	2007-10-29 19:33:43 UTC (rev 2160)
+++ branches/energy/source/main/cPopulation.cc	2007-10-30 13:31:58 UTC (rev 2161)
@@ -1164,10 +1164,12 @@
       if(m_world->GetConfig().GERMLINE_REPLACES_SOURCE.Get()) {
         source_germline.Add(next_germ);
       }
-      
+            
       if(!m_world->GetConfig().LOG_GERMLINE.Get()) {
         target_germline.RemoveOldest();
-        source_germline.RemoveOldest();
+        if(m_world->GetConfig().GERMLINE_REPLACES_SOURCE.Get()) {
+          source_germline.RemoveOldest();
+        }
       }
       
       // Kill all the organisms in the source deme.




More information about the Avida-cvs mailing list