pub struct ChangeMoveSelector<S, V, ES, VS> { /* private fields */ }Expand description
A change move selector that generates ChangeMove instances.
Stores typed function pointers for zero-erasure move generation.
Implementations§
Source§impl<S: PlanningSolution, V: Clone, ES, VS> ChangeMoveSelector<S, V, ES, VS>
impl<S: PlanningSolution, V: Clone, ES, VS> ChangeMoveSelector<S, V, ES, VS>
Sourcepub fn new(
entity_selector: ES,
value_selector: VS,
getter: fn(&S, usize) -> Option<V>,
setter: fn(&mut S, usize, Option<V>),
descriptor_index: usize,
variable_name: &'static str,
) -> Self
pub fn new( entity_selector: ES, value_selector: VS, getter: fn(&S, usize) -> Option<V>, setter: fn(&mut S, usize, Option<V>), descriptor_index: usize, variable_name: &'static str, ) -> Self
Creates a new change move selector with typed function pointers.
§Arguments
entity_selector- Selects entities to modifyvalue_selector- Selects values to assigngetter- Function pointer to get current value from solutionsetter- Function pointer to set value on solutiondescriptor_index- Index of the entity descriptorvariable_name- Name of the variable
Source§impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static> ChangeMoveSelector<S, V, FromSolutionEntitySelector, StaticValueSelector<S, V>>
impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static> ChangeMoveSelector<S, V, FromSolutionEntitySelector, StaticValueSelector<S, V>>
Trait Implementations§
Source§impl<S, V, ES, VS> MoveSelector<S, ChangeMove<S, V>> for ChangeMoveSelector<S, V, ES, VS>where
S: PlanningSolution,
V: Clone + PartialEq + Send + Sync + Debug + 'static,
ES: EntitySelector<S>,
VS: ValueSelector<S, V>,
impl<S, V, ES, VS> MoveSelector<S, ChangeMove<S, V>> for ChangeMoveSelector<S, V, ES, VS>where
S: PlanningSolution,
V: Clone + PartialEq + Send + Sync + Debug + 'static,
ES: EntitySelector<S>,
VS: ValueSelector<S, V>,
fn iter_moves<'a, D: Director<S>>( &'a self, score_director: &'a D, ) -> impl Iterator<Item = ChangeMove<S, V>> + 'a
fn size<D: Director<S>>(&self, score_director: &D) -> usize
fn append_moves<D: Director<S>>( &self, score_director: &D, arena: &mut MoveArena<M>, )
fn is_never_ending(&self) -> bool
Auto Trait Implementations§
impl<S, V, ES, VS> Freeze for ChangeMoveSelector<S, V, ES, VS>
impl<S, V, ES, VS> RefUnwindSafe for ChangeMoveSelector<S, V, ES, VS>where
ES: RefUnwindSafe,
VS: RefUnwindSafe,
impl<S, V, ES, VS> Send for ChangeMoveSelector<S, V, ES, VS>
impl<S, V, ES, VS> Sync for ChangeMoveSelector<S, V, ES, VS>
impl<S, V, ES, VS> Unpin for ChangeMoveSelector<S, V, ES, VS>
impl<S, V, ES, VS> UnsafeUnpin for ChangeMoveSelector<S, V, ES, VS>where
ES: UnsafeUnpin,
VS: UnsafeUnpin,
impl<S, V, ES, VS> UnwindSafe for ChangeMoveSelector<S, V, ES, VS>where
ES: UnwindSafe,
VS: 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