IntegerVariable

Trait IntegerVariable 

Source
pub trait IntegerVariable:
    Clone
    + PredicateConstructor<Value = i32>
    + TransformableVariable<Self::AffineView>
    + Debug {
    type AffineView: IntegerVariable;

    // Required methods
    fn lower_bound(&self, assignment: &Assignments) -> i32;
    fn lower_bound_at_trail_position(
        &self,
        assignment: &Assignments,
        trail_position: usize,
    ) -> i32;
    fn upper_bound(&self, assignment: &Assignments) -> i32;
    fn upper_bound_at_trail_position(
        &self,
        assignment: &Assignments,
        trail_position: usize,
    ) -> i32;
    fn contains(&self, assignment: &Assignments, value: i32) -> bool;
    fn contains_at_trail_position(
        &self,
        assignment: &Assignments,
        value: i32,
        trail_position: usize,
    ) -> bool;
    fn iterate_domain(
        &self,
        assignment: &Assignments,
    ) -> impl Iterator<Item = i32>;
    fn watch_all(
        &self,
        watchers: &mut Watchers<'_>,
        events: EnumSet<DomainEvent>,
    );
    fn watch_all_backtrack(
        &self,
        watchers: &mut Watchers<'_>,
        events: EnumSet<DomainEvent>,
    );
    fn unpack_event(&self, event: OpaqueDomainEvent) -> DomainEvent;
    fn get_holes_on_current_decision_level(
        &self,
        assignments: &Assignments,
    ) -> impl Iterator<Item = i32>;
    fn get_holes(&self, assignments: &Assignments) -> impl Iterator<Item = i32>;
}
Expand description

A trait specifying the required behaviour of an integer variable such as retrieving a lower-bound (IntegerVariable::lower_bound).

Required Associated Types§

Required Methods§

Source

fn lower_bound(&self, assignment: &Assignments) -> i32

Get the lower bound of the variable.

Source

fn lower_bound_at_trail_position( &self, assignment: &Assignments, trail_position: usize, ) -> i32

Get the lower bound of the variable at the given trail position.

Source

fn upper_bound(&self, assignment: &Assignments) -> i32

Get the upper bound of the variable.

Source

fn upper_bound_at_trail_position( &self, assignment: &Assignments, trail_position: usize, ) -> i32

Get the upper bound of the variable at the given trail position.

Source

fn contains(&self, assignment: &Assignments, value: i32) -> bool

Determine whether the value is in the domain of this variable.

Source

fn contains_at_trail_position( &self, assignment: &Assignments, value: i32, trail_position: usize, ) -> bool

Determine whether the value is in the domain of this variable at the given trail position.

Source

fn iterate_domain(&self, assignment: &Assignments) -> impl Iterator<Item = i32>

Iterate over the values of the domain.

Source

fn watch_all(&self, watchers: &mut Watchers<'_>, events: EnumSet<DomainEvent>)

Register a watch for this variable on the given domain events.

Source

fn watch_all_backtrack( &self, watchers: &mut Watchers<'_>, events: EnumSet<DomainEvent>, )

Source

fn unpack_event(&self, event: OpaqueDomainEvent) -> DomainEvent

Decode a domain event for this variable.

Source

fn get_holes_on_current_decision_level( &self, assignments: &Assignments, ) -> impl Iterator<Item = i32>

Returns all of the holes in the domain which were created at the current decision level

Source

fn get_holes(&self, assignments: &Assignments) -> impl Iterator<Item = i32>

Returns all of the holes in the domain

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§