pub struct ListMultiSwapMove<S, V> { /* private fields */ }Expand description
Multiple independent intra-list swaps, one per entity.
The public move keeps its historic constructor and score-improvement flag; shared list-kernel mechanics own doability, notifications, mutation, undo, and tabu identity for static and runtime carriers alike.
Implementations§
Source§impl<S, V> ListMultiSwapMove<S, V>
impl<S, V> ListMultiSwapMove<S, V>
pub fn new( swaps: &[(usize, usize, usize)], list_len: fn(&S, usize) -> usize, list_get: fn(&S, usize, usize) -> Option<V>, list_set: fn(&mut S, usize, usize, V), variable_name: &'static str, descriptor_index: usize, ) -> Self
pub fn with_require_score_improvement( self, require_score_improvement: bool, ) -> Self
pub fn swaps(&self) -> &[(usize, usize, usize)]
Trait Implementations§
Source§impl<S, V: Debug> Debug for ListMultiSwapMove<S, V>
impl<S, V: Debug> Debug for ListMultiSwapMove<S, V>
Source§impl<S, V> Move<S> for ListMultiSwapMove<S, V>
impl<S, V> Move<S> for ListMultiSwapMove<S, V>
type Undo = ()
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, (): Self::Undo)
fn descriptor_index(&self) -> usize
fn entity_indices(&self) -> &[usize]
fn variable_name(&self) -> &str
fn telemetry_label(&self) -> &'static str
fn requires_score_improvement(&self) -> bool
fn tabu_signature<D: Director<S>>( &self, score_director: &D, ) -> MoveTabuSignature
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 requires_hard_improvement(&self) -> bool
fn borrowed_tabu_signature(&self) -> Option<&MoveTabuSignature>
Source§fn candidate_trace_identity(&self) -> Option<CandidateTraceIdentity>
fn candidate_trace_identity(&self) -> Option<CandidateTraceIdentity>
Returns the canonical identity used by opt-in candidate-pull tracing. Read more
Source§fn for_each_affected_entity<V: FnMut(MoveAffectedEntity<'_>)>(
&self,
visitor: &mut V,
)
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.Auto Trait Implementations§
impl<S, V> Freeze for ListMultiSwapMove<S, V>where
StaticListSwapAccess<S, V>: Freeze,
impl<S, V> RefUnwindSafe for ListMultiSwapMove<S, V>where
StaticListSwapAccess<S, V>: RefUnwindSafe,
impl<S, V> Send for ListMultiSwapMove<S, V>where
StaticListSwapAccess<S, V>: Send,
impl<S, V> Sync for ListMultiSwapMove<S, V>where
StaticListSwapAccess<S, V>: Sync,
impl<S, V> Unpin for ListMultiSwapMove<S, V>where
StaticListSwapAccess<S, V>: Unpin,
impl<S, V> UnsafeUnpin for ListMultiSwapMove<S, V>where
StaticListSwapAccess<S, V>: UnsafeUnpin,
impl<S, V> UnwindSafe for ListMultiSwapMove<S, V>where
StaticListSwapAccess<S, V>: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more