pub struct Fixed<const N: usize> { /* private fields */ }Expand description
A fixed interval restart strategy.
Restarts occur every N conflicts (or other units).
The generic constant N defines this fixed interval.
Trait Implementations§
Source§impl<const N: usize> Restarter for Fixed<N>
impl<const N: usize> Restarter for Fixed<N>
Source§fn new() -> Self
fn new() -> Self
Creates a new Fixed restarter.
restarts_in is initialised to 0, meaning it will restart on the first call to should_restart().
The interval for all subsequent restarts will be N.
Source§fn restart(&mut self)
fn restart(&mut self)
Performs a restart:
- Increments the restart count.
- Resets
restarts_intorestarts_interval(which is fixed atN).
Source§fn restarts_in(&self) -> usize
fn restarts_in(&self) -> usize
Returns the number of conflicts (or other units) remaining until the next restart.
When this count reaches zero, a restart should occur.
Source§fn increment_restarts_in(&mut self)
fn increment_restarts_in(&mut self)
Decrements the count of conflicts (or units) remaining until the next restart.
This is called after each conflict in the solver.
Source§fn num_restarts(&self) -> usize
fn num_restarts(&self) -> usize
Returns the total number of restarts performed by this strategy so far.
Source§fn should_restart(&mut self) -> bool
fn should_restart(&mut self) -> bool
Checks if a restart should occur based on the current state. Read more
impl<const N: usize> Eq for Fixed<N>
impl<const N: usize> StructuralPartialEq for Fixed<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for Fixed<N>
impl<const N: usize> RefUnwindSafe for Fixed<N>
impl<const N: usize> Send for Fixed<N>
impl<const N: usize> Sync for Fixed<N>
impl<const N: usize> Unpin for Fixed<N>
impl<const N: usize> UnwindSafe for Fixed<N>
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> 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