pub struct Equal { /* private fields */ }Expand description
Constraint enforcing v1 = v2 + offset.
Implementations§
Source§impl Equal
impl Equal
Sourcepub fn new(v1: VariableId, v2: VariableId, offset: i64) -> Self
pub fn new(v1: VariableId, v2: VariableId, offset: i64) -> Self
Trait Implementations§
Source§impl Constraint for Equal
impl Constraint for Equal
Source§fn scope(&self) -> &[VariableId]
fn scope(&self) -> &[VariableId]
Returns the slice of variable IDs involved in this constraint. Read more
Source§fn is_satisfied(&self, assignment: &HashMap<VariableId, i64>) -> bool
fn is_satisfied(&self, assignment: &HashMap<VariableId, i64>) -> bool
Evaluates if the constraint is satisfied under a complete or partial variable assignment. Read more
Source§fn propagate(&self, domains: &mut TrailedDomains) -> PropagationResult
fn propagate(&self, domains: &mut TrailedDomains) -> PropagationResult
Enforces arc/bounds consistency by pruning inconsistent values from variable domains. Read more
Source§fn violations(&self, assignment: &HashMap<VariableId, i64>) -> u32
fn violations(&self, assignment: &HashMap<VariableId, i64>) -> u32
How many ways this constraint is broken under
assignment, not merely whether it is. Read moreSource§fn explain(&self, assignment: &Assignment) -> Option<Explanation>
fn explain(&self, assignment: &Assignment) -> Option<Explanation>
Explains a concrete violation, or returns
None when the assignment does not violate
this constraint or the implementation has no specialized explanation. Read moreSource§fn validate(&self) -> Result<(), String>
fn validate(&self) -> Result<(), String>
Validates the constraint’s own parameters independent of any assignment or domain state. Read more
Source§fn is_satisfiable(
&self,
domains: &HashMap<VariableId, Domain>,
assignment: &HashMap<VariableId, i64>,
) -> bool
fn is_satisfiable( &self, domains: &HashMap<VariableId, Domain>, assignment: &HashMap<VariableId, i64>, ) -> bool
Returns
false only if this constraint can provably never be satisfied by any
completion consistent with the current domains, regardless of how the as-yet-unassigned
variables in its scope are eventually assigned. Read moreAuto Trait Implementations§
impl Freeze for Equal
impl RefUnwindSafe for Equal
impl Send for Equal
impl Sync for Equal
impl Unpin for Equal
impl UnsafeUnpin for Equal
impl UnwindSafe for Equal
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