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

Method UpdateGradientCount

avida-core/source/main/cPopulation.cc:8250–8274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8248//JW
8249
8250void cPopulation::UpdateGradientCount(cAvidaContext& ctx, const int verbosity, cWorld* world, const cString res_name)
8251{
8252 (void)verbosity;
8253
8254 const cResourceLib & resource_lib = environment.GetResourceLib();
8255 int global_res_index = -1;
8256
8257 for (int i = 0; i < resource_lib.GetSize(); i++) {
8258 cResource * res = resource_lib.GetResource(i);
8259
8260 if (!res->GetDemeResource()) global_res_index++;
8261
8262 if (res->GetName() == res_name) {
8263 resource_count.SetGradientCount(ctx, world, global_res_index, res->GetPeakX(), res->GetPeakY(),
8264 res->GetHeight(), res->GetSpread(), res->GetPlateau(), res->GetDecay(),
8265 res->GetMaxX(), res->GetMinX(), res->GetMaxY(), res->GetMinY(), res->GetAscaler(), res->GetUpdateStep(),
8266 res->GetHalo(), res->GetHaloInnerRadius(), res->GetHaloWidth(),
8267 res->GetHaloAnchorX(), res->GetHaloAnchorY(), res->GetMoveSpeed(), res->GetMoveResistance(),
8268 res->GetPlateauInflow(), res->GetPlateauOutflow(), res->GetConeInflow(), res->GetConeOutflow(),
8269 res->GetGradientInflow(), res->GetIsPlateauCommon(), res->GetFloor(), res->GetHabitat(),
8270 res->GetMinSize(), res->GetMaxSize(), res->GetConfig(), res->GetCount(), res->GetResistance(), res->GetDamage(),
8271 res->GetDeathOdds(), res->IsPath(), res->IsHammer(), res->GetInitialPlatVal(), res->GetThreshold(), res->GetRefuge());
8272 }
8273 }
8274}
8275
8276void cPopulation::UpdateGradientPlatInflow(const cString res_name, const double inflow)
8277{

Callers 1

ProcessMethod · 0.80

Calls 15

GetDemeResourceMethod · 0.80
SetGradientCountMethod · 0.80
GetPeakXMethod · 0.80
GetPeakYMethod · 0.80
GetSpreadMethod · 0.80
GetPlateauMethod · 0.80
GetMaxXMethod · 0.80
GetMinXMethod · 0.80
GetMaxYMethod · 0.80
GetMinYMethod · 0.80
GetAscalerMethod · 0.80
GetUpdateStepMethod · 0.80

Tested by

no test coverage detected