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

Method Inst_ApplyPointMutationsGroupGS

avida-core/source/cpu/cHardwareCPU.cc:10843–10869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10841}
10842
10843bool cHardwareCPU::Inst_ApplyPointMutationsGroupGS(cAvidaContext& ctx)
10844{
10845 double point_mut_prob = m_world->GetConfig().INST_POINT_MUT_PROB.Get();
10846
10847 // Check for test CPU
10848 if (m_organism->GetOrgInterface().GetDeme() == NULL) return false;
10849
10850 // Grab a random member of the deme.
10851 // Pick a random starting location...
10852 int deme_size = m_organism->GetDeme()->GetSize();
10853 int start_pos = ctx.GetRandom().GetInt(0,deme_size);
10854 bool gs = m_organism->IsGermline();
10855
10856 for (int i=0; i<deme_size; ++i) {
10857 int pos = (i + start_pos) % deme_size;
10858 cPopulationCell& cell = m_organism->GetDeme()->GetCell(pos);
10859 if (cell.IsOccupied()) {
10860 cOrganism* sl = cell.GetOrganism();
10861 if (gs == sl->IsGermline()) {
10862 int num_mut = sl->GetHardware().PointMutate(ctx, point_mut_prob);
10863 sl->IncPointMutations(num_mut);
10864 return true;
10865 }
10866 }
10867 }
10868 return true;
10869}
10870
10871
10872bool cHardwareCPU::Inst_JoinGermline(cAvidaContext& ctx) {

Callers

nothing calls this directly

Calls 12

GetConfigMethod · 0.80
GetIntMethod · 0.80
IsGermlineMethod · 0.80
IsOccupiedMethod · 0.80
PointMutateMethod · 0.80
GetHardwareMethod · 0.80
IncPointMutationsMethod · 0.80
GetMethod · 0.45
GetDemeMethod · 0.45
GetSizeMethod · 0.45
GetCellMethod · 0.45
GetOrganismMethod · 0.45

Tested by

no test coverage detected