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

Method AdjustSpatialResource

avida-core/source/main/cDeme.cc:1179–1191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1177}
1178
1179void cDeme::AdjustSpatialResource(cAvidaContext& ctx, int rel_cellid, int resource_id, double amount)
1180{
1181 assert(rel_cellid >= 0);
1182 assert(rel_cellid < GetSize());
1183 assert(resource_id >= 0);
1184 assert(resource_id < deme_resource_count.GetSize());
1185
1186 Apto::Array<double> res_change;
1187 res_change.Resize(deme_resource_count.GetSize(), 0);
1188 res_change[resource_id] = amount;
1189
1190 deme_resource_count.ModifyCell(ctx, res_change, rel_cellid);
1191}
1192
1193void cDeme::AdjustResource(cAvidaContext& ctx, int resource_id, double amount)
1194{

Callers

nothing calls this directly

Calls 3

ModifyCellMethod · 0.80
GetSizeMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected