Module variables

Module variables 

Source
Expand description

Contains the variables which are used by the [Solver].

A variable, in the context of the solver, is a view onto a domain. It may forward domain information unaltered, or apply transformations which can be performed without the need of constraints.

We define 2 types of variables:

  • Integer Variables (IntegerVariable) - These are represented by DomainIds when interacting with the [Solver]. These variables can be created using [Solver::new_bounded_integer] when creating a variable with the domain between a lower-bound and an upper-bound or using [Solver::new_sparse_integer] when creating a variable with holes in the domain. These variables can be transformed (according to the trait TransformableVariable) to create an AffineView.
  • Literals (Literal) - These specify booleans that can be used when interacting with the [Solver]. A Literal can be created using [Solver::new_literal].

Structs§

AffineView
Models the constraint y = ax + b, by expressing the domain of y as a transformation of the domain of x.
DomainId
A structure which represents the most basic IntegerVariable; it is simply the id which links to a domain (hence the name).
Literal

Traits§

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