[Avida-SVN] r3073 - branches/hjg-dev/source/cpu
hjg at myxo.css.msu.edu
hjg at myxo.css.msu.edu
Mon Dec 22 16:44:22 PST 2008
Author: hjg
Date: 2008-12-22 19:44:22 -0500 (Mon, 22 Dec 2008)
New Revision: 3073
Modified:
branches/hjg-dev/source/cpu/cHardwareCPU.cc
Log:
bug fix
Modified: branches/hjg-dev/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/hjg-dev/source/cpu/cHardwareCPU.cc 2008-12-23 00:21:29 UTC (rev 3072)
+++ branches/hjg-dev/source/cpu/cHardwareCPU.cc 2008-12-23 00:44:22 UTC (rev 3073)
@@ -7377,7 +7377,8 @@
num = organism->MatchOutputBuffer(cString("11111111"));
}*/
- map < int, cString> my_strings = m_world->GetEnvironment().GetMatchStringsFromTask();
+ if (organism->GetTagLabel() != -1){
+ map < int, cString> my_strings = m_world->GetEnvironment().GetMatchStringsFromTask();
// iterate through the vector until you find the right tag.
// then check if the buffer matches it.
// record the size
@@ -7388,12 +7389,13 @@
//}
//}
- num = organism->MatchOutputBuffer(my_strings[organism->GetTagLabel()]);
- size = my_strings[organism->GetTagLabel()].GetSize();
+ num = organism->MatchOutputBuffer(my_strings[organism->GetTagLabel()]);
+ size = my_strings[organism->GetTagLabel()].GetSize();
- if (num == size) {
- organism->AddRawMaterials(organism->GetTagLabel(), 1, organism->GetID());
- organism->SetOutputNegative1() ;
+ if (num == size) {
+ organism->AddRawMaterials(organism->GetTagLabel(), 1, organism->GetID());
+ organism->SetOutputNegative1() ;
+ }
}
return true;
}
More information about the Avida-cvs
mailing list