pub trait Acceptor<S: PlanningSolution>: Send + Debug {
// Required method
fn is_accepted(
&self,
last_step_score: &S::Score,
move_score: &S::Score,
) -> bool;
// Provided methods
fn phase_started(&mut self, _initial_score: &S::Score) { ... }
fn phase_ended(&mut self) { ... }
fn step_started(&mut self) { ... }
fn step_ended(&mut self, _step_score: &S::Score) { ... }
}Expand description
Trait for accepting or rejecting moves in local search.
Acceptors implement different strategies for escaping local optima, such as hill climbing, simulated annealing, or tabu search.
Required Methods§
Sourcefn is_accepted(&self, last_step_score: &S::Score, move_score: &S::Score) -> bool
fn is_accepted(&self, last_step_score: &S::Score, move_score: &S::Score) -> bool
Returns true if a move resulting in move_score should be accepted,
given the previous step’s score.
Provided Methods§
Sourcefn phase_started(&mut self, _initial_score: &S::Score)
fn phase_started(&mut self, _initial_score: &S::Score)
Called when a phase starts.
Sourcefn phase_ended(&mut self)
fn phase_ended(&mut self)
Called when a phase ends.
Sourcefn step_started(&mut self)
fn step_started(&mut self)
Called when a step starts.
Sourcefn step_ended(&mut self, _step_score: &S::Score)
fn step_ended(&mut self, _step_score: &S::Score)
Called when a step ends with an accepted move.