Skip to content
Snippets Groups Projects
Commit ec05d10e authored by Caron Olivier's avatar Caron Olivier
Browse files

bug correction

parent 0c3fb47b
No related branches found
No related tags found
No related merge requests found
Pipeline #4740 failed
......@@ -197,7 +197,7 @@ int main(void) {
std::vector<std::function<void(opt::singleSolution::localsearch::SimulatedAnnealing<SOL>&)>> vec_functions2 = {setToSwap,setToShift};
// Step 4, encapsulation of the algorithm to the adaptive time windows
core::adaptive::ChangeIfSlowImprovement<SOL,opt::singleSolution::localsearch::SimulatedAnnealing<SOL> > adaptiveWindow(*sa, vec_functions2, 4, 0.02, 10,eval);
core::adaptive::ChangeIfSlowImprovement<SOL,opt::singleSolution::localsearch::SimulatedAnnealing<SOL> > adaptive_sa(*sa, vec_functions2, 4, 0.02, 10,eval);
std::cout << "using ChangeIfSlowImprovementWindow strategy during " << vec_functions.size()*criterion_length << std::endl;
std::cout << "every 4 seconds, alternate the neighbor operators: swap and shift if the fitness improves less than 0.02 %" << std::endl;
std::cout << "repeat 10 times, so 40 seconds for the complete run "<< std::endl;
......@@ -206,7 +206,7 @@ int main(void) {
std::cout << sol3 << std::endl;
adaptiveWindow(sol3);
adaptive_sa(sol3);
std::cout << "FINAL SOLUTION" << std::endl;
......
......@@ -65,7 +65,7 @@ namespace core::adaptive {
// init phase
auto fitness_scalar_value = _in.fitness().scalar() ;
int counter=1 ; int select_function=0 ;
criterion::TimeCriterion<IN> timeCriterion(duration*1000);
opt::criterion::TimeCriterion<IN> timeCriterion(duration*1000);
timeCriterion.init();
// perform algorithm with the specific adaptive strategy
while (counter <= this->max_iterations ) {
......
......@@ -61,7 +61,7 @@ namespace core::adaptive {
*/
void operator()(IN &_in) override {
for (unsigned long long int i = 0; i < this->durations.size(); i++) {
criterion::TimeCriterion<IN> timeCriterion(this->durations[i]);
opt::criterion::TimeCriterion<IN> timeCriterion(this->durations[i]);
this->functions[i](this->algorithm);
timeCriterion.init();
this->algorithm(_in, timeCriterion);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment