[Avida-SVN] r1625 - in branches/energy/source: main tools
beckma24 at myxo.css.msu.edu
beckma24 at myxo.css.msu.edu
Tue May 29 13:31:32 PDT 2007
Author: beckma24
Date: 2007-05-29 16:31:31 -0400 (Tue, 29 May 2007)
New Revision: 1625
Modified:
branches/energy/source/main/cPopulation.cc
branches/energy/source/tools/cWeightedIndex.cc
Log:
Consistency test check
Modified: branches/energy/source/main/cPopulation.cc
===================================================================
--- branches/energy/source/main/cPopulation.cc 2007-05-29 18:12:46 UTC (rev 1624)
+++ branches/energy/source/main/cPopulation.cc 2007-05-29 20:31:31 UTC (rev 1625)
@@ -286,7 +286,7 @@
// Update the phenotypes of each child....
- //apply energy if APPLY_ENERGY_METHOD is set to "no divide" (0)
+ //apply energy if APPLY_ENERGY_METHOD is set to "on divide" (0)
if(m_world->GetConfig().APPLY_ENERGY_METHOD.Get() == 0) {
parent_phenotype.RefreshEnergy();
parent_phenotype.ApplyToEnergyStore();
Modified: branches/energy/source/tools/cWeightedIndex.cc
===================================================================
--- branches/energy/source/tools/cWeightedIndex.cc 2007-05-29 18:12:46 UTC (rev 1624)
+++ branches/energy/source/tools/cWeightedIndex.cc 2007-05-29 20:31:31 UTC (rev 1625)
@@ -47,6 +47,8 @@
{
std::cerr<<"[cWeightedIndex::AdjustSubtree] weight_change = " << weight_change << std::endl;
subtree_weight[id] += weight_change;
+ if(subtree_weight[id] < .0001) //bb: added to catch round off error
+ subtree_weight[id] = 0.0;
if (id != 0) {
AdjustSubtree(GetParent(id), weight_change);
}
More information about the Avida-cvs
mailing list