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

Method ProcessStep

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

Source from the content-addressed store, hash-verified

5692}
5693
5694void cPopulation::ProcessStep(cAvidaContext& ctx, double step_size, int cell_id)
5695{
5696 assert(step_size > 0.0);
5697 assert(cell_id < cell_array.GetSize());
5698
5699 // If cell_id is negative, no cell could be found -- stop here.
5700 if (cell_id < 0) return;
5701
5702 cPopulationCell& cell = GetCell(cell_id);
5703 assert(cell.IsOccupied()); // Unoccupied cell getting processor time!
5704 cOrganism* cur_org = cell.GetOrganism();
5705
5706 cell.GetHardware()->SingleProcess(ctx);
5707
5708 double merit = cur_org->GetPhenotype().GetMerit().GetDouble();
5709 if (cur_org->GetPhenotype().GetToDelete() == true) {
5710 cur_org->GetHardware().DeleteMiniTrace(print_mini_trace_reacs);
5711 delete cur_org;
5712 }
5713
5714 m_world->GetStats().IncExecuted();
5715 resource_count.Update(step_size);
5716
5717 // These must be done even if there is only one deme.
5718 for(int i = 0; i < GetNumDemes(); i++) {
5719 GetDeme(i).Update(step_size);
5720 }
5721
5722 cDeme & deme = GetDeme(GetCell(cell_id).GetDemeID());
5723 deme.IncTimeUsed(merit);
5724
5725 if (GetNumDemes() >= 1) {
5726 CheckImplicitDemeRepro(deme, ctx);
5727 }
5728}
5729
5730
5731void cPopulation::ProcessStepSpeculative(cAvidaContext& ctx, double step_size, int cell_id)

Callers 3

RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80

Calls 14

IsOccupiedMethod · 0.80
GetHardwareMethod · 0.80
GetToDeleteMethod · 0.80
DeleteMiniTraceMethod · 0.80
IncExecutedMethod · 0.80
GetSizeMethod · 0.45
GetOrganismMethod · 0.45
SingleProcessMethod · 0.45
GetDoubleMethod · 0.45
GetMeritMethod · 0.45
GetStatsMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected