pub trait Move<S: PlanningSolution>:
Send
+ Sync
+ Debug {
// Required methods
fn is_doable<D: Director<S>>(&self, score_director: &D) -> bool;
fn do_move<D: Director<S>>(&self, score_director: &mut D);
fn descriptor_index(&self) -> usize;
fn entity_indices(&self) -> &[usize];
fn variable_name(&self) -> &str;
}Expand description
A move that modifies one or more planning variables.
Moves are fully typed for maximum performance - no boxing, no virtual dispatch.
Undo is handled by RecordingDirector, not by move return values.
§Type Parameters
S- The planning solution type
§Implementation Notes
- Moves should be lightweight
- Use
RecordingDirectorto wrap the score director for automatic undo - Moves are NEVER cloned - ownership transfers via arena indices
- Methods are generic over D to allow use with both concrete directors and RecordingDirector
Required Methods§
fn is_doable<D: Director<S>>(&self, score_director: &D) -> bool
fn do_move<D: Director<S>>(&self, score_director: &mut D)
fn descriptor_index(&self) -> usize
fn entity_indices(&self) -> &[usize]
fn variable_name(&self) -> &str
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.