Skip to content

Commit

Permalink
Mention target_cost in book (related to argmin-rs#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-k committed Jan 22, 2023
1 parent b39d127 commit a033b20
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion media/book/src/running_solver.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down

0 comments on commit a033b20

Please sign in to comment.