Constraints

SeaPearl.AbsoluteType
Absolute(x::SeaPearl.AbstractIntVar, y::SeaPearl.AbstractIntVar, ::SeaPearl.Trailer)

Absolute value constraint, enforcing y = |x|.

source
SeaPearl.AllDifferentType
AllDifferent(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.

source
SeaPearl.AllEqualType
AllEqual(x::Array{<:AbstractIntVar}, trailer::SeaPearl.Trailer)

Equality constraint between array variables, stating that x[1] == x[2] == ... == x[n].

source
SeaPearl.BinaryEquivalenceType
BinaryEquivalence(x::BoolVar, y::BoolVar, trailer::SeaPearl.Trailer)

Binary equivalence constraint, states that x <=> y.

source
SeaPearl.BinaryMaximumBCType
BinaryMaximum(x::AbstractIntVar, y::AbstractIntVar, z::AbstractIntVar, trailer::SeaPearl.Trailer)

BinaryMaximum constraint, states that x == max(y, z)

source
SeaPearl.BinaryOrType
BinaryOr(x::BoolVar, y::BoolVar, trailer::SeaPearl.Trailer)

Binary Or constraint, states that x || y.

source
SeaPearl.BinaryXorType
BinaryXor(x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)

Binary Xor constraint, states that x ⊻ y.

source
SeaPearl.TableConstraintType
TableConstraint

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.
source
SeaPearl.NegativeTableConstraintType
NegativeTableConstraint

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.
source
SeaPearl.ShortTableConstraintType
ShortTableConstraint

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.
source
SeaPearl.DisjunctiveType

Disjunctive(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.

source
SeaPearl.Element2DType
Element2D(matrix::Array{Int, 2}, x::AbstractIntVar, y::AbstractIntVar, z::AbstractIntVar, SeaPearl.trailer)

Element2D constraint, states that matrix[x, y] == z

source
Missing docstring.

Missing docstring for SeaPearl.Element1D. Check Documenter's build log for details.

Missing docstring.

Missing docstring for SeaPearl.Element1DVar. Check Documenter's build log for details.

SeaPearl.EqualConstantType
EqualConstant(x::SeaPearl.AbstractIntVar, v::Int, SeaPearl.trailer)

Equality constraint, putting a constant value v for the variable x i.e. x == v.

source
SeaPearl.InSetType
InSet(x::AbstractIntVar, s::IntSetVar, trailer::SeaPearl.Trailer)

InSet constraint, states that x ∈ s

source
SeaPearl.IntervalConstantType
IntervalConstant(x::SeaPearl.IntVar, lower::Int, upper::Int, trailer::SeaPearl.Trailer)

Inequality constraint, lower <= x <= upper

source
SeaPearl.isBinaryAndType
isBinaryAnd(b::AbstractBoolVar, x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)

Is And constraint, states that b <=> x and y.

source
SeaPearl.isBinaryOrType
isBinaryOr(b::AbstractBoolVar, x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)

Is Or constraint, states that b <=> x or y.

source
SeaPearl.isBinaryXorType
isBinaryXor(b::AbstractBoolVar, x::AbstractBoolVar, y::AbstractBoolVar, trailer::SeaPearl.Trailer)

Is Xor constraint, states that b <=> x ⊻ y.

source
SeaPearl.isLessOrEqualType

isLessOrEqual(b::AbstractBoolVar, x::AbstractIntVar, y::AbstractIntVar, trailer::SeaPearl.Trailer)

Equivalence between a boolean variable and the inequality between variables, states that b ⟺ x ≤ y

source
SeaPearl.LessOrEqualType
LessOrEqual(x::AbstractIntVar, y::AbstractIntVar, trailer::Trailer)

Inequality between variables constraint, states that x <= y

source
SeaPearl.MaximumConstraintType
MaximumConstraint(x::Array{<:AbstractIntVar},y::AbstractIntVar, trailer::SeaPearl.Trailer) <: Constraint

Maximum constraint, states that y = max(x)

source
SeaPearl.NotEqualType
NotEqual(x::SeaPearl.IntVar, y::SeaPearl.IntVar)

Inequality constraint between two variables, stating that x != y.

source
Missing docstring.

Missing docstring for SeaPearl.NValues. Check Documenter's build log for details.

SeaPearl.ReifiedInSetType
ReifiedInSet(x::AbstractIntVar, s::IntSetVar, b::BoolVar, trailer::Trailer)

ReifiedInSet contrainst, states that b ⟺ x ∈ s

source
SeaPearl.SetDiffSingletonType
SetDiffSingleton(a::IntSetVar, b::IntSetVar, x::AbstractIntVar, trailer::Trailer)

SetDiffSingleton constraint, states that a = b - {x}

source
SeaPearl.SumGreaterThanType
SumGreaterThan(x<:AbstractIntVar, v::Int)

Summing constraint, states that x[1] + x[2] + ... + x[length(x)] >= lower

source
SeaPearl.SumLessThanType
SumLessThan(x<:AbstractIntVar, v::Int)

Summing constraint, states that x[1] + x[2] + ... + x[length(x)] <= v

source
SeaPearl.SumToZeroType
SumToZero(x<:AbstractIntVar, v::Int)

Summing constraint, states that x[1] + x[2] + ... + x[length(x)] == 0

source
Missing docstring.

Missing docstring for SeaPearl.Addition. Check Documenter's build log for details.