MCPcopy Create free account
hub / github.com/devosoft/avida / Inst_UpdateMetabolicRate

Method Inst_UpdateMetabolicRate

avida-core/source/cpu/cHardwareCPU.cc:5863–5870  ·  view source on GitHub ↗

Update the organism's metabolic rate

Source from the content-addressed store, hash-verified

5861
5862//Update the organism's metabolic rate
5863bool cHardwareCPU::Inst_UpdateMetabolicRate(cAvidaContext& ctx)
5864{
5865 cPhenotype& phenotype = m_organism->GetPhenotype();
5866 double newmerit = phenotype.ConvertEnergyToMerit(phenotype.GetStoredEnergy() * phenotype.GetEnergyUsageRatio());
5867 m_organism->UpdateMerit(ctx, newmerit);
5868
5869 return true;
5870} //End Inst_UpdateMetabolocRate()
5871
5872
5873//Donate a fraction of organism's energy to faced organism.

Callers

nothing calls this directly

Calls 4

ConvertEnergyToMeritMethod · 0.80
GetStoredEnergyMethod · 0.80
GetEnergyUsageRatioMethod · 0.80
UpdateMeritMethod · 0.45

Tested by

no test coverage detected