Acceptor

Trait Acceptor 

Source
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§

Source

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§

Source

fn phase_started(&mut self, _initial_score: &S::Score)

Called when a phase starts.

Source

fn phase_ended(&mut self)

Called when a phase ends.

Source

fn step_started(&mut self)

Called when a step starts.

Source

fn step_ended(&mut self, _step_score: &S::Score)

Called when a step ends with an accepted move.

Implementors§