| 10815 | } |
| 10816 | |
| 10817 | bool cHardwareCPU::Inst_ApplyPointMutationsGroupRandom(cAvidaContext& ctx) |
| 10818 | { |
| 10819 | double point_mut_prob = m_world->GetConfig().INST_POINT_MUT_PROB.Get(); |
| 10820 | |
| 10821 | // Check for test CPU |
| 10822 | if (m_organism->GetOrgInterface().GetDeme() == NULL) return false; |
| 10823 | |
| 10824 | // Grab a random member of the deme. |
| 10825 | // Pick a random starting location... |
| 10826 | |
| 10827 | int deme_size = m_organism->GetDeme()->GetSize(); |
| 10828 | int start_pos = ctx.GetRandom().GetInt(0,deme_size); |
| 10829 | |
| 10830 | for (int i=0; i<deme_size; ++i) { |
| 10831 | int pos = (i + start_pos) % deme_size; |
| 10832 | cPopulationCell& cell = m_organism->GetDeme()->GetCell(pos); |
| 10833 | if (cell.IsOccupied()) { |
| 10834 | cOrganism* sl = cell.GetOrganism(); |
| 10835 | int num_mut = sl->GetHardware().PointMutate(ctx, point_mut_prob); |
| 10836 | sl->IncPointMutations(num_mut); |
| 10837 | return true; |
| 10838 | } |
| 10839 | } |
| 10840 | return true; |
| 10841 | } |
| 10842 | |
| 10843 | bool cHardwareCPU::Inst_ApplyPointMutationsGroupGS(cAvidaContext& ctx) |
| 10844 | { |
nothing calls this directly
no test coverage detected