[avida-cvs] avida CVS commits: /current/source/main population.cc
mercere99
avida-cvs at alife.org
Wed Dec 10 22:18:43 PST 2003
mercere99 Wed Dec 10 14:18:43 2003 EDT
Modified files:
/avida/current/source/main population.cc
Log:
Added in a new option to genesis: PREFER_EMPTY. This determines is the
birth method should also go to empty cells first. If not, then random
birth placement will be truly random.
Index: avida/current/source/main/population.cc
diff -u avida/current/source/main/population.cc:1.123 avida/current/source/main/population.cc:1.124
--- avida/current/source/main/population.cc:1.123 Wed Dec 10 13:56:57 2003
+++ avida/current/source/main/population.cc Wed Dec 10 14:18:43 2003
@@ -703,7 +703,14 @@
// First, check if there is an empty organism to work with (always preferred)
tList<cPopulationCell> & conn_list = parent_cell.ConnectionList();
- FindEmptyCell(conn_list, found_list);
+
+ if (cConfig::GetPreferEmpty() == false &&
+ cConfig::GetBirthMethod == POSITION_CHILD_RANDOM) {
+ found_list.Append(conn_list);
+ if (parent_ok == true) found_list.Push(&parent_cell);
+ } else {
+ FindEmptyCell(conn_list, found_list);
+ }
// If we have not found an empty organism, we must use the specified function
// to determine how to choose among the filled organisms.
More information about the Avida-cvs
mailing list