pub struct StepScope<'t, 'a, 'b, S: PlanningSolution, D: ScoreDirector<S>> { /* private fields */ }Expand description
Scope for a single step within a phase.
§Type Parameters
't- Lifetime of the termination flag'a- Lifetime of the phase scope reference'b- Lifetime of the solver scope referenceS- The planning solution typeD- The score director type
Implementations§
Source§impl<'t, 'a, 'b, S: PlanningSolution, D: ScoreDirector<S>> StepScope<'t, 'a, 'b, S, D>
impl<'t, 'a, 'b, S: PlanningSolution, D: ScoreDirector<S>> StepScope<'t, 'a, 'b, S, D>
Sourcepub fn new(phase_scope: &'a mut PhaseScope<'t, 'b, S, D>) -> Self
pub fn new(phase_scope: &'a mut PhaseScope<'t, 'b, S, D>) -> Self
Creates a new step scope.
Sourcepub fn step_index(&self) -> u64
pub fn step_index(&self) -> u64
Returns the step index within the phase.
Sourcepub fn step_score(&self) -> Option<&S::Score>
pub fn step_score(&self) -> Option<&S::Score>
Returns the step score.
Sourcepub fn set_step_score(&mut self, score: S::Score)
pub fn set_step_score(&mut self, score: S::Score)
Sets the step score.
Sourcepub fn phase_scope(&self) -> &PhaseScope<'t, 'b, S, D>
pub fn phase_scope(&self) -> &PhaseScope<'t, 'b, S, D>
Returns a reference to the phase scope.
Sourcepub fn phase_scope_mut(&mut self) -> &mut PhaseScope<'t, 'b, S, D>
pub fn phase_scope_mut(&mut self) -> &mut PhaseScope<'t, 'b, S, D>
Returns a mutable reference to the phase scope.
Sourcepub fn score_director(&self) -> &D
pub fn score_director(&self) -> &D
Returns a reference to the score director.
Sourcepub fn score_director_mut(&mut self) -> &mut D
pub fn score_director_mut(&mut self) -> &mut D
Returns a mutable reference to the score director.
Sourcepub fn calculate_score(&mut self) -> S::Score
pub fn calculate_score(&mut self) -> S::Score
Calculates the current score.
Auto Trait Implementations§
impl<'t, 'a, 'b, S, D> Freeze for StepScope<'t, 'a, 'b, S, D>
impl<'t, 'a, 'b, S, D> RefUnwindSafe for StepScope<'t, 'a, 'b, S, D>
impl<'t, 'a, 'b, S, D> Send for StepScope<'t, 'a, 'b, S, D>
impl<'t, 'a, 'b, S, D> Sync for StepScope<'t, 'a, 'b, S, D>where
D: Sync,
impl<'t, 'a, 'b, S, D> Unpin for StepScope<'t, 'a, 'b, S, D>
impl<'t, 'a, 'b, S, D> !UnwindSafe for StepScope<'t, 'a, 'b, S, D>
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