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

Method MakePred

avida-core/source/cpu/cHardwareExperimental.cc:6913–6924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6911}
6912
6913void cHardwareExperimental::MakePred(cAvidaContext& ctx)
6914{
6915 if (m_organism->IsPreyFT()) {
6916 if (m_world->GetConfig().MAX_PRED.Get() && m_world->GetStats().GetNumTotalPredCreatures() >= m_world->GetConfig().MAX_PRED.Get()) m_organism->GetOrgInterface().KillRandPred(ctx, m_organism);
6917 // switching between predator and prey means having to switch avatar list...don't run this for orgs with AVCell == -1 (avatars off or test cpu)
6918 if (m_use_avatar && m_organism->GetOrgInterface().GetAVCellID() != -1) {
6919 m_organism->GetOrgInterface().SwitchPredPrey(ctx);
6920 m_organism->SetPredFT(ctx);
6921 }
6922 else m_organism->SetPredFT(ctx);
6923 }
6924}
6925
6926void cHardwareExperimental::MakeTopPred(cAvidaContext& ctx)
6927{

Callers

nothing calls this directly

Calls 9

IsPreyFTMethod · 0.80
GetConfigMethod · 0.80
SetPredFTMethod · 0.80
GetMethod · 0.45
GetStatsMethod · 0.45
KillRandPredMethod · 0.45
GetAVCellIDMethod · 0.45
SwitchPredPreyMethod · 0.45

Tested by

no test coverage detected