get the next CPU cycle, awarded probabistically to a deme based on population with non-zero merits
| 37 | |
| 38 | //get the next CPU cycle, awarded probabistically to a deme based on population with non-zero merits |
| 39 | int cProbDemeProbSchedule::GetNextID() |
| 40 | { |
| 41 | //choose a deme to schedule |
| 42 | curr_deme = demeChart.FindPosition(m_rng->GetDouble(demeChart.GetTotalWeight())); |
| 43 | |
| 44 | //calculate the offset |
| 45 | int offset = curr_deme * deme_size; |
| 46 | |
| 47 | // get the within postion of the node whos corresponding cell will get the CPU cycle |
| 48 | const double position = m_rng->GetDouble(chart[curr_deme]->GetTotalWeight()); |
| 49 | |
| 50 | // return the adjusted ID of the cell to get the CPU cycle |
| 51 | return chart[curr_deme]->FindPosition(position) + offset; |
| 52 | } |
| 53 | |
| 54 | |
| 55 | //adjust the weight of an org within deme -- adjust the weighting for scheduling that deme |
nothing calls this directly
no test coverage detected