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 byDomainIds 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 traitTransformableVariable) to create anAffineView. - Literals (
Literal) - These specify booleans that can be used when interacting with the [Solver]. ALiteralcan be created using [Solver::new_literal].
Structs§
- Affine
View - Models the constraint
y = ax + b, by expressing the domain ofyas a transformation of the domain ofx. - Domain
Id - A structure which represents the most basic
IntegerVariable; it is simply the id which links to a domain (hence the name). - Literal
Traits§
- Integer
Variable - A trait specifying the required behaviour of an integer variable such as retrieving a
lower-bound (
IntegerVariable::lower_bound). - Transformable
Variable - Trait for transforming a variable.