| 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 | /* |
nothing calls this directly
no test coverage detected