diff --git a/avida-core/source/main/cWorld.cc b/avida-core/source/main/cWorld.cc index c9f5ee9ee..3d572779c 100644 --- a/avida-core/source/main/cWorld.cc +++ b/avida-core/source/main/cWorld.cc @@ -82,7 +82,7 @@ cWorld::cWorld(cAvidaConfig* cfg, const cString& wd) delete test_cpu; tax->GetData().RecordFitness(test_info.GetGenotypeFitness()); Phenotype p; - p.merit = test_info.GetTestPhenotype().GetMerit().GetDouble(); + // p.merit = test_info.GetTestPhenotype().GetMerit().GetDouble(); p.gestation_time = test_info.GetTestPhenotype().GetGestationTime(); p.start_generation = test_info.GetTestPhenotype().GetGeneration(); auto tasks = test_info.GetTestPhenotype().GetCurTaskCount(); @@ -284,7 +284,7 @@ bool cWorld::setup(World* new_world, cUserFeedback* feedback, const Apto::MapAddOrg(seq, next_cell_id, GetStats().GetUpdate(), false); emp::Ptr tax = systematics_manager->GetMostRecent(); - if (tax->GetData().GetPhenotype().merit == -1) { + if (tax->GetData().GetPhenotype().gestation_time == -1) { eval_fun(tax); } }); diff --git a/avida-core/source/main/cWorld.h b/avida-core/source/main/cWorld.h index 3f66a17b1..130ffc593 100644 --- a/avida-core/source/main/cWorld.h +++ b/avida-core/source/main/cWorld.h @@ -62,21 +62,20 @@ class cUserFeedback; template class tDataEntry; struct Phenotype { - double merit = -1; int gestation_time = -1; int start_generation = -1; emp::vector final_task_count; - // bool operator==(const Phenotype & other) { - // return merit == other.merit && gestation_time == other.gestation_time && final_task_count == other.final_task_count; - // } + bool operator==(const Phenotype & other) const { + return gestation_time == other.gestation_time && final_task_count == other.final_task_count; + } bool operator<(const Phenotype & other) const { - return merit < other.merit || gestation_time < other.gestation_time || final_task_count < other.final_task_count; + return std::tie(gestation_time, final_task_count) < std::tie(other.gestation_time, other.final_task_count); } bool operator!=(const Phenotype & other) const { - return merit != other.merit || gestation_time != other.gestation_time || final_task_count != other.final_task_count; + return gestation_time != other.gestation_time || final_task_count != other.final_task_count; }