From a033b20b5b1ded47e82504e9647e5ae913720d59 Mon Sep 17 00:00:00 2001 From: Stefan Kroboth Date: Sun, 22 Jan 2023 08:58:43 +0100 Subject: [PATCH] Mention `target_cost` in book (related to #318) --- media/book/src/running_solver.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/media/book/src/running_solver.md b/media/book/src/running_solver.md index a1394b05a..fde0070e2 100644 --- a/media/book/src/running_solver.md +++ b/media/book/src/running_solver.md @@ -78,12 +78,19 @@ let res = Executor::new(cost, solver) // In this particular case, the state exposed is of type `IterState`. // The documentation of `IterState` shows how this struct can be // manipulated. + // Population based solvers use `PopulationState` instead of + // `IterState`. .configure(|state| state - // Set initial parameters + // Set initial parameters (depending on the solver, + // this may be required) .param(init_param) // Set maximum iterations to 10 + // (optional, set to `std::u64::MAX` if not provided) .max_iters(10) + // Set target cost. The solver stops when this cost + // function value is reached (optional) + .target_cost(0.0) ) // run the solver on the defined problem .run()?;