pub struct InDomainInterval;Expand description
Reduces the domain (consisting of intervals) to its first interval.
If the domain consists of several intervals (e.g. a variable with the domain {0, 1, 4, 5, 6, 9,
10} consists of the interval {[0-1], [4-6], [9-10]}), then this ValueSelector will reduce
the domain to the first interval (e.g. to {0, 1} in the previous example).
Otherwise (i.e. if the domain is one continuous interval) then it will bisect the domain in the
same manner as InDomainSplit.
Trait Implementations§
Source§impl Clone for InDomainInterval
impl Clone for InDomainInterval
Source§fn clone(&self) -> InDomainInterval
fn clone(&self) -> InDomainInterval
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InDomainInterval
impl Debug for InDomainInterval
Source§impl ValueSelector<DomainId> for InDomainInterval
impl ValueSelector<DomainId> for InDomainInterval
Source§fn select_value(
&mut self,
context: &mut SelectionContext<'_>,
decision_variable: DomainId,
) -> Predicate
fn select_value( &mut self, context: &mut SelectionContext<'_>, decision_variable: DomainId, ) -> Predicate
Determines which value in the domain of
decision_variable to branch next on.
The domain of the decision_variable variable should have at least 2 values in it (as it
otherwise should not have been selected as decision_variable). Returns a
Predicate specifying the required change in the domain.Source§fn subscribe_to_events(&self) -> Vec<BrancherEvent>
fn subscribe_to_events(&self) -> Vec<BrancherEvent>
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 and value which is the value to which the variable was
previously fixed. This method could thus be called multiple times in a single
backtracking operation by the solver. Read moreSource§fn on_solution(&mut self, _solution: SolutionReference<'_>)
fn on_solution(&mut self, _solution: SolutionReference<'_>)
This method is called when a solution is found; either when iterating over all solutions in
the case of a satisfiable problem or on solutions of increasing quality when solving an
optimisation problem. Read more
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
ValueSelector. Read moreimpl Copy for InDomainInterval
Auto Trait Implementations§
impl Freeze for InDomainInterval
impl RefUnwindSafe for InDomainInterval
impl Send for InDomainInterval
impl Sync for InDomainInterval
impl Unpin for InDomainInterval
impl UnwindSafe for InDomainInterval
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> 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