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

Method Process

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

Source from the content-addressed store, hash-verified

633 static const cString GetDescription() { return "Arguments: <string fname> [int cell_id=0] [int group_id=-1] [int forager_type=-1] [bool trace=false] [double merit=-1] [int lineage_label=0] [double neutral_metric=0]"; }
634
635 void Process(cAvidaContext& ctx)
636 {
637 if (m_filename.GetSize() == 0) {
638 cerr << "error: no organism file specified" << endl;
639 return;
640 }
641
642 GenomePtr genome;
643 cUserFeedback feedback;
644 genome = Util::LoadGenomeDetailFile(m_filename, m_world->GetWorkingDir(), m_world->GetHardwareManager(), feedback);
645 for (int i = 0; i < feedback.GetNumMessages(); i++) {
646 switch (feedback.GetMessageType(i)) {
647 case cUserFeedback::UF_ERROR: cerr << "error: "; break;
648 case cUserFeedback::UF_WARNING: cerr << "warning: "; break;
649 default: break;
650 };
651 cerr << feedback.GetMessage(i) << endl;
652 }
653 if (!genome) return;
654 m_world->GetPopulation().InjectGroup(*genome, Systematics::Source(Systematics::DIVISION, "", true), ctx, m_cell_id, m_merit, m_lineage_label, m_neutral_metric, m_group_id, m_forager_type, m_trace);
655
656 if (m_trace_filename.GetSize()) {
657 HardwareTracerPtr tracer(new cHardwareStatusPrinter(m_world->GetNewWorld(), (const char*)m_trace_filename));
658 m_world->GetPopulation().GetCell(m_cell_id).GetOrganism()->GetHardware().SetTrace(tracer);
659 }
660 }
661};
662
663/*

Callers

nothing calls this directly

Calls 10

GetNumMessagesMethod · 0.80
InjectGroupMethod · 0.80
GetNewWorldMethod · 0.80
SetTraceMethod · 0.80
GetHardwareMethod · 0.80
SourceClass · 0.50
GetSizeMethod · 0.45
GetMessageTypeMethod · 0.45
GetOrganismMethod · 0.45
GetCellMethod · 0.45

Tested by

no test coverage detected