pub struct ListMultiSwapMove<S, V> { /* private fields */ }Expand description
A move that applies multiple independent intra-list swaps.
Each swap is encoded as (entity_index, first_position, second_position).
Swaps must target distinct entities; this keeps notification and undo
semantics simple and avoids order-dependent overlap within one list.
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> Clone for ListMultiSwapMove<S, V>
impl<S, V> Clone for ListMultiSwapMove<S, V>
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 requires_hard_improvement(&self) -> bool
fn for_each_affected_entity( &self, visitor: &mut dyn FnMut(MoveAffectedEntity<'_>), )
Auto Trait Implementations§
impl<S, V> Freeze for ListMultiSwapMove<S, V>
impl<S, V> RefUnwindSafe for ListMultiSwapMove<S, V>
impl<S, V> Send for ListMultiSwapMove<S, V>
impl<S, V> Sync for ListMultiSwapMove<S, V>
impl<S, V> Unpin for ListMultiSwapMove<S, V>
impl<S, V> UnsafeUnpin for ListMultiSwapMove<S, V>
impl<S, V> UnwindSafe for ListMultiSwapMove<S, V>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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