Constraints
SeaPearl.Absolute
— TypeAbsolute(x::SeaPearl.AbstractIntVar, y::SeaPearl.AbstractIntVar, ::SeaPearl.Trailer)
Absolute value constraint, enforcing y = |x|.
SeaPearl.AllDifferent
— TypeAllDifferent(x::Array{<:AbstractIntVar}, trailer::SeaPearl.Trailer)
AllDifferent constraint, enforcing ∀ i ≠ j ∈ ⟦1, length(x)⟧, x[i] ≠ x[j].
The implementation of this contraint is inspired by: https://www.researchgate.net/publication/200034395AFilteringAlgorithmforConstraintsofDifferencein_CSPs Many of the functions below relate to algorithms depicted in the paper, and their documentation refer to parts of the overall algorithm.
SeaPearl.AllEqual
— TypeAllEqual(x::Array{<:AbstractIntVar}, trailer::SeaPearl.Trailer)
Equality constraint between array variables, stating that x[1] == x[2] == ... == x[n]
.
SeaPearl.BinaryEquivalence
— TypeBinaryEquivalence(x::BoolVar, y::BoolVar, trailer::SeaPearl.Trailer)
Binary equivalence constraint, states that x <=> y
.
SeaPearl.BinaryImplication
— TypeBinaryImplication(x::BoolVar, y::BoolVar, trailer::SeaPearl.Trailer)
Binary implication constraint, states that x => y
.
SeaPearl.BinaryMaximumBC
— TypeBinaryMaximum(x::AbstractIntVar, y::AbstractIntVar, z::AbstractIntVar, trailer::SeaPearl.Trailer)
BinaryMaximum constraint, states that x == max(y, z)
SeaPearl.BinaryOr
— TypeBinaryOr(x::BoolVar, y::BoolVar, trailer::SeaPearl.Trailer)
Binary Or constraint, states that x || y
.
SeaPearl.BinaryXor
— TypeBinaryXor(x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)
Binary Xor constraint, states that x ⊻ y
.
SeaPearl.TableConstraint
— TypeTableConstraint
Efficient implentation of the constraint enforcing: ∃ j ∈ ⟦1,m⟧, such that ∀ i ∈ ⟦1,n⟧ xᵢ=table[i,j].
The datastructure and the functions using it are inspired by: Demeulenaere J. et al. (2016) Compact-Table: Efficiently Filtering Table Constraints with Reversible Sparse Bit-Sets. In: Rueher M. (eds) Principles and Practice of Constraint Programming. CP 2016. Lecture Notes in Computer Science, vol 9892. Springer, Cham. https://doi.org/10.1007/978-3-319-44953-1_14
TableConstraint(scope, active, table, currentTable, modifiedVariables, unfixedVariables, supports, residues)
TableConstraint default constructor.
Arguments
scope::Vector{<:AbstractIntVar}
: the ordered variables present in the table.table::Matrix{Int}
: the original table describing the constraint (impossible assignment are filtered).currentTable::RSparseBitSet{UInt64}
: the reversible representation of the table.modifiedVariables::Vector{Int}
: vector with the indexes of the variables modified since the last propagation.unfixedVariables::Vector{Int}
: vector with the indexes of the variables which are not binding.supports::Dict{Pair{Int,Int},BitVector}
: dictionnary which, for each pair (variable => value), gives the support of this pair.residues::Dict{Pair{Int,Int},Int}
: dictionnary which, for each pair (variable => value), gives the residue of this pair.
TableConstraint(variables, table, supports, trailer)
Create a CompactTable constraint from the variables
, with values given in table
and supports given in supports
.
This constructor gives full control on both table
and supports
. The attributes are not duplicated and remains linked to the variables given to the constructor. It should be used only to avoid duplication of table
when using the same table constraint many times with different variables. WARNING: all variables must have the same domain; table
and supports
must be cleaned.
Arguments
variables::Vector{<:AbstractIntVar}
: vector of variables of size (n, ).table::Matrix{Int}
: matrix of the constraint of size (n, m).supports::Dict{Pair{Int,Int},BitVector}
: for each assignment, a list of the tuples supporting this assignment.trailer::Trailer
: the trailer of the model.
SeaPearl.NegativeTableConstraint
— TypeNegativeTableConstraint
Efficient implentation of the constraint enforcing: ∀ j ∈ ⟦1,m⟧, such that ∀ i ∈ ⟦1,n⟧ xᵢ!=table[i,j].
The datastructure and the functions using it are inspired by:
- Demeulenaere J. et al. (2016) Compact-Table: Efficiently Filtering Table Constraints with Reversible Sparse Bit-Sets.
In: Rueher M. (eds) Principles and Practice of Constraint Programming. CP 2016. Lecture Notes in Computer Science, vol 9892. Springer, Cham. https://doi.org/10.1007/978-3-319-44953-1_14
- Hélène Verhaeghe and Christophe Lecoutre and Pierre Schaus : Extending Compact-Table to Negative and Short Tables
NegativeTableConstraint(scope, active, table, currentTable, modifiedVariables, unfixedVariables, supports, residues)
NegativeTableConstraint default constructor.
Arguments
scope::Vector{<:AbstractIntVar}
: the ordered variables present in the table.table::Matrix{Int}
: the original table describing the constraint (impossible assignment are filtered).currentTable::RSparseBitSet{UInt64}
: the reversible representation of the table.modifiedVariables::Vector{Int}
: vector with the indexes of the variables modified since the last propagation.unfixedVariables::Vector{Int}
: vector with the indexes of the variables which are not binding.conflicts::Dict{Pair{Int,Int},BitVector}
: dictionnary which, for each pair (variable => value), gives the support of this pair.residues::Dict{Pair{Int,Int},Int}
: dictionnary which, for each pair (variable => value), gives the residue of this pair.
NegativeTableConstraint(variables, table, conflicts, trailer)
Create a CompactNegativeTable constraint from the variables
, with impossible values given in table
and conflicts given in conflicts
.
This constructor gives full control on both table
and conflicts
. The attributes are not duplicated and remains linked to the variables given to the constructor. It should be used only to avoid duplication of table
when using the same table constraint many times with different variables. WARNING: all variables must have the same domain; table
and conflicts
must be cleaned.
Arguments
variables::Vector{<:AbstractIntVar}
: vector of variables of size (n, ).table::Matrix{Int}
: matrix of the constraint of size (n, m).conflicts::Dict{Pair{Int,Int},BitVector}
: for each assignment, a list of the tuples supporting this assignment.trailer::Trailer
: the trailer of the model.
SeaPearl.ShortTableConstraint
— TypeShortTableConstraint
Efficient implentation of the constraint enforcing: ∃ j ∈ ⟦1,m⟧, such that ∀ i ∈ ⟦1,n⟧ xᵢ=table[i,j].
The datastructure and the functions using it are inspired by: Demeulenaere J. et al. (2016) Compact-Table: Efficiently Filtering Table Constraints with Reversible Sparse Bit-Sets. In: Rueher M. (eds) Principles and Practice of Constraint Programming. CP 2016. Lecture Notes in Computer Science, vol 9892. Springer, Cham. https://doi.org/10.1007/978-3-319-44953-1_14
ShortTableConstraint(scope, active, table, currentTable, modifiedVariables, unfixedVariables, supports, residues)
ShortTableConstraint default constructor.
Arguments
scope::Vector{<:AbstractIntVar}
: the ordered variables present in the table.table::Matrix{Any}
: the original table describing the constraint (impossible assignment are filtered).currentTable::RSparseBitSet{UInt64}
: the reversible representation of the table.modifiedVariables::Vector{Int}
: vector with the indexes of the variables modified since the last propagation.unfixedVariables::Vector{Int}
: vector with the indexes of the variables which are not binding.supports::Dict{Pair{Int,Int},BitVector}
: dictionnary which, for each pair (variable => value), gives the support of this pair.residues::Dict{Pair{Int,Int},Int}
: dictionnary which, for each pair (variable => value), gives the residue of this pair.
ShortTableConstraint(variables, table, supports, trailer)
Create a CompactTable constraint from the variables
, with values given in table
and supports given in supports
.
This constructor gives full control on both table
and supports
. The attributes are not duplicated and remains linked to the variables given to the constructor. It should be used only to avoid duplication of table
when using the same table constraint many times with different variables. WARNING: all variables must have the same domain; table
and supports
must be cleaned.
Arguments
variables::Vector{<:AbstractIntVar}
: vector of variables of size (n, ).table::Matrix{Any}
: matrix of the constraint of size (n, m).supports::Dict{Pair{Int,Int},BitVector}
: for each assignment, a list of the tuples supporting this assignment or supporting all value of the variable (aka * fields).supportsStar::Dict{Pair{Int,Int},BitVector}
: for each assignment, a list of the tuples supporting this assignment, * field not taken in account as they still stay valid when a value is removed.trailer::Trailer
: the trailer of the model.
SeaPearl.Disjunctive
— TypeDisjunctive(earliestStartingTime::Array{<:AbstractIntVar}, processingTime::Array{Int}, trailer, filteringAlgorithm::Array{filteringAlgorithmTypes} = [algoTimeTabling])::Disjunctive
Constraint that insure that no task are executed in the same time range.
SeaPearl.Element2D
— TypeElement2D(matrix::Array{Int, 2}, x::AbstractIntVar, y::AbstractIntVar, z::AbstractIntVar, SeaPearl.trailer)
Element2D constraint, states that matrix[x, y] == z
Missing docstring for SeaPearl.Element1D
. Check Documenter's build log for details.
Missing docstring for SeaPearl.Element1DVar
. Check Documenter's build log for details.
SeaPearl.EqualConstant
— TypeEqualConstant(x::SeaPearl.AbstractIntVar, v::Int, SeaPearl.trailer)
Equality constraint, putting a constant value v
for the variable x
i.e. x == v
.
SeaPearl.GreaterOrEqualConstant
— TypeGreaterOrEqualConstant(x::SeaPearl.AbstractIntVar, v::Int)
Inequality constraint, x >= v
SeaPearl.InSet
— TypeInSet(x::AbstractIntVar, s::IntSetVar, trailer::SeaPearl.Trailer)
InSet constraint, states that x ∈ s
SeaPearl.IntervalConstant
— TypeIntervalConstant(x::SeaPearl.IntVar, lower::Int, upper::Int, trailer::SeaPearl.Trailer)
Inequality constraint, lower <= x <= upper
SeaPearl.isBinaryAnd
— TypeisBinaryAnd(b::AbstractBoolVar, x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)
Is And constraint, states that b <=> x and y
.
SeaPearl.isBinaryOr
— TypeisBinaryOr(b::AbstractBoolVar, x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)
Is Or constraint, states that b <=> x or y
.
SeaPearl.isBinaryXor
— TypeisBinaryXor(b::AbstractBoolVar, x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)
Is Xor constraint, states that b <=> x ⊻ y
.
SeaPearl.isLessOrEqual
— TypeisLessOrEqual(b::AbstractBoolVar, x::AbstractIntVar, y::AbstractIntVar, trailer::SeaPearl.Trailer)
Equivalence between a boolean variable and the inequality between variables, states that b ⟺ x ≤ y
SeaPearl.LessOrEqualConstant
— TypeLessOrEqualConstant(x::SeaPearl.AbstractIntVar, v::Int, trailer::SeaPearl.Trailer)
Inequality constraint, x <= v
SeaPearl.LessOrEqual
— TypeLessOrEqual(x::AbstractIntVar, y::AbstractIntVar, trailer::Trailer)
Inequality between variables constraint, states that x <= y
SeaPearl.MaximumConstraint
— TypeMaximumConstraint(x::Array{<:AbstractIntVar},y::AbstractIntVar, trailer::SeaPearl.Trailer) <: Constraint
Maximum constraint, states that y = max(x)
SeaPearl.NotEqualConstant
— TypeNotEqualConstant(x::SeaPearl.IntVar, v::Int)
Inequality constraint, x != v
SeaPearl.NotEqual
— TypeNotEqual(x::SeaPearl.IntVar, y::SeaPearl.IntVar)
Inequality constraint between two variables, stating that x != y
.
Missing docstring for SeaPearl.NValues
. Check Documenter's build log for details.
SeaPearl.ReifiedInSet
— TypeReifiedInSet(x::AbstractIntVar, s::IntSetVar, b::BoolVar, trailer::Trailer)
ReifiedInSet contrainst, states that b ⟺ x ∈ s
SeaPearl.SetDiffSingleton
— TypeSetDiffSingleton(a::IntSetVar, b::IntSetVar, x::AbstractIntVar, trailer::Trailer)
SetDiffSingleton constraint, states that a = b - {x}
SeaPearl.SetEqualConstant
— TypeSetEqualConstant(s::IntSetVar, c::Set{Int}, trailer::Trailer)
SetEqualConstant constraint, states that s == c
SeaPearl.SumGreaterThan
— TypeSumGreaterThan(x<:AbstractIntVar, v::Int)
Summing constraint, states that x[1] + x[2] + ... + x[length(x)] >= lower
SeaPearl.SumLessThan
— TypeSumLessThan(x<:AbstractIntVar, v::Int)
Summing constraint, states that x[1] + x[2] + ... + x[length(x)] <= v
SeaPearl.SumToZero
— TypeSumToZero(x<:AbstractIntVar, v::Int)
Summing constraint, states that x[1] + x[2] + ... + x[length(x)] == 0
Missing docstring for SeaPearl.Addition
. Check Documenter's build log for details.