[Avida-SVN] r3227 - branches/goings/source/cpu
goingssh at myxo.css.msu.edu
goingssh at myxo.css.msu.edu
Mon May 4 16:51:57 PDT 2009
Author: goingssh
Date: 2009-05-04 19:51:57 -0400 (Mon, 04 May 2009)
New Revision: 3227
Modified:
branches/goings/source/cpu/cHardwareBase.cc
Log:
Modified: branches/goings/source/cpu/cHardwareBase.cc
===================================================================
--- branches/goings/source/cpu/cHardwareBase.cc 2009-05-04 22:38:44 UTC (rev 3226)
+++ branches/goings/source/cpu/cHardwareBase.cc 2009-05-04 23:51:57 UTC (rev 3227)
@@ -566,6 +566,7 @@
if (phenotype.CopyTrue() == true) return false;
const double parent_fitness = m_organism->GetTestFitness(ctx);
+ const tArray<int>& parenttasks = phenotype.GetCurTaskCount();
const double neut_min = parent_fitness * (1.0 - m_organism->GetNeutralMin());
const double neut_max = parent_fitness * (1.0 + m_organism->GetNeutralMax());
@@ -605,15 +606,14 @@
// check if child has lost any tasks parent had AND not gained any new tasks
if (ctx.GetRandom().P(m_organism->GetRevertTaskLoss())) {
const tArray<int>& childtasks = test_info.GetTestPhenotype().GetCurTaskCount();
- const tArray<int>& parenttasks = phenotype.GetCurTaskCount();
bool del = false;
bool added = false;
for (int i=0; i<childtasks.GetSize(); i++)
- if (childtasks[i]>0 && parenttasks[i] == 0) {
+ if (childtasks[i] > parenttasks[i]) {
added = true;
break;
}
- else if (childtasks[i] == 0 && parenttasks[i] > 0)
+ else if (childtasks[i] < parenttasks[i])
del = true;
revert = (del && !added);
}
More information about the Avida-cvs
mailing list