pub struct InputOrder<Var> { /* private fields */ }Expand description
A VariableSelector which selects the first variable which is not fixed given the order in
the provided list.
Implementations§
Source§impl<Var> InputOrder<Var>where
Var: Copy,
impl<Var> InputOrder<Var>where
Var: Copy,
pub fn new(variables: &[Var]) -> InputOrder<Var>
Trait Implementations§
Source§impl<Var> Debug for InputOrder<Var>where
Var: Debug,
impl<Var> Debug for InputOrder<Var>where
Var: Debug,
Source§impl VariableSelector<DomainId> for InputOrder<DomainId>
impl VariableSelector<DomainId> for InputOrder<DomainId>
Source§fn select_variable(
&mut self,
context: &mut SelectionContext<'_>,
) -> Option<DomainId>
fn select_variable( &mut self, context: &mut 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 subscribe_to_events(&self) -> Vec<BrancherEvent>
fn subscribe_to_events(&self) -> Vec<BrancherEvent>
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. Read more
Source§fn on_backtrack(&mut self)
fn on_backtrack(&mut self)
A function which is called whenever a backtrack occurs in the solver. Read more
Source§fn on_unassign_integer(&mut self, _variable: DomainId, _value: i32)
fn on_unassign_integer(&mut self, _variable: DomainId, _value: i32)
A function which is called after a
DomainId is unassigned during backtracking (i.e. when
it was fixed but is no longer), specifically, it provides variable which is the
DomainId which has been reset. This method could thus be called multiple times in a
single backtracking operation by the solver. Read moreSource§fn on_appearance_in_conflict_predicate(&mut self, _predicate: Predicate)
fn on_appearance_in_conflict_predicate(&mut self, _predicate: Predicate)
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 moreSource§impl VariableSelector<Literal> for InputOrder<Literal>
impl VariableSelector<Literal> for InputOrder<Literal>
Source§fn select_variable(
&mut self,
context: &mut SelectionContext<'_>,
) -> Option<Literal>
fn select_variable( &mut self, context: &mut SelectionContext<'_>, ) -> Option<Literal>
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 subscribe_to_events(&self) -> Vec<BrancherEvent>
fn subscribe_to_events(&self) -> Vec<BrancherEvent>
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. Read more
Source§fn on_backtrack(&mut self)
fn on_backtrack(&mut self)
A function which is called whenever a backtrack occurs in the solver. Read more
Source§fn on_unassign_integer(&mut self, _variable: DomainId, _value: i32)
fn on_unassign_integer(&mut self, _variable: DomainId, _value: i32)
A function which is called after a
DomainId is unassigned during backtracking (i.e. when
it was fixed but is no longer), specifically, it provides variable which is the
DomainId which has been reset. This method could thus be called multiple times in a
single backtracking operation by the solver. Read moreSource§fn on_appearance_in_conflict_predicate(&mut self, _predicate: Predicate)
fn on_appearance_in_conflict_predicate(&mut self, _predicate: Predicate)
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> Freeze for InputOrder<Var>
impl<Var> RefUnwindSafe for InputOrder<Var>where
Var: RefUnwindSafe,
impl<Var> Send for InputOrder<Var>where
Var: Send,
impl<Var> Sync for InputOrder<Var>where
Var: Sync,
impl<Var> Unpin for InputOrder<Var>where
Var: Unpin,
impl<Var> UnwindSafe for InputOrder<Var>where
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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