| 5692 | } |
| 5693 | |
| 5694 | void 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 | |
| 5731 | void cPopulation::ProcessStepSpeculative(cAvidaContext& ctx, double step_size, int cell_id) |
no test coverage detected