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

Method Process

avida-core/source/actions/PopulationActions.cc:174–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172 static const cString GetDescription() { return "Arguments: <int length> [int cell_id=0] [double merit=-1] [int lineage_label=0] [double neutral_metric=0]"; }
173
174 void Process(cAvidaContext& ctx)
175 {
176 const cInstSet& is = m_world->GetHardwareManager().GetDefaultInstSet();
177 HashPropertyMap props;
178 cHardwareManager::SetupPropertyMap(props, (const char*)is.GetInstSetName());
179 Genome genome(is.GetHardwareType(), props, GeneticRepresentationPtr(new InstructionSequence(m_length)));
180 InstructionSequencePtr seq_p;
181 seq_p.DynamicCastFrom(genome.Representation());
182 InstructionSequence& seq = *seq_p;
183 for (int i = 0; i < m_length; i++) seq[i] = is.GetRandomInst(ctx);
184 m_world->GetPopulation().Inject(genome, Systematics::Source(Systematics::DIVISION, "random", true), ctx, m_cell_id, m_merit, m_lineage_label, m_neutral_metric);
185 }
186};
187
188

Callers

nothing calls this directly

Calls 5

GetHardwareTypeMethod · 0.80
RepresentationMethod · 0.80
GetRandomInstMethod · 0.80
InjectMethod · 0.80
SourceClass · 0.50

Tested by

no test coverage detected