[Avida-SVN] r1651 - branches/collect/source/main
blwalker at myxo.css.msu.edu
blwalker at myxo.css.msu.edu
Wed Jun 6 11:55:13 PDT 2007
Author: blwalker
Date: 2007-06-06 14:55:13 -0400 (Wed, 06 Jun 2007)
New Revision: 1651
Modified:
branches/collect/source/main/cAvidaConfig.h
branches/collect/source/main/cPopulation.cc
Log:
Adding ability to return stored resources to the world on death, plus config option to turn this on or off.
Modified: branches/collect/source/main/cAvidaConfig.h
===================================================================
--- branches/collect/source/main/cAvidaConfig.h 2007-06-06 17:14:50 UTC (rev 1650)
+++ branches/collect/source/main/cAvidaConfig.h 2007-06-06 18:55:13 UTC (rev 1651)
@@ -349,6 +349,7 @@
CONFIG_ADD_VAR(ABSORB_RESOURCE_FRACTION, double, .0025, "Fraction of available environmental resource an organism absorbs with the collect command");
CONFIG_ADD_VAR(MULTI_ABSORB_TYPE, int, 0, "What to do if collect is called on a range of resources.\n 0 = absorb a random resource in the range\n 1 = absorb the first resource in the range\n 2 = absorb the last resource in the range\n 3 = absorb ABSORB_RESOURCE_FRACTION / (# of resources in range) of each resource in the range");
CONFIG_ADD_VAR(USE_STORED_FRACTION, double, 1.0, "The fraction of stored resource to use when there is no environmental resource available");
+ CONFIG_ADD_VAR(RETURN_STORED_ON_DEATH, bool, 1, "Return an organism's stored resources to the world when it dies");
CONFIG_ADD_GROUP(ANALYZE_GROUP, "Analysis Settings");
CONFIG_ADD_VAR(MT_CONCURRENCY, int, 1, "Number of concurrent analyze threads");
Modified: branches/collect/source/main/cPopulation.cc
===================================================================
--- branches/collect/source/main/cPopulation.cc 2007-06-06 17:14:50 UTC (rev 1650)
+++ branches/collect/source/main/cPopulation.cc 2007-06-06 18:55:13 UTC (rev 1651)
@@ -497,6 +497,13 @@
delete market_it.Remove();
}
}
+
+ // Return currently stored internal resources to the world
+ if(m_world->GetConfig().USE_RESOURCE_BINS.Get() && m_world->GetConfig().RETURN_STORED_ON_DEATH.Get()) {
+ organism->GetOrgInterface().UpdateResources(organism->GetRBins());
+ }
+
+
// Do the lineage handling
if (m_world->GetConfig().LOG_LINEAGES.Get()) { m_world->GetClassificationManager().RemoveLineageOrganism(organism); }
More information about the Avida-cvs
mailing list