Skip to main content

Move

Trait Move 

Source
pub trait Move<S: PlanningSolution>:
    Send
    + Sync
    + Debug {
    type Undo: Send;

Show 16 methods // Required methods fn is_doable<D: Director<S>>(&self, score_director: &D) -> bool; fn do_move<D: Director<S>>(&self, score_director: &mut D) -> Self::Undo; fn undo_move<D: Director<S>>( &self, score_director: &mut D, undo: Self::Undo, ); 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; // Provided methods fn do_move_with_scratch<D: Director<S>>( &self, score_director: &mut D, journal_pool: &mut Vec<Self::Undo>, ) -> Self::Undo { ... } fn undo_move_with_scratch<D: Director<S>>( &self, score_director: &mut D, undo: Self::Undo, journal_pool: &mut Vec<Self::Undo>, ) { ... } fn is_doable_with_working_preview<D: Director<S>>( &self, score_director: &mut D, ) -> bool { ... } fn telemetry_label(&self) -> &'static str { ... } fn requires_hard_improvement(&self) -> bool { ... } fn requires_score_improvement(&self) -> bool { ... } fn borrowed_tabu_signature(&self) -> Option<&MoveTabuSignature> { ... } fn candidate_trace_identity(&self) -> Option<CandidateTraceIdentity> { ... } fn for_each_affected_entity<V: FnMut(MoveAffectedEntity<'_>)>( &self, visitor: &mut V, ) { ... }
}
Expand description

A move that modifies one or more planning variables.

Moves are fully monomorphized for maximum performance - no boxing, no virtual dispatch. Undo is handled by move-owned typed data, not boxed director callbacks.

§Type Parameters

  • S - The planning solution type

§Implementation Notes

  • Moves should be lightweight
  • Moves are NEVER cloned - ownership transfers via arena indices
  • Methods are generic over D to allow use with concrete directors

Required Associated Types§

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) -> Self::Undo

Source

fn undo_move<D: Director<S>>(&self, score_director: &mut D, undo: Self::Undo)

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

Provided Methods§

Source

fn do_move_with_scratch<D: Director<S>>( &self, score_director: &mut D, journal_pool: &mut Vec<Self::Undo>, ) -> Self::Undo

Source

fn undo_move_with_scratch<D: Director<S>>( &self, score_director: &mut D, undo: Self::Undo, journal_pool: &mut Vec<Self::Undo>, )

Source

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

Source

fn telemetry_label(&self) -> &'static str

Source

fn requires_hard_improvement(&self) -> bool

Source

fn requires_score_improvement(&self) -> bool

Source

fn borrowed_tabu_signature(&self) -> Option<&MoveTabuSignature>

Source

fn candidate_trace_identity(&self) -> Option<CandidateTraceIdentity>

Returns the canonical identity used by opt-in candidate-pull tracing.

Returns an explicit logical-coordinate identity for candidate tracing.

This intentionally does not derive from tabu metadata: tabu keys may contain representation-specific hashes. A move family that has not supplied a cross-representation coordinate grammar returns None, and the resulting trace is explicitly non-qualifying rather than faking a comparable key.

Source

fn for_each_affected_entity<V: FnMut(MoveAffectedEntity<'_>)>( &self, visitor: &mut V, )

Visits every entity this move changes, passing a concrete visitor by value. V stays monomorphized end to end: no dyn dispatch, no intermediate collection, every affected entity reported exactly once in the move’s own canonical order.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

type Undo = <M as Move<S>>::Undo

Source§

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

Source§

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

Source§

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

Source§

fn undo_move<D: Director<S>>(&self, score_director: &mut D, undo: Self::Undo)

Source§

fn do_move_with_scratch<D: Director<S>>( &self, score_director: &mut D, journal_pool: &mut Vec<Self::Undo>, ) -> Self::Undo

Source§

fn undo_move_with_scratch<D: Director<S>>( &self, score_director: &mut D, undo: Self::Undo, journal_pool: &mut Vec<Self::Undo>, )

Source§

fn descriptor_index(&self) -> usize

Source§

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

Source§

fn variable_name(&self) -> &str

Source§

fn telemetry_label(&self) -> &'static str

Source§

fn requires_hard_improvement(&self) -> bool

Source§

fn requires_score_improvement(&self) -> bool

Source§

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

Source§

fn candidate_trace_identity(&self) -> Option<CandidateTraceIdentity>

Source§

fn for_each_affected_entity<V: FnMut(MoveAffectedEntity<'_>)>( &self, visitor: &mut V, )

Implementors§

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§

type Undo = (<M as Move<S>>::Undo, <M as Move<S>>::Undo)

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 ListMoveUnion<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

type Undo = ListMoveUnionUndo<S, V>

Source§

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

Source§

impl<S, V> Move<S> for ListPermuteMove<S, V>
where S: PlanningSolution, V: Clone + 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 + PartialEq + 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§

type Undo = (Vec<(usize, Option<V>)>, Vec<(usize, Option<V>)>)

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 ScalarMoveUnion<S, V>
where S: PlanningSolution, V: Clone + PartialEq + Send + Sync + Debug + 'static,

Source§

type Undo = ScalarMoveUnionUndo<S, V>

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,

Source§

type Undo = (Option<V>, Option<V>)

Source§

impl<S> Move<S> for CompoundScalarMove<S>

Source§

impl<S> Move<S> for ConflictRepairMove<S>

Source§

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

Source§

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

Source§

type Undo = DescriptorMoveUnionUndo<S>

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 DynamicListChangeMove<S>

Source§

impl<S> Move<S> for DynamicScalarChangeMove<S>

Source§

impl<S> Move<S> for DynamicScalarSwapMove<S>

Source§

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

Source§

impl<S> Move<S> for RuntimeCompoundMove<S>