pub struct SelectionContext<'a> { /* private fields */ }Expand description
Implementations§
source§impl<'a> SelectionContext<'a>
impl<'a> SelectionContext<'a>
pub fn new( assignments_integer: &'a AssignmentsInteger, assignments_propositional: &'a AssignmentsPropositional, rng: &'a mut dyn Random, ) -> Self
sourcepub fn random(&mut self) -> &mut dyn Random
pub fn random(&mut self) -> &mut dyn Random
Returns a random generator which can be used to generate random values (see Random for
more information).
sourcepub fn get_size_of_domain<Var: IntegerVariable>(&self, var: Var) -> i32
pub fn get_size_of_domain<Var: IntegerVariable>(&self, var: Var) -> i32
Returns the difference between the upper-bound and the lower-bound of the provided
IntegerVariable. Note that this is different from the number of values which are in the
domain of var since this calculation does not take into account holes in the domain.
sourcepub fn lower_bound<Var: IntegerVariable>(&self, var: Var) -> i32
pub fn lower_bound<Var: IntegerVariable>(&self, var: Var) -> i32
Returns the lower bound of the provided IntegerVariable
sourcepub fn upper_bound<Var: IntegerVariable>(&self, var: Var) -> i32
pub fn upper_bound<Var: IntegerVariable>(&self, var: Var) -> i32
Returns the upper bound of the provided IntegerVariable
sourcepub fn contains<Var: IntegerVariable>(&self, var: Var, value: i32) -> bool
pub fn contains<Var: IntegerVariable>(&self, var: Var, value: i32) -> bool
Determines whether the provided value is in the domain of the provided IntegerVariable
sourcepub fn is_integer_fixed<Var: IntegerVariable>(&self, var: Var) -> bool
pub fn is_integer_fixed<Var: IntegerVariable>(&self, var: Var) -> bool
Determines whether the provided IntegerVariable has a unit domain (i.e. a domain of size
1)
sourcepub fn is_propositional_variable_fixed(
&self,
var: PropositionalVariable,
) -> bool
pub fn is_propositional_variable_fixed( &self, var: PropositionalVariable, ) -> bool
Determines whether the provided PropositionalVariable is assigned.
sourcepub fn is_propositional_variable_true(&self, var: PropositionalVariable) -> bool
pub fn is_propositional_variable_true(&self, var: PropositionalVariable) -> bool
Returns whether the provided PropositionalVariable is assigned to true.
sourcepub fn get_domains(&self) -> DomainGeneratorIterator
pub fn get_domains(&self) -> DomainGeneratorIterator
Returns all currently defined DomainIds.
sourcepub fn get_propositional_variables(
&self,
) -> PropositionalVariableGeneratorIterator
pub fn get_propositional_variables( &self, ) -> PropositionalVariableGeneratorIterator
Returns all currently defined PropositionalVariables.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SelectionContext<'a>
impl<'a> !RefUnwindSafe for SelectionContext<'a>
impl<'a> !Send for SelectionContext<'a>
impl<'a> !Sync for SelectionContext<'a>
impl<'a> Unpin for SelectionContext<'a>
impl<'a> !UnwindSafe for SelectionContext<'a>
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
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>
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>
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