| 4996 | } |
| 4997 | |
| 4998 | genotype_vector cAnalyze::LoadDetailFileAsVector(cString cur_string) |
| 4999 | { |
| 5000 | std::vector<cAnalyzeGenotype> genotypes; |
| 5001 | cString filename = cur_string.PopWord(); |
| 5002 | |
| 5003 | cout << "Loading: " << filename << endl; |
| 5004 | |
| 5005 | cInitFile input_file(filename, m_world->GetWorkingDir()); |
| 5006 | if (!input_file.WasOpened()) { |
| 5007 | const cUserFeedback& feedback = input_file.GetFeedback(); |
| 5008 | for (int i = 0; i < feedback.GetNumMessages(); i++) { |
| 5009 | switch (feedback.GetMessageType(i)) { |
| 5010 | case cUserFeedback::UF_ERROR: cerr << "error: "; break; |
| 5011 | case cUserFeedback::UF_WARNING: cerr << "warning: "; break; |
| 5012 | default: break; |
| 5013 | }; |
| 5014 | cerr << feedback.GetMessage(i) << endl; |
| 5015 | } |
| 5016 | if (exit_on_error) exit(1); |
| 5017 | } |
| 5018 | |
| 5019 | const cString filetype = input_file.GetFiletype(); |
| 5020 | if (filetype != "population_data" && // Deprecated |
| 5021 | filetype != "genotype_data") { |
| 5022 | cerr << "error: cannot load files of type \"" << filetype << "\"." << endl; |
| 5023 | if (exit_on_error) exit(1); |
| 5024 | } |
| 5025 | |
| 5026 | if (m_world->GetVerbosity() >= VERBOSE_ON) { |
| 5027 | cout << "Loading file of type: " << filetype << endl; |
| 5028 | } |
| 5029 | |
| 5030 | |
| 5031 | // Construct a linked list of data types that can be loaded... |
| 5032 | tList< tDataEntryCommand<cAnalyzeGenotype> > output_list; |
| 5033 | tListIterator< tDataEntryCommand<cAnalyzeGenotype> > output_it(output_list); |
| 5034 | cUserFeedback feedback; |
| 5035 | cAnalyzeGenotype::GetDataCommandManager().LoadCommandList(input_file.GetFormat(), output_list, &feedback); |
| 5036 | |
| 5037 | for (int i = 0; i < feedback.GetNumMessages(); i++) { |
| 5038 | switch (feedback.GetMessageType(i)) { |
| 5039 | case cUserFeedback::UF_ERROR: cerr << "error: "; break; |
| 5040 | case cUserFeedback::UF_WARNING: cerr << "warning: "; break; |
| 5041 | default: break; |
| 5042 | }; |
| 5043 | cerr << feedback.GetMessage(i) << endl; |
| 5044 | } |
| 5045 | |
| 5046 | if (feedback.GetNumErrors()) exit(1); |
| 5047 | |
| 5048 | bool id_inc = input_file.GetFormat().HasString("id"); |
| 5049 | |
| 5050 | // Setup the genome... |
| 5051 | const cInstSet& is = m_world->GetHardwareManager().GetDefaultInstSet(); |
| 5052 | HashPropertyMap props; |
| 5053 | cHardwareManager::SetupPropertyMap(props, (const char*)is.GetInstSetName()); |
| 5054 | Genome default_genome(is.GetHardwareType(), props, GeneticRepresentationPtr(new InstructionSequence(1))); |
| 5055 | int load_count = 0; |
nothing calls this directly
no test coverage detected