diff --git a/eo/test/t-eoNSGA.cpp b/eo/test/t-eoNSGA.cpp index 79dff937..bc80dbc5 100644 --- a/eo/test/t-eoNSGA.cpp +++ b/eo/test/t-eoNSGA.cpp @@ -2,9 +2,9 @@ #include #include -#include -#include -#include +#include +#include +#include using namespace std; @@ -119,7 +119,7 @@ class Init : public eoInit void the_main(int argc, char* argv[]) { Init init; - Eval eval; + Eval simple_eval; Mutate mutate; eoParser parser(argc, argv); @@ -128,6 +128,7 @@ void the_main(int argc, char* argv[]) unsigned num_gen = parser.createParam(unsigned(50), "num_gen", "number of generations to run", 'g').value(); unsigned pop_size = parser.createParam(unsigned(100), "pop_size", "population size", 'p').value(); bool use_nsga1 = parser.createParam(false, "nsga1", "Use nsga 1").value(); + bool use_nsga2a = parser.createParam(false, "nsga2a", "Use nsga 2a").value(); eoPop pop(pop_size, init); @@ -142,9 +143,12 @@ void the_main(int argc, char* argv[]) eoGeneralBreeder breeder(select, opsel); // replacement - eoNSGA_IIa_Replacement nsga1; - eoNSGA_II_Replacement nsga2; - eoReplacement& replace = use_nsga1 ? static_cast&>(nsga1) : static_cast&>(nsga2); + eoNSGA_IIa_Eval nsga2a(simple_eval); + eoNSGA_II_Eval nsga2(simple_eval); + eoNSGA_I_Eval nsga1(0.1, simple_eval); + eoMOEval& eval = use_nsga1 ? static_cast&>(nsga1) : (use_nsga2a? static_cast&>(nsga2a) : static_cast&>(nsga2)); + + eoPlusReplacement replace; unsigned long generation = 0; eoGenContinue gen(num_gen, generation); @@ -172,11 +176,6 @@ void the_main(int argc, char* argv[]) parser.printHelp(std::cout); return; } - - apply(eval, pop); - - eoPop nothing; - replace(pop, nothing); // calculates worths ea(pop); }