[Avida-SVN] r1640 - development/source/cpu
dknoester at myxo.css.msu.edu
dknoester at myxo.css.msu.edu
Tue Jun 5 05:24:36 PDT 2007
Author: dknoester
Date: 2007-06-05 08:24:35 -0400 (Tue, 05 Jun 2007)
New Revision: 1640
Modified:
development/source/cpu/cHardwareGX.cc
Log:
Bugfixes.
Modified: development/source/cpu/cHardwareGX.cc
===================================================================
--- development/source/cpu/cHardwareGX.cc 2007-06-04 17:36:38 UTC (rev 1639)
+++ development/source/cpu/cHardwareGX.cc 2007-06-05 12:24:35 UTC (rev 1640)
@@ -457,11 +457,16 @@
// Kill creatures who have reached their max num of instructions executed.
const int max_executed = organism->GetMaxExecuted();
- if ((max_executed > 0 && phenotype.GetTimeUsed() >= max_executed)
+ if((max_executed > 0 && phenotype.GetTimeUsed() >= max_executed)
|| phenotype.GetToDie() == true) {
organism->Die();
- }
+ }
+ // Kill organisms that have no active programids.
+ if(m_programids.size() == 0) {
+ organism->Die();
+ }
+
organism->SetRunning(false);
}
@@ -3498,6 +3503,7 @@
cHeadProgramid& write = GetHead(nHardware::HEAD_WRITE);
cHeadProgramid& read = GetHead(nHardware::HEAD_READ);
read.Adjust(); // Strange things can happen (like we're reading from a programid that was being written).
+ write.Adjust(); // Always adjust if the memory spaces themselves are accessed.
// Don't copy if this programid's write or read head is on itself
if(read.GetMemSpace() == m_current->GetID()) return false;
More information about the Avida-cvs
mailing list