Skip to main content

Move

Trait Move 

Source
pub trait Move<S: PlanningSolution>:
    Send
    + Sync
    + Debug {
    // Required methods
    fn is_doable<D: Director<S>>(&self, score_director: &D) -> bool;
    fn do_move<D: Director<S>>(&self, score_director: &mut D);
    fn descriptor_index(&self) -> usize;
    fn entity_indices(&self) -> &[usize];
    fn variable_name(&self) -> &str;
    fn tabu_signature<D: Director<S>>(
        &self,
        score_director: &D,
    ) -> MoveTabuSignature;
}
Expand description

A move that modifies one or more planning variables.

Moves are fully typed for maximum performance - no boxing, no virtual dispatch. Undo is handled by RecordingDirector, not by move return values.

§Type Parameters

  • S - The planning solution type

§Implementation Notes

  • Moves should be lightweight
  • Use RecordingDirector to wrap the score director for automatic undo
  • Moves are NEVER cloned - ownership transfers via arena indices
  • Methods are generic over D to allow use with both concrete directors and RecordingDirector

Required Methods§

Source

fn is_doable<D: Director<S>>(&self, score_director: &D) -> bool

Source

fn do_move<D: Director<S>>(&self, score_director: &mut D)

Source

fn descriptor_index(&self) -> usize

Source

fn entity_indices(&self) -> &[usize]

Source

fn variable_name(&self) -> &str

Source

fn tabu_signature<D: Director<S>>( &self, score_director: &D, ) -> MoveTabuSignature

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<S, M> Move<S> for &M
where S: PlanningSolution, M: Move<S> + ?Sized,

Source§

fn is_doable<D: Director<S>>(&self, score_director: &D) -> bool

Source§

fn do_move<D: Director<S>>(&self, score_director: &mut D)

Source§

fn descriptor_index(&self) -> usize

Source§

fn entity_indices(&self) -> &[usize]

Source§

fn variable_name(&self) -> &str

Source§

fn tabu_signature<D: Director<S>>( &self, score_director: &D, ) -> MoveTabuSignature

Implementors§

Source§

impl<S> Move<S> for DescriptorScalarMoveUnion<S>
where S: PlanningSolution + 'static, S::Score: Score,

Source§

impl<S> Move<S> for DescriptorChangeMove<S>
where S: PlanningSolution + 'static,

Source§

impl<S> Move<S> for DescriptorPillarChangeMove<S>
where S: PlanningSolution + 'static,

Source§

impl<S> Move<S> for DescriptorPillarSwapMove<S>
where S: PlanningSolution + 'static,

Source§

impl<S> Move<S> for DescriptorRuinRecreateMove<S>
where S: PlanningSolution + 'static, S::Score: Score,

Source§

impl<S> Move<S> for DescriptorSwapMove<S>
where S: PlanningSolution + 'static,

Source§

impl<S> Move<S> for RuinRecreateMove<S>

Source§

impl<S, M> Move<S> for MoveCandidateRef<'_, S, M>
where S: PlanningSolution, M: Move<S>,

Source§

impl<S, M> Move<S> for SequentialCompositeMove<S, M>
where S: PlanningSolution, M: Move<S>,

Source§

impl<S, V> Move<S> for NeighborhoodMove<S, V>
where S: PlanningSolution + 'static, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for ListMoveUnion<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for ScalarMoveUnion<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for ChangeMove<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for KOptMove<S, V>
where S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for ListChangeMove<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for ListReverseMove<S, V>
where S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for ListRuinMove<S, V>
where S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for ListSwapMove<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for PillarChangeMove<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for PillarSwapMove<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for RuinMove<S, V>
where S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for SublistChangeMove<S, V>
where S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for SublistSwapMove<S, V>
where S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static,

Source§

impl<S, V> Move<S> for SwapMove<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,