pub struct MoveTabuAcceptor { /* private fields */ }Expand description
Move tabu acceptor - maintains a tabu list based on move identifiers.
Unlike entity tabu (which forbids recently moved entities) or value tabu (which forbids recently assigned values), move tabu forbids the exact move combination (entity + value). This provides finer-grained control.
A move is identified by its hash, typically combining entity index and assigned value information.
§Example
use solverforge_solver::phase::localsearch::MoveTabuAcceptor;
let acceptor = MoveTabuAcceptor::new(7);
assert!(!acceptor.is_move_tabu(42));Implementations§
Source§impl MoveTabuAcceptor
impl MoveTabuAcceptor
Sourcepub fn new(move_tabu_size: usize) -> Self
pub fn new(move_tabu_size: usize) -> Self
Creates a new move tabu acceptor with aspiration enabled.
§Arguments
move_tabu_size- Maximum number of moves to remember as tabu
Sourcepub fn without_aspiration(move_tabu_size: usize) -> Self
pub fn without_aspiration(move_tabu_size: usize) -> Self
Creates a move tabu acceptor without aspiration.
Without aspiration, tabu moves are never accepted even if they would lead to a new best solution.
Sourcepub fn record_move(&mut self, move_hash: u64)
pub fn record_move(&mut self, move_hash: u64)
Records that a move was executed in the current step.
Call this with the hash of the executed move.
Sourcepub fn is_move_tabu(&self, move_hash: u64) -> bool
pub fn is_move_tabu(&self, move_hash: u64) -> bool
Returns true if the given move hash is in the tabu list.
Sourcepub fn aspiration_enabled(&self) -> bool
pub fn aspiration_enabled(&self) -> bool
Returns true if aspiration is enabled.
Trait Implementations§
Source§impl<S: PlanningSolution> Acceptor<S> for MoveTabuAcceptor
impl<S: PlanningSolution> Acceptor<S> for MoveTabuAcceptor
Source§fn 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
move_score should be accepted,
given the previous step’s score.