Skip to content

Commit

Permalink
Initialize with the best seed instead of initial seed at population w…
Browse files Browse the repository at this point in the history
…ipeout
  • Loading branch information
sea-bass committed Nov 30, 2024
1 parent 87b4c60 commit 9121d36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ik_memetic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ auto ik_memetic_impl(std::vector<double> const& initial_guess,
return ik.best();
}
if (ik.checkWipeout()) {
// Ensure the first member of the new population is the best so far.
if (print_debug) fmt::print("Population wipeout\n");
ik.initPopulation(robot, cost_fn, initial_guess);
ik.initPopulation(robot, cost_fn, ik.best().genes);
}

// Check termination condition from other threads finding a solution.
Expand Down

0 comments on commit 9121d36

Please sign in to comment.