Commit c7017d61 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

optimizer: increase kappa-min for improve step

parent 00155a9e
Pipeline #5471 failed with stage
in 45 seconds
......@@ -734,10 +734,12 @@ public:
}
}
void reinit(Solver& slv,
bit_array& x,
bool is_a_solution,
const best_solution_recorder<Float, Mode>& best_recorder)
Float reinit(Solver& slv,
bit_array& x,
bool is_a_solution,
const best_solution_recorder<Float, Mode>& best_recorder,
double kappa_min,
double /*kappa_max*/)
{
// x.clear();
slv.reset();
......@@ -753,7 +755,8 @@ public:
next_state(is_a_solution);
if (single == single_automaton::init) {
switch (single) {
case single_automaton::init:
switch (base) {
case init_automaton::random:
for (int i = 0; i != slv.n; ++i)
......@@ -804,7 +807,19 @@ public:
init_crossover(slv, x, best_recorder);
break;
}
break;
case single_automaton::improve_x_1:
kappa_min += (kappa_max - kappa_min) / 10;
break;
case single_automaton::improve_x_2:
kappa_min += (kappa_max - kappa_min) / 5;
break;
case single_automaton::improve_x_3:
kappa_min += (kappa_max - kappa_min) / 2.5;
break;
}
return static_cast<Float>(kappa_min);
}
};
......
......@@ -266,10 +266,12 @@ struct optimize_functor
bool is_a_solution = false;
while (!stop_task.load()) {
auto kappa = static_cast<Float>(p.kappa_min);
// auto kappa = static_cast<Float>(p.kappa_min);
auto kappa = initializer.reinit(
slv, x, is_a_solution, best_recorder, p.kappa_min, p.kappa_max);
auto best_remaining = INT_MAX;
initializer.reinit(slv, x, is_a_solution, best_recorder);
is_a_solution = false;
for (int i = 0; !stop_task.load() && i != p.limit; ++i) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment