diff --git a/avida-core/CMakeLists.txt b/avida-core/CMakeLists.txt index 1d9b818f2..f8c1dbefa 100644 --- a/avida-core/CMakeLists.txt +++ b/avida-core/CMakeLists.txt @@ -46,18 +46,18 @@ SET(LIBRARY_OUTPUT_PATH # ------------------------------------------------------------------------------ IF(UNIX) IF (CMAKE_CXX_COMPILER MATCHES ".*pathCC.*") - SET(COMPILER_WARNING_FLAGS "-std=c++14") + SET(COMPILER_WARNING_FLAGS "-std=c++20") SET(COMPILER_OPTIMIZATION_FLAGS "-funroll-loops -fstrict-aliasing -OPT:Olimit=0") ELSE (CMAKE_CXX_COMPILER MATCHES ".*pathCC.*") IF (CMAKE_CXX_COMPILER MATCHES ".*icpc.*") - SET(COMPILER_WARNING_FLAGS "-std=c++14") + SET(COMPILER_WARNING_FLAGS "-std=c++20") SET(COMPILER_OPTIMIZATION_FLAGS "-funroll-loops -mp1 -pc64") ELSE (CMAKE_CXX_COMPILER MATCHES ".*icpc.*") IF (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*") - SET(COMPILER_WARNING_FLAGS "-Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-trigraphs -Wno-expansion-to-defined -std=c++20") + SET(COMPILER_WARNING_FLAGS "-Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-trigraphs -std=c++20") SET(COMPILER_OPTIMIZATION_FLAGS "-funroll-loops -fstrict-aliasing -fvisibility-inlines-hidden") ELSE (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*") - SET(COMPILER_WARNING_FLAGS "-Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-trigraphs -Wno-expansion-to-defined -std=c++20") + SET(COMPILER_WARNING_FLAGS "-Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-trigraphs -std=c++20") SET(COMPILER_OPTIMIZATION_FLAGS "-funroll-loops -fstrict-aliasing -ftree-vectorize -fvisibility-inlines-hidden") ENDIF (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*") ENDIF (CMAKE_CXX_COMPILER MATCHES ".*icpc.*") @@ -618,4 +618,4 @@ SET(CFG_FILES ${CFG_FILES_DIR}/default-heads-sex.org ${CFG_FILES_DIR}/default-transsmt.org ) -INSTALL_FILES(/work FILES ${CFG_FILES}) \ No newline at end of file +INSTALL_FILES(/work FILES ${CFG_FILES}) diff --git a/avida-core/source/actions/PrintActions.cc b/avida-core/source/actions/PrintActions.cc index a1ee8da03..0fe1d7b44 100644 --- a/avida-core/source/actions/PrintActions.cc +++ b/avida-core/source/actions/PrintActions.cc @@ -860,7 +860,7 @@ class cActionPrintInstructionAbundanceHistogram : public cAction const int num_cells = population.GetSize(); for (int x = 0; x < num_cells; x++) { cPopulationCell& cell = population.GetCell(x); - if (cell.IsOccupied() && cell.GetOrganism()->GetGenome().Properties().Get("instset").StringValue() == is.GetInstSetName()) { + if (cell.IsOccupied() && cell.GetOrganism()->GetGenome().Properties().Get("instset").StringValue()) { // access this CPU's code block cCPUMemory& cpu_mem = cell.GetOrganism()->GetHardware().GetMemory(); const int mem_size = cpu_mem.GetSize(); diff --git a/avida-core/source/main/cOrgMessagePredicate.h b/avida-core/source/main/cOrgMessagePredicate.h index cb34e9fd4..2778c1cfe 100644 --- a/avida-core/source/main/cOrgMessagePredicate.h +++ b/avida-core/source/main/cOrgMessagePredicate.h @@ -86,8 +86,8 @@ struct cOrgMessagePred_CountDemeMessages : public cOrgMessagePredicate { } virtual void Print(int update, std::ostream& out) { - out << update << " COUNT " << - std::accumulate(m_msg_counts.begin(), m_msg_counts.end(), 0, apply2nd >()) << " "; + // out << update << " COUNT " << + // std::accumulate(m_msg_counts.begin(), m_msg_counts.end(), 0, apply2nd >()) << " "; for(MessageCounts::iterator i=m_msg_counts.begin(); i!=m_msg_counts.end(); ++i) { out << " " << i->second; } diff --git a/avida-core/source/main/cPopulation.cc b/avida-core/source/main/cPopulation.cc index 9bdbf971e..5e1a71ec6 100644 --- a/avida-core/source/main/cPopulation.cc +++ b/avida-core/source/main/cPopulation.cc @@ -4953,7 +4953,7 @@ void cPopulation::PrintDemeInstructions() for (int i = 0; i < cur_deme.GetSize(); i++) { int cur_cell = cur_deme.GetCellID(i); if (!cell_array[cur_cell].IsOccupied()) continue; - if (cell_array[cur_cell].GetOrganism()->GetGenome().Properties().Get(s_prop_id_instset).StringValue() != inst_set) continue; + if (!cell_array[cur_cell].GetOrganism()->GetGenome().Properties().Get(s_prop_id_instset).StringValue()) continue; cPhenotype& phenotype = GetCell(cur_cell).GetOrganism()->GetPhenotype(); for (int j = 0; j < num_inst; j++) single_deme_inst[j].Add(phenotype.GetLastInstCount()[j]); diff --git a/avida-core/source/main/cWorld.cc b/avida-core/source/main/cWorld.cc index 3d572779c..2d53d8859 100644 --- a/avida-core/source/main/cWorld.cc +++ b/avida-core/source/main/cWorld.cc @@ -71,6 +71,7 @@ cWorld::cWorld(cAvidaConfig* cfg, const cString& wd) }; eval_fun = [this](emp::Ptr tax){ + // std::cout << "evaluating" << tax << std::endl; Avida::Genome gen(curr_genome.HardwareType(), curr_genome.Properties(), GeneticRepresentationPtr(new InstructionSequence(tax->GetInfo()))); // cAnalyzeGenotype genotype(this, gen); @@ -264,13 +265,13 @@ bool cWorld::setup(World* new_world, cUserFeedback* feedback, const Apto::MapPrintStatus(); + systematics_manager->PrintStatus(); systematics_manager->AddSnapshotFun([](const taxon_t & tax) { return emp::to_string(tax.GetInfo().AsString().GetCString()); }, "sequence", "Avida instruction sequence for this taxon."); - + // std::cout << "Make OEE" <WORLD_X.Get() * m_conf->WORLD_Y.Get() * 200000); OEE_stats->SetGenerationInterval(m_conf->FILTER_TIME.Get()); OEE_stats->SetResolution(m_conf->OEE_RES.Get()); @@ -282,27 +283,47 @@ bool cWorld::setup(World* new_world, cUserFeedback* feedback, const Apto::MapSetNextParent(pos);}); OnOffspringReady([this](Avida::InstructionSequence seq){ - systematics_manager->AddOrg(seq, next_cell_id, GetStats().GetUpdate(), false); + // std::cout << "on ready" << std::endl; + systematics_manager->AddOrg(seq, emp::WorldPosition(next_cell_id,0), GetStats().GetUpdate()); emp::Ptr tax = systematics_manager->GetMostRecent(); if (tax->GetData().GetPhenotype().gestation_time == -1) { eval_fun(tax); } + // std::cout << "Done with on ready" << std::endl; }); - OnOrgDeath([this](int pos){ systematics_manager->RemoveOrgAfterRepro(pos, GetStats().GetUpdate());}); + OnOrgDeath([this](int pos){ + // std::cout << "on death " << std::endl; + systematics_manager->RemoveOrgAfterRepro(emp::WorldPosition(pos, 0), GetStats().GetUpdate());}); OnUpdate([this](int ud){ + // std::cout << "On update" << std::endl; if (std::round(GetStats().GetGeneration()) > latest_gen) { latest_gen = std::round(GetStats().GetGeneration()); OEE_stats->Update(latest_gen, GetStats().GetUpdate()); oee_file.Update(latest_gen); } + // std::cout << "On update done" << std::endl; }); - OnUpdate([this](int ud){systematics_manager->Update(); phylodiversity_file.Update(ud); lineage_file.Update(ud); dom_file.Update(ud);}); + OnUpdate([this](int ud){ + // std::cout << "On update 2" << std::endl; + systematics_manager->Update(); + // std::cout << "systematic man update done" << std::endl; + phylodiversity_file.Update(ud); + // std::cout << "Phylodiv file done" << std::endl; + lineage_file.Update(ud); + // std::cout << "lin file done" << std::endl; + dom_file.Update(ud); + // std::cout << "On update 2 done" << std::endl; + }); // --- bookmark --- - OnUpdate([this](int ud) { if (GetStats().GetUpdate() % m_conf->PHYLOGENY_SNAPSHOT_RES.Get() == 0) { systematics_manager->Snapshot("phylogeny-snapshot-" + emp::to_string(GetStats().GetUpdate()) + ".csv" ); } }); + OnUpdate([this](int ud) { + // std::cout << "On update3" << std::endl; + if (GetStats().GetUpdate() % m_conf->PHYLOGENY_SNAPSHOT_RES.Get() == 0) { systematics_manager->Snapshot("phylogeny-snapshot-" + emp::to_string(GetStats().GetUpdate()) + ".csv" ); + // std::cout << "End on update3" << std::endl; + } }); std::function gen_fun = [this](){return std::round(GetStats().GetGeneration());}; std::function update_fun = [this](){return GetStats().GetUpdate();}; - + // std::cout << " Setupp output" << std::endl; oee_file.AddFun(gen_fun, "generation", "Generation"); oee_file.AddCurrent(*OEE_stats->GetDataNode("change"), "change", "change potential"); oee_file.AddCurrent(*OEE_stats->GetDataNode("novelty"), "novelty", "novelty potential"); @@ -316,7 +337,7 @@ bool cWorld::setup(World* new_world, cUserFeedback* feedback, const Apto::MapAddPhylogeneticDiversityDataNode(); phylodiversity_file.AddFun(update_fun, "update", "Update"); phylodiversity_file.AddStats(*systematics_manager->GetDataNode("evolutionary_distinctiveness") , "evolutionary_distinctiveness", "evolutionary distinctiveness for a single update", true, true); - phylodiversity_file.AddStats(*systematics_manager->GetDataNode("pairwise_distances"), "pairwise_distance", "pairwise distance for a single update", true, true); + // phylodiversity_file.AddStats(*systematics_manager->GetDataNode("pairwise_distances"), "pairwise_distance", "pairwise distance for a single update", true, true); phylodiversity_file.AddCurrent(*systematics_manager->GetDataNode("phylogenetic_diversity"), "current_phylogenetic_diversity", "current phylogenetic_diversity", true, true); phylodiversity_file.template AddFun( [this](){ return systematics_manager->GetNumActive(); }, "num_taxa", "Number of unique taxonomic groups currently active." );