pub struct ScoreDirector<S, C>{ /* private fields */ }Implementations§
Source§impl<S, C> ScoreDirector<S, C>where
S: PlanningSolution,
<S as PlanningSolution>::Score: Score,
C: ConstraintSet<S, <S as PlanningSolution>::Score>,
impl<S, C> ScoreDirector<S, C>where
S: PlanningSolution,
<S as PlanningSolution>::Score: Score,
C: ConstraintSet<S, <S as PlanningSolution>::Score>,
pub fn new(solution: S, constraints: C) -> ScoreDirector<S, C>
pub fn with_descriptor( solution: S, constraints: C, solution_descriptor: SolutionDescriptor, entity_counter: fn(&S, usize) -> usize, ) -> ScoreDirector<S, C>
pub fn working_solution(&self) -> &S
pub fn working_solution_mut(&mut self) -> &mut S
pub fn into_working_solution(self) -> S
pub fn calculate_score(&mut self) -> <S as PlanningSolution>::Score
pub fn before_variable_changed( &mut self, descriptor_index: usize, entity_index: usize, )
pub fn after_variable_changed( &mut self, descriptor_index: usize, entity_index: usize, )
pub fn after_variable_changed_with_shadows(
&mut self,
descriptor_index: usize,
entity_index: usize,
)where
S: ShadowVariableSupport,
pub fn do_change<F>( &mut self, descriptor_index: usize, entity_index: usize, change_fn: F, ) -> <S as PlanningSolution>::Score
pub fn do_change_with_shadows<F>( &mut self, descriptor_index: usize, entity_index: usize, change_fn: F, ) -> <S as PlanningSolution>::Score
pub fn get_score(&self) -> <S as PlanningSolution>::Score
pub fn reset(&mut self)
pub fn clone_working_solution(&self) -> S
pub fn constraints(&self) -> &C
pub fn constraints_mut(&mut self) -> &mut C
pub fn constraint_count(&self) -> usize
pub fn is_initialized(&self) -> bool
pub fn constraint_match_totals( &self, ) -> Vec<(String, <S as PlanningSolution>::Score, <S as PlanningSolution>::Score, usize)>
pub fn take_solution(self) -> S
Source§impl<S> ScoreDirector<S, ()>
impl<S> ScoreDirector<S, ()>
pub fn simple( solution: S, descriptor: SolutionDescriptor, entity_counter: fn(&S, usize) -> usize, ) -> ScoreDirector<S, ()>
pub fn simple_zero(solution: S) -> ScoreDirector<S, ()>
Trait Implementations§
Source§impl<S, C> Debug for ScoreDirector<S, C>where
S: PlanningSolution + Debug,
<S as PlanningSolution>::Score: Debug,
C: ConstraintSet<S, <S as PlanningSolution>::Score>,
impl<S, C> Debug for ScoreDirector<S, C>where
S: PlanningSolution + Debug,
<S as PlanningSolution>::Score: Debug,
C: ConstraintSet<S, <S as PlanningSolution>::Score>,
Source§impl<S, C> Director<S> for ScoreDirector<S, C>where
S: PlanningSolution,
<S as PlanningSolution>::Score: Score,
C: ConstraintSet<S, <S as PlanningSolution>::Score> + Send,
impl<S, C> Director<S> for ScoreDirector<S, C>where
S: PlanningSolution,
<S as PlanningSolution>::Score: Score,
C: ConstraintSet<S, <S as PlanningSolution>::Score> + Send,
fn working_solution(&self) -> &S
fn working_solution_mut(&mut self) -> &mut S
fn calculate_score(&mut self) -> <S as PlanningSolution>::Score
fn solution_descriptor(&self) -> &SolutionDescriptor
fn clone_working_solution(&self) -> S
fn before_variable_changed( &mut self, descriptor_index: usize, entity_index: usize, )
fn after_variable_changed( &mut self, descriptor_index: usize, entity_index: usize, )
fn entity_count(&self, descriptor_index: usize) -> Option<usize>
fn total_entity_count(&self) -> Option<usize>
fn is_incremental(&self) -> bool
fn reset(&mut self)
fn register_undo(&mut self, _undo: Box<dyn FnOnce(&mut S) + Send>)
Auto Trait Implementations§
impl<S, C> Freeze for ScoreDirector<S, C>
impl<S, C> !RefUnwindSafe for ScoreDirector<S, C>
impl<S, C> Send for ScoreDirector<S, C>
impl<S, C> Sync for ScoreDirector<S, C>
impl<S, C> Unpin for ScoreDirector<S, C>
impl<S, C> UnsafeUnpin for ScoreDirector<S, C>
impl<S, C> !UnwindSafe for ScoreDirector<S, C>
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