pub struct PhaseScope<'a, S: PlanningSolution> { /* private fields */ }Expand description
Scope for a single phase of solving.
Implementations§
Source§impl<'a, S: PlanningSolution> PhaseScope<'a, S>
impl<'a, S: PlanningSolution> PhaseScope<'a, S>
Sourcepub fn new(solver_scope: &'a mut SolverScope<S>, phase_index: usize) -> Self
pub fn new(solver_scope: &'a mut SolverScope<S>, phase_index: usize) -> Self
Creates a new phase scope.
Sourcepub fn phase_index(&self) -> usize
pub fn phase_index(&self) -> usize
Returns the phase index.
Sourcepub fn starting_score(&self) -> Option<&S::Score>
pub fn starting_score(&self) -> Option<&S::Score>
Returns the starting score for this phase.
Sourcepub fn step_count(&self) -> u64
pub fn step_count(&self) -> u64
Returns the step count for this phase.
Sourcepub fn increment_step_count(&mut self) -> u64
pub fn increment_step_count(&mut self) -> u64
Increments the phase step count.
Sourcepub fn solver_scope(&self) -> &SolverScope<S>
pub fn solver_scope(&self) -> &SolverScope<S>
Returns a reference to the solver scope.
Sourcepub fn solver_scope_mut(&mut self) -> &mut SolverScope<S>
pub fn solver_scope_mut(&mut self) -> &mut SolverScope<S>
Returns a mutable reference to the solver scope.
Sourcepub fn score_director(&self) -> &dyn ScoreDirector<S>
pub fn score_director(&self) -> &dyn ScoreDirector<S>
Convenience: returns the score director.
Sourcepub fn score_director_mut(&mut self) -> &mut dyn ScoreDirector<S>
pub fn score_director_mut(&mut self) -> &mut dyn ScoreDirector<S>
Convenience: returns a mutable score director.
Sourcepub fn calculate_score(&mut self) -> S::Score
pub fn calculate_score(&mut self) -> S::Score
Convenience: calculates the current score.
Sourcepub fn update_best_solution(&mut self)
pub fn update_best_solution(&mut self)
Convenience: updates best solution.
Auto Trait Implementations§
impl<'a, S> Freeze for PhaseScope<'a, S>
impl<'a, S> !RefUnwindSafe for PhaseScope<'a, S>
impl<'a, S> Send for PhaseScope<'a, S>
impl<'a, S> !Sync for PhaseScope<'a, S>
impl<'a, S> Unpin for PhaseScope<'a, S>
impl<'a, S> !UnwindSafe for PhaseScope<'a, S>
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