pub enum IntervalConstraint {
True,
False,
Conj(Box<IntervalConstraint>, Box<IntervalConstraint>),
Disj(Box<IntervalConstraint>, Box<IntervalConstraint>),
SingleVarIntervalConstr(Variable, Vec<Interval>),
MultiVarIntervalConstr(WeightedSum<Variable>, Vec<Interval>),
}Expand description
Interval guard constraining the interval of evaluation of a variable or a sum of variables
Variants§
True
Guard is always enabled
False
Guard is always disabled
Conj(Box<IntervalConstraint>, Box<IntervalConstraint>)
Conjunction of interval guard
Disj(Box<IntervalConstraint>, Box<IntervalConstraint>)
Disjunction of interval guard
SingleVarIntervalConstr(Variable, Vec<Interval>)
Interval guard over a single variable
The guard is enabled if the variable is in one of the intervals.
MultiVarIntervalConstr(WeightedSum<Variable>, Vec<Interval>)
Interval guard over a sum of variables
The guard is enabled if the sum of variables is in one of the intervals.
Implementations§
Source§impl IntervalConstraint
impl IntervalConstraint
Sourcepub fn is_enabled(
&self,
state: &IntervalState<Variable>,
) -> Result<bool, IntervalOrderError<Variable>>
pub fn is_enabled( &self, state: &IntervalState<Variable>, ) -> Result<bool, IntervalOrderError<Variable>>
Check if the guard is enabled in the given state
Sourcepub(crate) fn from_lia_constr<S: IntervalOrderFor<Variable> + IntervalOrderFor<WeightedSum<Variable>>>(
guard: &LIAVariableConstraint,
order: &S,
) -> Result<Self, IntervalConstraintConstructionError>
pub(crate) fn from_lia_constr<S: IntervalOrderFor<Variable> + IntervalOrderFor<WeightedSum<Variable>>>( guard: &LIAVariableConstraint, order: &S, ) -> Result<Self, IntervalConstraintConstructionError>
Derive an interval guard from a guard of a linear integer arithmetic guard under the current interval order
Sourcepub(crate) fn get_enabled_intervals<'a>(
&'a self,
var: &Variable,
intervals_of_var: Vec<&'a Interval>,
) -> Vec<&'a Interval>
pub(crate) fn get_enabled_intervals<'a>( &'a self, var: &Variable, intervals_of_var: Vec<&'a Interval>, ) -> Vec<&'a Interval>
Get the the set of intervals for which the constraint self is
satisfied for variable var
This function requires intervals_of_var to be the set of all intervals
for var in the automaton. (Which can be obtained from the interval
order)
Trait Implementations§
Source§impl Clone for IntervalConstraint
impl Clone for IntervalConstraint
Source§fn clone(&self) -> IntervalConstraint
fn clone(&self) -> IntervalConstraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntervalConstraint
impl Debug for IntervalConstraint
Source§impl Display for IntervalConstraint
impl Display for IntervalConstraint
Source§impl Hash for IntervalConstraint
impl Hash for IntervalConstraint
Source§impl Ord for IntervalConstraint
impl Ord for IntervalConstraint
Source§fn cmp(&self, other: &IntervalConstraint) -> Ordering
fn cmp(&self, other: &IntervalConstraint) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for IntervalConstraint
impl PartialEq for IntervalConstraint
Source§impl PartialOrd for IntervalConstraint
impl PartialOrd for IntervalConstraint
Source§impl VariableConstraint for IntervalConstraint
impl VariableConstraint for IntervalConstraint
Source§fn as_boolean_expr(&self) -> BooleanExpression<Variable>
fn as_boolean_expr(&self) -> BooleanExpression<Variable>
impl Eq for IntervalConstraint
impl StructuralPartialEq for IntervalConstraint
Auto Trait Implementations§
impl Freeze for IntervalConstraint
impl RefUnwindSafe for IntervalConstraint
impl Send for IntervalConstraint
impl Sync for IntervalConstraint
impl Unpin for IntervalConstraint
impl UnwindSafe for IntervalConstraint
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> 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>
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