pub struct PillarChangeMove<S, V> { /* private fields */ }Expand description
A move that assigns a value to all entities in a pillar.
Stores entity indices and concrete function pointers for zero-erasure access.
do_move returns the previous pillar values as typed undo data.
§Type Parameters
S- The planning solution typeV- The variable value type
Implementations§
Source§impl<S, V> PillarChangeMove<S, V>
impl<S, V> PillarChangeMove<S, V>
Sourcepub fn new(
entity_indices: Vec<usize>,
to_value: Option<V>,
getter: fn(&S, usize, usize) -> Option<V>,
setter: fn(&mut S, usize, usize, Option<V>),
variable_index: usize,
variable_name: &'static str,
descriptor_index: usize,
) -> Self
pub fn new( entity_indices: Vec<usize>, to_value: Option<V>, getter: fn(&S, usize, usize) -> Option<V>, setter: fn(&mut S, usize, usize, Option<V>), variable_index: usize, variable_name: &'static str, descriptor_index: usize, ) -> Self
Creates a new pillar change move with concrete function pointers.
§Arguments
entity_indices- Indices of entities in the pillarto_value- The new value to assign to all entitiesgetter- Concrete getter function pointersetter- Concrete setter function pointervariable_name- Name of the variable being changeddescriptor_index- Index in the entity descriptor
pub fn pillar_size(&self) -> usize
pub fn to_value(&self) -> Option<&V>
Trait Implementations§
Source§impl<S, V: Debug> Debug for PillarChangeMove<S, V>
impl<S, V: Debug> Debug for PillarChangeMove<S, V>
Source§impl<S, V> Move<S> for PillarChangeMove<S, V>
impl<S, V> Move<S> for PillarChangeMove<S, V>
type Undo = SmallVec<[(usize, Option<V>); 4]>
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
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>
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 PillarChangeMove<S, V>
impl<S, V> RefUnwindSafe for PillarChangeMove<S, V>where
Option<V>: RefUnwindSafe,
fn(&S, usize, usize) -> Option<V>: RefUnwindSafe,
fn(&mut S, usize, usize, Option<V>): RefUnwindSafe,
impl<S, V> Send for PillarChangeMove<S, V>
impl<S, V> Sync for PillarChangeMove<S, V>
impl<S, V> Unpin for PillarChangeMove<S, V>
impl<S, V> UnsafeUnpin for PillarChangeMove<S, V>where
Option<V>: UnsafeUnpin,
fn(&S, usize, usize) -> Option<V>: UnsafeUnpin,
fn(&mut S, usize, usize, Option<V>): UnsafeUnpin,
impl<S, V> UnwindSafe for PillarChangeMove<S, V>where
Option<V>: UnwindSafe,
fn(&S, usize, usize) -> Option<V>: UnwindSafe,
fn(&mut S, usize, usize, Option<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