[Avida-cvs] [Avida2-svn] r259 - trunk/source/main
baerb@myxo.css.msu.edu
baerb at myxo.css.msu.edu
Mon Jul 25 08:21:49 PDT 2005
Author: baerb
Date: 2005-07-25 11:21:49 -0400 (Mon, 25 Jul 2005)
New Revision: 259
Modified:
trunk/source/main/population.cc
Log:
Fixed problem where genotype map elements were not being set to zero if
the cell were not occupied.
Modified: trunk/source/main/population.cc
===================================================================
--- trunk/source/main/population.cc 2005-07-25 05:08:20 UTC (rev 258)
+++ trunk/source/main/population.cc 2005-07-25 15:21:49 UTC (rev 259)
@@ -1188,9 +1188,17 @@
int min_genome_length = INT_MAX;
for (int i = 0; i < cell_array.GetSize(); i++) {
+
// Only look at cells with organisms in them.
- if (cell_array[i].IsOccupied() == false) continue;
+ if (cell_array[i].IsOccupied() == false) {
+
+ // Genotype map needs zero for all non-occupied cells
+
+ stats.SetGenoMapElement(i, 0);
+ continue;
+ }
+
cOrganism * organism = cell_array[i].GetOrganism();
const cPhenotype & phenotype = organism->GetPhenotype();
const cMerit cur_merit = phenotype.GetMerit();
More information about the Avida-cvs
mailing list