pub struct CompositeMove<S, M1, M2>{ /* private fields */ }Expand description
A move that applies two moves in sequence.
Combines typed moves M1 and M2 into a single atomic move.
Execution order is: first, then second.
§Type Parameters
S- The planning solution typeM1- The first move typeM2- The second move type
§Zero-Erasure
Both moves are stored inline as concrete types. No Box<dyn Move>,
no trait objects in the hot path.
Implementations§
Trait Implementations§
Source§impl<S, M1, M2> Clone for CompositeMove<S, M1, M2>
impl<S, M1, M2> Clone for CompositeMove<S, M1, M2>
Source§fn clone(&self) -> CompositeMove<S, M1, M2>
fn clone(&self) -> CompositeMove<S, M1, M2>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, M1, M2> Debug for CompositeMove<S, M1, M2>
impl<S, M1, M2> Debug for CompositeMove<S, M1, M2>
Source§impl<S, M1, M2> Move<S> for CompositeMove<S, M1, M2>
impl<S, M1, M2> Move<S> for CompositeMove<S, M1, M2>
Source§fn is_doable(&self, score_director: &dyn ScoreDirector<S>) -> bool
fn is_doable(&self, score_director: &dyn ScoreDirector<S>) -> bool
Returns true if this move can be executed in the current state. Read more
Source§fn do_move(&self, score_director: &mut dyn ScoreDirector<S>)
fn do_move(&self, score_director: &mut dyn ScoreDirector<S>)
Executes this move, modifying the working solution. Read more
Source§fn descriptor_index(&self) -> usize
fn descriptor_index(&self) -> usize
Returns the descriptor index of the entity type this move affects.
Source§fn entity_indices(&self) -> &[usize]
fn entity_indices(&self) -> &[usize]
Returns the entity indices involved in this move.
Source§fn variable_name(&self) -> &str
fn variable_name(&self) -> &str
Returns the variable name this move affects.
Source§impl<S, M1, M2, A, B> MoveSelector<S, CompositeMove<S, M1, M2>> for CartesianProductMoveSelector<S, M1, M2, A, B>where
S: PlanningSolution,
M1: Move<S>,
M2: Move<S>,
A: MoveSelector<S, M1>,
B: MoveSelector<S, M2>,
impl<S, M1, M2, A, B> MoveSelector<S, CompositeMove<S, M1, M2>> for CartesianProductMoveSelector<S, M1, M2, A, B>where
S: PlanningSolution,
M1: Move<S>,
M2: Move<S>,
A: MoveSelector<S, M1>,
B: MoveSelector<S, M2>,
Source§fn iter_moves<'a>(
&'a self,
score_director: &'a dyn ScoreDirector<S>,
) -> Box<dyn Iterator<Item = CompositeMove<S, M1, M2>> + 'a>
fn iter_moves<'a>( &'a self, score_director: &'a dyn ScoreDirector<S>, ) -> Box<dyn Iterator<Item = CompositeMove<S, M1, M2>> + 'a>
Returns an iterator over typed moves.
Source§fn size(&self, score_director: &dyn ScoreDirector<S>) -> usize
fn size(&self, score_director: &dyn ScoreDirector<S>) -> usize
Returns the approximate number of moves.
Source§fn is_never_ending(&self) -> bool
fn is_never_ending(&self) -> bool
Returns true if this selector may return the same move multiple times.
Auto Trait Implementations§
impl<S, M1, M2> Freeze for CompositeMove<S, M1, M2>
impl<S, M1, M2> RefUnwindSafe for CompositeMove<S, M1, M2>
impl<S, M1, M2> Send for CompositeMove<S, M1, M2>
impl<S, M1, M2> Sync for CompositeMove<S, M1, M2>
impl<S, M1, M2> Unpin for CompositeMove<S, M1, M2>
impl<S, M1, M2> UnwindSafe for CompositeMove<S, M1, M2>
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