pub struct EntityTabuAcceptor { /* private fields */ }Expand description
Entity tabu acceptor - maintains a tabu list based on entity identifiers.
This is a more sophisticated tabu search that tracks which entities have been recently modified rather than just tracking scores. It requires entities to have a stable hash/identifier.
§Example
use solverforge_solver::phase::localsearch::EntityTabuAcceptor;
let acceptor = EntityTabuAcceptor::new(7);
assert!(!acceptor.is_entity_tabu(42));Implementations§
Source§impl EntityTabuAcceptor
impl EntityTabuAcceptor
Sourcepub fn record_entity_move(&mut self, entity_id: u64)
pub fn record_entity_move(&mut self, entity_id: u64)
Records that an entity was moved in the current step.
Sourcepub fn is_entity_tabu(&self, entity_id: u64) -> bool
pub fn is_entity_tabu(&self, entity_id: u64) -> bool
Returns true if the given entity is in the tabu list.
Trait Implementations§
Source§impl<S: PlanningSolution> Acceptor<S> for EntityTabuAcceptor
impl<S: PlanningSolution> Acceptor<S> for EntityTabuAcceptor
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
Returns true if a move resulting in
move_score should be accepted,
given the previous step’s score.Source§fn phase_started(&mut self, _initial_score: &S::Score)
fn phase_started(&mut self, _initial_score: &S::Score)
Called when a phase starts.
Source§fn phase_ended(&mut self)
fn phase_ended(&mut self)
Called when a phase ends.
Source§fn step_started(&mut self)
fn step_started(&mut self)
Called when a step starts.
Source§fn 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.
Source§impl Clone for EntityTabuAcceptor
impl Clone for EntityTabuAcceptor
Source§impl Debug for EntityTabuAcceptor
impl Debug for EntityTabuAcceptor
Auto Trait Implementations§
impl Freeze for EntityTabuAcceptor
impl RefUnwindSafe for EntityTabuAcceptor
impl Send for EntityTabuAcceptor
impl Sync for EntityTabuAcceptor
impl Unpin for EntityTabuAcceptor
impl UnwindSafe for EntityTabuAcceptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more