pub struct GreatDelugeAcceptor<S: PlanningSolution> { /* private fields */ }Expand description
Great Deluge acceptor - accepts moves above a rising water level.
The water level starts at the initial solution’s score and rises over time. A move is accepted if its resulting score is at or above the current water level. This allows temporary score degradation while gradually tightening acceptance.
§Algorithm
- Water level starts at initial score
- Each step, water level rises by
rain_speed * |initial_score| - Accept if
move_score >= water_level
§Example
use solverforge_solver::phase::localsearch::GreatDelugeAcceptor;
use solverforge_core::score::SoftScore;
use solverforge_core::domain::PlanningSolution;
#[derive(Clone)]
struct MySolution;
impl PlanningSolution for MySolution {
type Score = SoftScore;
fn score(&self) -> Option<Self::Score> { None }
fn set_score(&mut self, _: Option<Self::Score>) {}
}
// Rain speed of 0.001 means water level rises by 0.1% of |initial| per step
let acceptor = GreatDelugeAcceptor::<MySolution>::new(0.001);Implementations§
Source§impl<S: PlanningSolution> GreatDelugeAcceptor<S>
impl<S: PlanningSolution> GreatDelugeAcceptor<S>
Trait Implementations§
Source§impl<S: PlanningSolution> Acceptor<S> for GreatDelugeAcceptor<S>
impl<S: PlanningSolution> Acceptor<S> for GreatDelugeAcceptor<S>
fn is_accepted( &mut self, last_step_score: &S::Score, move_score: &S::Score, ) -> bool
fn phase_started(&mut self, initial_score: &S::Score)
fn step_ended(&mut self, _step_score: &S::Score)
fn phase_ended(&mut self)
fn step_started(&mut self)
Source§impl<S: PlanningSolution> Clone for GreatDelugeAcceptor<S>
impl<S: PlanningSolution> Clone for GreatDelugeAcceptor<S>
Source§impl<S: PlanningSolution> Debug for GreatDelugeAcceptor<S>
impl<S: PlanningSolution> Debug for GreatDelugeAcceptor<S>
Source§impl<S: PlanningSolution> Default for GreatDelugeAcceptor<S>
impl<S: PlanningSolution> Default for GreatDelugeAcceptor<S>
Auto Trait Implementations§
impl<S> Freeze for GreatDelugeAcceptor<S>
impl<S> RefUnwindSafe for GreatDelugeAcceptor<S>
impl<S> Send for GreatDelugeAcceptor<S>
impl<S> Sync for GreatDelugeAcceptor<S>
impl<S> Unpin for GreatDelugeAcceptor<S>
impl<S> UnsafeUnpin for GreatDelugeAcceptor<S>
impl<S> UnwindSafe for GreatDelugeAcceptor<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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