pub struct KOptMoveSelector<S, V> { /* private fields */ }Expand description
A move selector that generates k-opt moves.
Enumerates all valid cut point combinations for each selected entity and generates moves for each reconnection pattern.
Implementations§
Source§impl<S: PlanningSolution, V> KOptMoveSelector<S, V>
impl<S: PlanningSolution, V> KOptMoveSelector<S, V>
Sourcepub fn new(
entity_selector: Box<dyn EntitySelector<S>>,
config: KOptConfig,
list_len: fn(&S, usize) -> usize,
sublist_remove: fn(&mut S, usize, usize, usize) -> Vec<V>,
sublist_insert: fn(&mut S, usize, usize, Vec<V>),
variable_name: &'static str,
descriptor_index: usize,
) -> Self
pub fn new( entity_selector: Box<dyn EntitySelector<S>>, config: KOptConfig, list_len: fn(&S, usize) -> usize, sublist_remove: fn(&mut S, usize, usize, usize) -> Vec<V>, sublist_insert: fn(&mut S, usize, usize, Vec<V>), variable_name: &'static str, descriptor_index: usize, ) -> Self
Creates a new k-opt move selector.
Trait Implementations§
Source§impl<S, V: Debug> Debug for KOptMoveSelector<S, V>
impl<S, V: Debug> Debug for KOptMoveSelector<S, V>
Source§impl<S, V> MoveSelector<S, KOptMove<S, V>> for KOptMoveSelector<S, V>
impl<S, V> MoveSelector<S, KOptMove<S, V>> for KOptMoveSelector<S, V>
Source§fn iter_moves<'a>(
&'a self,
score_director: &'a dyn ScoreDirector<S>,
) -> Box<dyn Iterator<Item = KOptMove<S, V>> + 'a>
fn iter_moves<'a>( &'a self, score_director: &'a dyn ScoreDirector<S>, ) -> Box<dyn Iterator<Item = KOptMove<S, V>> + '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, V> Freeze for KOptMoveSelector<S, V>
impl<S, V> !RefUnwindSafe for KOptMoveSelector<S, V>
impl<S, V> Send for KOptMoveSelector<S, V>where
V: Send,
impl<S, V> !Sync for KOptMoveSelector<S, V>
impl<S, V> Unpin for KOptMoveSelector<S, V>where
V: Unpin,
impl<S, V> !UnwindSafe for KOptMoveSelector<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