pub struct MostConstrained<Var, TieBreaking> { /* private fields */ }Expand description
A VariableSelector which selects the variable with the smallest domain (similar to
FirstFail).
Ties are broken according to the number of attached constraints (giving priority to variable with more attached constraints).
Implementations§
Source§impl<Var: Copy + 'static> MostConstrained<Var, InOrderTieBreaker<Var, MostConstrainedValue>>
impl<Var: Copy + 'static> MostConstrained<Var, InOrderTieBreaker<Var, MostConstrainedValue>>
Trait Implementations§
Source§impl<Var, TieBreaking> Debug for MostConstrained<Var, TieBreaking>
impl<Var, TieBreaking> Debug for MostConstrained<Var, TieBreaking>
Source§impl<TieBreaking> VariableSelector<DomainId> for MostConstrained<DomainId, TieBreaking>where
TieBreaking: TieBreaker<DomainId, MostConstrainedValue>,
impl<TieBreaking> VariableSelector<DomainId> for MostConstrained<DomainId, TieBreaking>where
TieBreaking: TieBreaker<DomainId, MostConstrainedValue>,
Source§fn select_variable(
&mut self,
context: &SelectionContext<'_>,
) -> Option<DomainId>
fn select_variable( &mut self, context: &SelectionContext<'_>, ) -> Option<DomainId>
Determines which variable to select next if there are any left to branch on.
Should only return
None when all variables which have been passed to the
VariableSelector have been assigned. Otherwise it should return the variable to
branch on next.Source§fn on_conflict(&mut self)
fn on_conflict(&mut self)
A function which is called after a conflict has been found and processed but (currently)
does not provide any additional information.
Source§fn on_unassign_literal(&mut self, _literal: Literal)
fn on_unassign_literal(&mut self, _literal: Literal)
Source§fn on_unassign_integer(&mut self, _variable: DomainId, _value: i32)
fn on_unassign_integer(&mut self, _variable: DomainId, _value: i32)
Source§fn on_appearance_in_conflict_literal(&mut self, _literal: Literal)
fn on_appearance_in_conflict_literal(&mut self, _literal: Literal)
A function which is called when a
Literal appears in a conflict during conflict
analysis.Source§fn on_appearance_in_conflict_integer(&mut self, _variable: DomainId)
fn on_appearance_in_conflict_integer(&mut self, _variable: DomainId)
A function which is called when a variable appears in a conflict during conflict analysis.
Source§fn is_restart_pointless(&mut self) -> bool
fn is_restart_pointless(&mut self) -> bool
This method returns whether a restart is currently pointless for the
VariableSelector. Read moreAuto Trait Implementations§
impl<Var, TieBreaking> Freeze for MostConstrained<Var, TieBreaking>where
TieBreaking: Freeze,
impl<Var, TieBreaking> RefUnwindSafe for MostConstrained<Var, TieBreaking>where
TieBreaking: RefUnwindSafe,
Var: RefUnwindSafe,
impl<Var, TieBreaking> Send for MostConstrained<Var, TieBreaking>
impl<Var, TieBreaking> Sync for MostConstrained<Var, TieBreaking>
impl<Var, TieBreaking> Unpin for MostConstrained<Var, TieBreaking>
impl<Var, TieBreaking> UnwindSafe for MostConstrained<Var, TieBreaking>where
TieBreaking: UnwindSafe,
Var: UnwindSafe,
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> 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