[Avida-SVN] r2769 - in branches/movement: . source/main
welsberr at myxo.css.msu.edu
welsberr at myxo.css.msu.edu
Thu Sep 4 14:44:48 PDT 2008
Author: welsberr
Date: 2008-09-04 17:44:47 -0400 (Thu, 04 Sep 2008)
New Revision: 2769
Modified:
branches/movement/run_tests
branches/movement/source/main/cPopulation.cc
Log:
Changed carrying capacity K handling for small populations.
Modified: branches/movement/run_tests
===================================================================
--- branches/movement/run_tests 2008-09-04 19:35:05 UTC (rev 2768)
+++ branches/movement/run_tests 2008-09-04 21:44:47 UTC (rev 2769)
@@ -1,4 +1,6 @@
#!/bin/sh
-python tests/_testrunner/testrunner.py $@ ---testrunner-name=./run_tests
+python tests/_testrunner/testrunner.py $@ ---testrunner-name=./run_tests --builddir=. --show-diff
+
+
Modified: branches/movement/source/main/cPopulation.cc
===================================================================
--- branches/movement/source/main/cPopulation.cc 2008-09-04 19:35:05 UTC (rev 2768)
+++ branches/movement/source/main/cPopulation.cc 2008-09-04 21:44:47 UTC (rev 2769)
@@ -2999,7 +2999,7 @@
const int birth_method = m_world->GetConfig().BIRTH_METHOD.Get();
// @WRE carrying capacity handling
- /* Pick and kill an organism here if needed
+ /* Randomly pick and kill an organism here if needed
* and then enter choices for birth method handling.
*/
if ((0 < m_world->GetConfig().BIOMIMETIC_K.Get()) &&
@@ -3012,7 +3012,8 @@
if (cell_array[i].IsOccupied()) {
if (cell_array[i].GetOrganism()->GetPhenotype().OK()) {
// Get measurement, exclude parent
- if (parent_cell.GetID() != cell_array[i].GetID()) {
+ if ((parent_cell.GetID() != cell_array[i].GetID()) ||
+ (3 > num_organisms)) { // Make an exception for tiny populations. @WRE 04-Sep-08
msr = m_world->GetRandom().GetDouble();
} else {
msr = 0.0;
@@ -3027,8 +3028,8 @@
KillOrganism(cell_array[max_msrndx]);
}
- //@AWC -- decide wether the child will migrate to another deme -- if migrating we ignore the birth method.
- if ((m_world->GetConfig().MIGRATION_RATE.Get() > 0.0) //@AWC -- Pedantic test to maintain consistancy.
+ //@AWC -- decide whether the child will migrate to another deme -- if migrating we ignore the birth method.
+ if ((m_world->GetConfig().MIGRATION_RATE.Get() > 0.0) //@AWC -- Pedantic test to maintain consistency.
&& m_world->GetRandom().P(m_world->GetConfig().MIGRATION_RATE.Get())) {
//cerr << "Attempting to migrate with rate " << m_world->GetConfig().MIGRATION_RATE.Get() << "!" << endl;
More information about the Avida-cvs
mailing list