diff --git a/eo/contrib/irace/fastga.cpp b/eo/contrib/irace/fastga.cpp index cc67a43bd..919231eb7 100644 --- a/eo/contrib/irace/fastga.cpp +++ b/eo/contrib/irace/fastga.cpp @@ -24,7 +24,7 @@ eoAlgoFoundryFastGA& make_foundry( ) { // FIXME using max_restarts>1 does not allow to honor max evals. - auto& foundry = store.pack< eoAlgoFoundryFastGA >(init, eval_onemax, generations, max_evals, /*max_restarts=*/1); + auto& foundry = store.pack< eoAlgoFoundryFastGA >(init, eval_onemax, max_evals, /*max_restarts=*/1); /***** Continuators ****/ foundry.continuators.add< eoGenContinue >(generations); diff --git a/eo/src/eoAlgoFoundryFastGA.h b/eo/src/eoAlgoFoundryFastGA.h index 99b778f2a..ed766ff88 100644 --- a/eo/src/eoAlgoFoundryFastGA.h +++ b/eo/src/eoAlgoFoundryFastGA.h @@ -142,6 +142,7 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry // Objective function calls counter eoEvalCounterThrowException eval(_eval, _max_evals); + eo::log << eo::xdebug << "Evaluations: " << eval.value() << " / " << _max_evals << std::endl; eoPopLoopEval pop_eval(eval); // Algorithm itself @@ -160,12 +161,13 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry ); // Restart wrapper - eoAlgoPopReset reset_pop(_init, pop_eval); - eoGenContinue restart_cont(_max_restarts); - eoAlgoRestart restart(eval, algo, restart_cont, reset_pop); + // eoAlgoPopReset reset_pop(_init, pop_eval); + // eoGenContinue restart_cont(_max_restarts); + // eoAlgoRestart restart(eval, algo, restart_cont, reset_pop); try { - restart(pop); + // restart(pop); + algo(pop); } catch(eoMaxEvalException e) { #ifndef NDEBUG eo::log << eo::debug << "Reached maximum evaluations: " << eval.getValue() << " / " << _max_evals << std::endl; @@ -182,16 +184,16 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry std::string name() { std::ostringstream name; - name << "crossover_rates: " << this->at( crossover_rates.index()) << " (" << this-> crossover_rate() << ") + "; + name << "crossover_rates: " << this->at( crossover_rates.index()) << " (" << this-> crossover_rate() << ") + "; name << "crossover_selectors: " << this->at( crossover_selectors.index()) << " (" << this-> crossover_selector().className() << ") + "; name << "aftercross_selector: " << this->at(aftercross_selectors.index()) << " (" << this->aftercross_selector().className() << ") + "; - name << "crossovers: " << this->at( crossovers.index()) << " (" << this-> crossover().className() << ") + "; - name << "mutation_rates: " << this->at( mutation_rates.index()) << " (" << this-> mutation_rate() << ") + "; - name << "mutation_selectors: " << this->at( mutation_selectors.index()) << " (" << this-> mutation_selector().className() << ") + "; - name << "mutations: " << this->at( mutations.index()) << " (" << this-> mutation().className() << ") + "; - name << "replacements: " << this->at( replacements.index()) << " (" << this-> replacement().className() << ") + "; - name << "continuators: " << this->at( continuators.index()) << " (" << this-> continuator().className() << ") + "; - name << "offspring_sizes: " << this->at( offspring_sizes.index()) << " (" << this-> offspring_size() << ")"; + name << "crossovers: " << this->at( crossovers.index()) << " (" << this-> crossover().className() << ") + "; + name << "mutation_rates: " << this->at( mutation_rates.index()) << " (" << this-> mutation_rate() << ") + "; + name << "mutation_selectors: " << this->at( mutation_selectors.index()) << " (" << this-> mutation_selector().className() << ") + "; + name << "mutations: " << this->at( mutations.index()) << " (" << this-> mutation().className() << ") + "; + name << "replacements: " << this->at( replacements.index()) << " (" << this-> replacement().className() << ") + "; + name << "continuators: " << this->at( continuators.index()) << " (" << this-> continuator().className() << ") + "; + name << "offspring_sizes: " << this->at( offspring_sizes.index()) << " (" << this-> offspring_size() << ")"; return name.str(); }