public interface IIntConstraintFactory extends ISelf<Model>
Modifier and Type | Method and Description |
---|---|
default Constraint |
absolute(IntVar var1,
IntVar var2)
Creates an absolute value constraint: var1 = |var2|
|
default Constraint |
allDifferent(IntVar... vars)
Creates an allDifferent constraint.
|
default Constraint |
allDifferent(IntVar[] vars,
String CONSISTENCY)
Creates an allDifferent constraint.
|
default Constraint |
allDifferentExcept0(IntVar[] vars)
Creates an allDifferent constraint for variables that are not equal to 0.
|
default Constraint |
allDifferentUnderCondition(IntVar[] vars,
Condition condition,
boolean singleCondition)
Creates an allDifferent constraint subject to the given condition.
|
default Constraint |
allEqual(IntVar... vars)
Creates an allEqual constraint.
|
default Constraint |
among(IntVar nbVar,
IntVar[] vars,
int[] values)
Creates an among constraint.
|
default Constraint |
and(BoolVar... bools)
Creates an and constraint that is satisfied if all boolean variables in bools are true
|
default Constraint |
and(Constraint... cstrs)
Creates an and constraint that is satisfied if all constraints in cstrs are satisfied
BEWARE: this should not be used to post several constraints at once but in a reification context
|
default Constraint |
arithm(IntVar var,
String op,
int cste)
Creates an arithmetic constraint : var op cste,
where op in {"=", "!=", ">","<",">=","<="}
|
default Constraint |
arithm(IntVar var1,
String op,
IntVar var2)
Creates an arithmetic constraint: var1 op var2,
where op in {"=", "!=", ">","<",">=","<="}
|
default Constraint |
arithm(IntVar var1,
String op1,
IntVar var2,
String op2,
int cste)
Creates an arithmetic constraint : var1 op var2,
where op in {"=", "!=", ">","<",">=","<="} or {"+", "-", "*", "/"}
|
default Constraint |
arithm(IntVar var1,
String op1,
IntVar var2,
String op2,
IntVar var3)
Creates an arithmetic constraint: var1 op1 var2 op2 var3,
where op1 and op2 in {"=", "!=", ">","<",">=","<="} or {"+", "-", "*", "/"}
|
default Constraint |
atLeastNValues(IntVar[] vars,
IntVar nValues,
boolean AC)
Creates an atLeastNValue constraint.
|
default Constraint |
atMostNValues(IntVar[] vars,
IntVar nValues,
boolean STRONG)
Creates an atMostNValue constraint.
|
default Constraint |
binPacking(IntVar[] itemBin,
int[] itemSize,
IntVar[] binLoad,
int offset)
Creates a BinPacking constraint.
|
default Constraint |
bitsIntChanneling(BoolVar[] bits,
IntVar var)
Creates an channeling constraint between an integer variable and a set of bit variables.
|
default Constraint |
boolsIntChanneling(BoolVar[] bVars,
IntVar var,
int offset)
Creates an channeling constraint between an integer variable and a set of boolean variables.
|
default Constraint |
circuit(IntVar[] vars)
Creates a circuit constraint which ensures that
the elements of vars define a covering circuit
where vars[i] = offset+j means that j is the successor of i.
|
default Constraint |
circuit(IntVar[] vars,
int offset)
Creates a circuit constraint which ensures that
the elements of vars define a covering circuit
where vars[i] = offset+j means that j is the successor of i.
|
default Constraint |
circuit(IntVar[] vars,
int offset,
CircuitConf conf)
Creates a circuit constraint which ensures that
the elements of vars define a covering circuit
where vars[i] = offset+j means that j is the successor of i.
|
default Constraint |
clausesIntChanneling(IntVar var,
BoolVar[] eVars,
BoolVar[] lVars)
Creates an channeling constraint between an integer variable and a set of clauses.
|
default Constraint |
costRegular(IntVar[] vars,
IntVar cost,
ICostAutomaton costAutomaton)
Creates a regular constraint that supports a cost function.
|
default Constraint |
count(int value,
IntVar[] vars,
IntVar limit)
Creates a count constraint.
|
default Constraint |
count(IntVar value,
IntVar[] vars,
IntVar limit)
Creates a count constraint.
|
default Constraint |
cumulative(Task[] tasks,
IntVar[] heights,
IntVar capacity)
Creates a cumulative constraint: Enforces that at each point in time,
the cumulated height of the set of tasks that overlap that point
does not exceed a given limit.
|
default Constraint |
cumulative(Task[] tasks,
IntVar[] heights,
IntVar capacity,
boolean incremental)
Creates a cumulative constraint: Enforces that at each point in time,
the cumulated height of the set of tasks that overlap that point
does not exceed a given limit.
|
default Constraint |
cumulative(Task[] tasks,
IntVar[] heights,
IntVar capacity,
boolean incremental,
Cumulative.Filter... filters)
Creates a cumulative constraint: Enforces that at each point in time,
the cumulated height of the set of tasks that overlap that point
does not exceed a given limit.
|
default Constraint |
cumulative(Task[] tasks,
IntVar[] heights,
IntVar capacity,
boolean incremental,
CumulFilter... filters)
Creates a cumulative constraint: Enforces that at each point in time,
the cumulated height of the set of tasks that overlap that point
does not exceed a given limit.
|
default Constraint |
diffN(IntVar[] X,
IntVar[] Y,
IntVar[] width,
IntVar[] height,
boolean addCumulativeReasoning)
Creates a diffN constraint.
|
default Constraint |
distance(IntVar var1,
IntVar var2,
String op,
int cste)
Creates a distance constraint : |var1-var2| op cste
where op can take its value among {"=", ">", "<", "!="} |
default Constraint |
distance(IntVar var1,
IntVar var2,
String op,
IntVar var3)
Creates a distance constraint: |var1-var2| op var3
where op can take its value among {"=", ">", "<"} |
default Constraint |
div(IntVar dividend,
IntVar divisor,
IntVar result)
Creates an euclidean division constraint.
|
default Constraint |
element(IntVar value,
int[] table,
IntVar index)
Creates an element constraint: value = table[index]
|
default Constraint |
element(IntVar value,
int[] table,
IntVar index,
int offset)
Creates an element constraint: value = table[index-offset]
|
default Constraint |
element(IntVar value,
IntVar[] table,
IntVar index,
int offset)
Creates a element constraint: value = table[index-offset]
where table is an array of variables.
|
default int[] |
getDomainUnion(IntVar... vars)
Get the list of values in the domains of vars
|
default Constraint |
globalCardinality(IntVar[] vars,
int[] values,
IntVar[] occurrences,
boolean closed)
Creates a global cardinality constraint (GCC):
Each value values[i] should be taken by exactly occurrences[i] variables of vars.
|
default Constraint |
intValuePrecedeChain(IntVar[] X,
int[] V)
Creates an intValuePrecedeChain constraint.
|
default Constraint |
intValuePrecedeChain(IntVar[] X,
int S,
int T)
Creates an intValuePrecedeChain constraint.
|
default Constraint |
inverseChanneling(IntVar[] vars1,
IntVar[] vars2)
Creates an inverse channeling between vars1 and vars2:
vars1[i] = j <=> vars2[j] = i
Performs AC if domains are enumerated.
|
default Constraint |
inverseChanneling(IntVar[] vars1,
IntVar[] vars2,
int offset1,
int offset2)
Creates an inverse channeling between vars1 and vars2:
vars1[i-offset2] = j <=> vars2[j-offset1] = i
Performs AC if domains are enumerated.
|
default Constraint |
keySort(IntVar[][] vars,
IntVar[] PERMvars,
IntVar[][] SORTEDvars,
int K)
Creates a keySort constraint which ensures that the variables of SORTEDvars correspond to the variables
of vars according to a permutation stored in PERMvars (optional, can be null).
|
default Constraint |
knapsack(IntVar[] occurrences,
IntVar weightSum,
IntVar energySum,
int[] weight,
int[] energy)
Creates a knapsack constraint.
|
default Constraint |
lexChainLess(IntVar[]... vars)
Creates a lexChainLess constraint.
|
default Constraint |
lexChainLessEq(IntVar[]... vars)
Creates a lexChainLessEq constraint.
|
default Constraint |
lexLess(IntVar[] vars1,
IntVar[] vars2)
Creates a lexLess constraint.
|
default Constraint |
lexLessEq(IntVar[] vars1,
IntVar[] vars2)
Creates a lexLessEq constraint.
|
default Constraint |
max(BoolVar max,
BoolVar[] vars)
Creates a maximum constraint.
|
default Constraint |
max(IntVar max,
IntVar[] vars)
Creates a maximum constraint.
|
default Constraint |
max(IntVar max,
IntVar var1,
IntVar var2)
Creates a maximum constraint : max = max(var1, var2)
(Bound Consistency)
|
default Constraint |
mddc(IntVar[] vars,
MultivaluedDecisionDiagram MDD)
Create a constraint where solutions (tuples) are encoded by a multi-valued decision diagram.
|
default Constraint |
member(IntVar var,
int[] table)
Creates a member constraint.
|
default Constraint |
member(IntVar var,
int lb,
int ub)
Creates a member constraint.
|
default Constraint |
min(BoolVar min,
BoolVar[] vars)
Creates a minimum constraint.
|
default Constraint |
min(IntVar min,
IntVar[] vars)
Creates a minimum constraint.
|
default Constraint |
min(IntVar min,
IntVar var1,
IntVar var2)
Creates a minimum constraint: min = min(var1, var2)
(Bound Consistency)
|
default Constraint |
mod(IntVar X,
IntVar Y,
IntVar Z)
Creates a modulo constraint.
|
default Constraint |
multiCostRegular(IntVar[] vars,
IntVar[] costVars,
ICostAutomaton costAutomaton)
Creates a regular constraint that supports a multiple cost function.
|
default Constraint |
multiCostRegular(IntVar[] vars,
IntVar[] costVars,
ICostAutomaton costAutomaton,
double precision)
Creates a regular constraint that supports a multiple cost function.
|
default Constraint |
not(Constraint cstr)
Gets the opposite of a given constraint
Works for any constraint, including globals, but the associated performances might be weak
|
default Constraint |
notAllEqual(IntVar... vars)
Creates an allEqual constraint.
|
default Constraint |
notMember(IntVar var,
int[] table)
Creates a notMember constraint.
|
default Constraint |
notMember(IntVar var,
int lb,
int ub)
Creates a notMember constraint.
|
default Constraint |
nValues(IntVar[] vars,
IntVar nValues)
Creates an nValue constraint.
|
default Constraint |
or(BoolVar... bools)
Creates an and constraint that is satisfied if at least one boolean variables in bools is true
|
default Constraint |
or(Constraint... cstrs)
Creates an and constraint that is satisfied if at least one constraint in cstrs are satisfied
|
default Constraint |
path(IntVar[] vars,
IntVar start,
IntVar end)
Creates a path constraint which ensures that
the elements of vars define a covering path from start to end
where vars[i] = j means that j is the successor of i.
|
default Constraint |
path(IntVar[] vars,
IntVar start,
IntVar end,
int offset)
Creates a path constraint which ensures that
the elements of vars define a covering path from start to end
where vars[i] = offset+j means that j is the successor of i.
|
default Constraint |
regular(IntVar[] vars,
IAutomaton automaton)
Creates a regular constraint.
|
default Constraint |
scalar(IntVar[] vars,
int[] coeffs,
String operator,
int scalar)
Creates a scalar constraint which ensures that Sum(vars[i]*coeffs[i]) operator scalar
|
default Constraint |
scalar(IntVar[] vars,
int[] coeffs,
String operator,
int scalar,
int minCardForDecomp)
Creates a scalar constraint which ensures that Sum(vars[i]*coeffs[i]) operator scalar
|
default Constraint |
scalar(IntVar[] vars,
int[] coeffs,
String operator,
IntVar scalar)
Creates a scalar constraint which ensures that Sum(vars[i]*coeffs[i]) operator scalar
|
default Constraint |
scalar(IntVar[] vars,
int[] coeffs,
String operator,
IntVar scalar,
int minCardForDecomp)
Creates a scalar constraint which ensures that Sum(vars[i]*coeffs[i]) operator scalar
|
default Constraint |
sort(IntVar[] vars,
IntVar[] sortedVars)
Creates a sort constraint which ensures that the variables of sortedVars correspond to the variables
of vars according to a permutation.
|
default Constraint |
square(IntVar var1,
IntVar var2)
Creates a square constraint: var1 = var2^2
|
default Constraint |
subCircuit(IntVar[] vars,
int offset,
IntVar subCircuitLength)
Creates a subCircuit constraint which ensures that
the elements of vars define a single circuit of subcircuitSize nodes where
vars[i] = offset+j means that j is the successor of i.
|
default Constraint |
subPath(IntVar[] vars,
IntVar start,
IntVar end,
int offset,
IntVar SIZE)
Creates a subPath constraint which ensures that
the elements of vars define a path of SIZE vertices, leading from start to end
where vars[i] = offset+j means that j is the successor of i.
|
default Constraint |
sum(BoolVar[] vars,
String operator,
int sum)
Creates a sum constraint.
|
default Constraint |
sum(BoolVar[] vars,
String operator,
IntVar sum)
Creates a sum constraint.
|
default Constraint |
sum(BoolVar[] vars,
String operator,
IntVar sum,
int minCardForDecomp)
Creates a sum constraint.
|
default Constraint |
sum(IntVar[] vars,
String operator,
int sum)
Creates a sum constraint.
|
default Constraint |
sum(IntVar[] vars,
String operator,
int sum,
int minCardForDecomp)
Creates a sum constraint.
|
default Constraint |
sum(IntVar[] vars,
String operator,
IntVar sum)
Creates a sum constraint.
|
default Constraint |
sum(IntVar[] vars,
String operator,
IntVar sum,
int minCardForDecomp)
Creates a sum constraint.
|
default Constraint |
table(IntVar[] vars,
Tuples tuples)
Creates a table constraint specifying that the sequence of variables vars must belong to the list of tuples
(or must NOT belong in case of infeasible tuples)
Default configuration with GACSTR+ algorithm for feasible tuples and GAC3rm otherwise
|
default Constraint |
table(IntVar[] vars,
Tuples tuples,
String algo)
Creates a table constraint, with the specified algorithm defined algo
|
default Constraint |
table(IntVar var1,
IntVar var2,
Tuples tuples)
Create a table constraint over a couple of variables var1 and var2
Uses AC3rm algorithm by default
|
default Constraint |
table(IntVar var1,
IntVar var2,
Tuples tuples,
String algo)
Creates a table constraint over a couple of variables var1 and var2:
- AC2001: table constraint which applies the AC2001 algorithm, - AC3: table constraint which applies the AC3 algorithm, - AC3rm: table constraint which applies the AC3 rm algorithm, - AC3bit+rm (default): table constraint which applies the AC3 bit+rm algorithm, - FC: table constraint which applies forward checking algorithm. |
default Constraint |
times(IntVar X,
int Y,
IntVar Z)
Creates a multiplication constraint: X * Y = Z
|
default Constraint |
times(IntVar X,
IntVar Y,
int Z)
Creates a multiplication constraint: X * Y = Z
|
default Constraint |
times(IntVar X,
IntVar Y,
IntVar Z)
Creates a multiplication constraint: X * Y = Z
|
default Constraint |
tree(IntVar[] succs,
IntVar nbTrees)
Creates a tree constraint.
|
default Constraint |
tree(IntVar[] succs,
IntVar nbTrees,
int offset)
Creates a tree constraint.
|
default Constraint arithm(IntVar var, String op, int cste)
var
- a variableop
- an operatorcste
- a constantdefault Constraint member(IntVar var, int[] table)
var
- an integer variabletable
- an array of valuesdefault Constraint member(IntVar var, int lb, int ub)
var
- an integer variablelb
- the lower bound of the intervalub
- the upper bound of the intervaldefault Constraint not(Constraint cstr)
cstr
- a constraintdefault Constraint notMember(IntVar var, int[] table)
var
- an integer variabletable
- an array of valuesdefault Constraint notMember(IntVar var, int lb, int ub)
var
- an integer variablelb
- the lower bound of the intervalub
- the upper bound of the intervaldefault Constraint absolute(IntVar var1, IntVar var2)
default Constraint arithm(IntVar var1, String op, IntVar var2)
var1
- first variableop
- an operatorvar2
- second variabledefault Constraint arithm(IntVar var1, String op1, IntVar var2, String op2, int cste)
var1
- first variableop1
- an operatorvar2
- second variableop2
- another operatorcste
- an operatordefault Constraint distance(IntVar var1, IntVar var2, String op, int cste)
default Constraint element(IntVar value, int[] table, IntVar index, int offset)
value
- an integer variable taking its value in tabletable
- an array of integer valuesindex
- an integer variable representing the value of value in tableoffset
- offset matching index.lb and table[0] (Generally 0)default Constraint element(IntVar value, int[] table, IntVar index)
value
- an integer variable taking its value in tabletable
- an array of integer valuesindex
- an integer variable representing the value of value in tabledefault Constraint square(IntVar var1, IntVar var2)
default Constraint table(IntVar var1, IntVar var2, Tuples tuples)
var1
- first variablevar2
- second variabledefault Constraint table(IntVar var1, IntVar var2, Tuples tuples, String algo)
var1
- first variablevar2
- second variabletuples
- the relation between the two variables, among {"AC3", "AC3rm", "AC3bit+rm", "AC2001", "FC"}default Constraint times(IntVar X, int Y, IntVar Z)
X
- first variableY
- a constantZ
- result variabledefault Constraint times(IntVar X, IntVar Y, int Z)
X
- first variableY
- second variableZ
- a constant (result)default Constraint arithm(IntVar var1, String op1, IntVar var2, String op2, IntVar var3)
var1
- first variableop1
- an operatorvar2
- second variableop2
- another operatorvar3
- third variabledefault Constraint distance(IntVar var1, IntVar var2, String op, IntVar var3)
var1
- first variablevar2
- second variableop
- an operatorvar3
- resulting variabledefault Constraint div(IntVar dividend, IntVar divisor, IntVar result)
dividend
- dividenddivisor
- divisorresult
- resultdefault Constraint max(IntVar max, IntVar var1, IntVar var2)
max
- a variablevar1
- a variablevar2
- a variabledefault Constraint min(IntVar min, IntVar var1, IntVar var2)
min
- a variablevar1
- a variablevar2
- a variabledefault Constraint mod(IntVar X, IntVar Y, IntVar Z)
X
- first variableY
- second variableZ
- resultdefault Constraint times(IntVar X, IntVar Y, IntVar Z)
X
- first variableY
- second variableZ
- result variabledefault Constraint allDifferent(IntVar... vars)
vars
- list of variablesdefault Constraint allDifferent(IntVar[] vars, String CONSISTENCY)
vars
- list of variablesCONSISTENCY
- consistency level, among {"BC", "AC"}
BC:
Based on: "A Fast and Simple Algorithm for Bounds Consistency of the AllDifferent Constraint"
A. Lopez-Ortiz, CG. Quimper, J. Tromp, P.van Beek
AC:
Uses Regin algorithm
Runs in O(m.n) worst case time for the initial propagation and then in O(n+m) on average.
DEFAULT:
Uses BC plus a probabilistic AC propagator to get a compromise between BC and AC
default Constraint allDifferentUnderCondition(IntVar[] vars, Condition condition, boolean singleCondition)
singleCondition
for all X,Y in vars, condition(X) => X != Y
ELSE
for all X,Y in vars, condition(X) AND condition(Y) => X != Yvars
- collection of variablescondition
- condition defining which variables should be constrainedsingleCondition
- specifies how to apply filteringdefault Constraint allDifferentExcept0(IntVar[] vars)
vars
- collection of variablesdefault Constraint allEqual(IntVar... vars)
vars
- list of variablesdefault Constraint notAllEqual(IntVar... vars)
vars
- list of variablesdefault Constraint among(IntVar nbVar, IntVar[] vars, int[] values)
nbVar
- a variablevars
- vector of variablesvalues
- set of valuesdefault Constraint and(BoolVar... bools)
bools
- an array of boolean variabledefault Constraint and(Constraint... cstrs)
cstrs
- an array of constraintsdefault Constraint atLeastNValues(IntVar[] vars, IntVar nValues, boolean AC)
This embeds a light propagator by default. Additional filtering algorithms can be added.
vars
- collection of variablesnValues
- limit variableAC
- additional filtering algorithm, domain filtering algorithm derivated from (Soft)AllDifferentdefault Constraint atMostNValues(IntVar[] vars, IntVar nValues, boolean STRONG)
This embeds a light propagator by default. Additional filtering algorithms can be added.
vars
- collection of variablesnValues
- limit variableSTRONG
- "AMNVdefault Constraint binPacking(IntVar[] itemBin, int[] itemSize, IntVar[] binLoad, int offset)
itemBin
- IntVar representing the bin of each itemitemSize
- int representing the size of each itembinLoad
- IntVar representing the load of each bin (i.e. the sum of the size of the items in it)offset
- 0 by default but typically 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)default Constraint boolsIntChanneling(BoolVar[] bVars, IntVar var, int offset)
bVars
- array of boolean variablesvar
- observed variable. Should presumably have an enumerated domainoffset
- 0 by default but typically 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)default Constraint bitsIntChanneling(BoolVar[] bits, IntVar var)
bits
- the array of bitsvar
- the numeric valuedefault Constraint clausesIntChanneling(IntVar var, BoolVar[] eVars, BoolVar[] lVars)
var
- an Integer variableeVars
- array of EQ boolean variableslVars
- array of LQ boolean variablesdefault Constraint circuit(IntVar[] vars)
Filtering algorithms:
subtour elimination : Caseau & Laburthe (ICLP'97) allDifferent GAC algorithm: Régin (AAAI'94) dominator-based filtering: Fages & Lorca (CP'11) Strongly Connected Components based filtering (Cambazar & Bourreau JFPC'06 and Fages and Lorca TechReport'12)vars
- vector of variables which take their value in [offset,offset+|vars|-1]default Constraint circuit(IntVar[] vars, int offset)
Filtering algorithms:
subtour elimination : Caseau & Laburthe (ICLP'97) allDifferent GAC algorithm: Régin (AAAI'94) dominator-based filtering: Fages & Lorca (CP'11) Strongly Connected Components based filtering (Cambazar & Bourreau JFPC'06 and Fages and Lorca TechReport'12)vars
- vector of variables which take their value in [offset,offset+|vars|-1]offset
- 0 by default but typically 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)default Constraint circuit(IntVar[] vars, int offset, CircuitConf conf)
Filtering algorithms:
subtour elimination : Caseau & Laburthe (ICLP'97) allDifferent GAC algorithm: Régin (AAAI'94) dominator-based filtering: Fages & Lorca (CP'11) Strongly Connected Components based filtering (Cambazard & Bourreau JFPC'06 and Fages and Lorca TechReport'12) See Fages PhD Thesis (2014) for more informationvars
- vector of variables which take their value in [offset,offset+|vars|-1]offset
- 0 by default but typically 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)conf
- filtering optionsdefault Constraint costRegular(IntVar[] vars, IntVar cost, ICostAutomaton costAutomaton)
vars
- sequence of variablescost
- cost variablecostAutomaton
- a deterministic finite automaton defining the regular language and the costs
Can be built with method CostAutomaton.makeSingleResource(...)default Constraint count(int value, IntVar[] vars, IntVar limit)
value
- an intvars
- a vector of variableslimit
- a variabledefault Constraint count(IntVar value, IntVar[] vars, IntVar limit)
value
- a variablevars
- a vector of variableslimit
- a variabledefault Constraint cumulative(Task[] tasks, IntVar[] heights, IntVar capacity)
tasks
- Task objects containing start, duration and end variablesheights
- integer variables representing the resource consumption of each taskcapacity
- integer variable representing the resource capacitydefault Constraint cumulative(Task[] tasks, IntVar[] heights, IntVar capacity, boolean incremental)
tasks
- Task objects containing start, duration and end variablesheights
- integer variables representing the resource consumption of each taskcapacity
- integer variable representing the resource capacityincremental
- specifies if an incremental propagation should be applieddefault Constraint cumulative(Task[] tasks, IntVar[] heights, IntVar capacity, boolean incremental, Cumulative.Filter... filters)
tasks
- Task objects containing start, duration and end variablesheights
- integer variables representing the resource consumption of each taskcapacity
- integer variable representing the resource capacityincremental
- specifies if an incremental propagation should be appliedfilters
- specifies which filtering algorithms to applydefault Constraint cumulative(Task[] tasks, IntVar[] heights, IntVar capacity, boolean incremental, CumulFilter... filters)
tasks
- Task objects containing start, duration and end variablesheights
- integer variables representing the resource consumption of each taskcapacity
- integer variable representing the resource capacityincremental
- specifies if an incremental propagation should be appliedfilters
- specifies which filtering algorithms to applydefault Constraint diffN(IntVar[] X, IntVar[] Y, IntVar[] width, IntVar[] height, boolean addCumulativeReasoning)
X
- collection of coordinates in first dimensionY
- collection of coordinates in second dimensionwidth
- collection of width (each duration should be > 0)height
- collection of height (each height should be >= 0)addCumulativeReasoning
- indicates whether or not redundant cumulative constraints should be put on each dimension (advised)default Constraint element(IntVar value, IntVar[] table, IntVar index, int offset)
value
- value variabletable
- array of variablesindex
- index variable in range [offset,offset+|table|-1]offset
- int offset, generally 0default Constraint globalCardinality(IntVar[] vars, int[] values, IntVar[] occurrences, boolean closed)
vars
- collection of variablesvalues
- collection of constrained valuesoccurrences
- collection of cardinality variablesclosed
- restricts domains of vars to values if set to truedefault Constraint inverseChanneling(IntVar[] vars1, IntVar[] vars2)
Beware you should have |vars1| = |vars2|
vars1
- vector of variables which take their value in [0,|vars2|-1]vars2
- vector of variables which take their value in [0,|vars1|-1]default Constraint inverseChanneling(IntVar[] vars1, IntVar[] vars2, int offset1, int offset2)
Beware you should have |vars1| = |vars2|
vars1
- vector of variables which take their value in [offset1,offset1+|vars2|-1]vars2
- vector of variables which take their value in [offset2,offset2+|vars1|-1]offset1
- lowest value in vars1 (most often 0)offset2
- lowest value in vars2 (most often 0)default Constraint intValuePrecedeChain(IntVar[] X, int S, int T)
j
such that X[j] = T, then, there must exist i
< j
such that
X[i] = S.X
- an array of variablesS
- a valueT
- another valuedefault Constraint intValuePrecedeChain(IntVar[] X, int[] V)
j
such that X[j] = V[l], then, there must exist i
< j
such that
X[i] = V[k].X
- array of variablesV
- array of (distinct) valuesdefault Constraint knapsack(IntVar[] occurrences, IntVar weightSum, IntVar energySum, int[] weight, int[] energy)
A knapsack constraint
wikipedia:
"Given a set of items, each with a weight and an energy value,
determine the count of each item to include in a collection so that
the total weight is less than or equal to a given limit and the total value is as large as possible.
It derives its name from the problem faced by someone who is constrained by a fixed-size knapsack
and must fill it with the most useful items."
The limit over weightSum has to be specified either in its domain or with an additional constraint:
model.post(solver.arithm(weightSum, "<=", limit);
occurrences
- number of occurrences of every itemweightSum
- load of the knapsackenergySum
- profit of the knapsackweight
- weight of each item (must be >=0)energy
- energy of each item (must be >=0)default Constraint keySort(IntVar[][] vars, IntVar[] PERMvars, IntVar[][] SORTEDvars, int K)
For example:
- vars= (<4,2,2>,<2,3,1>,<4,2,1><1,3,0>)
- SORTEDvars= (<1,3,0>,<2,3,1>,<4,2,2>,<4,2,1>)
- PERMvars= (2,1,3,0)
- K = 2
vars
- a tuple of array of variablesPERMvars
- array of permutation variables, domains should be [1,vars.length] -- Can be nullSORTEDvars
- a tuple of array of variables sorted in increasing orderK
- key perfixes size (0 ≤ k ≤ m, where m is the size of the array of variable)default Constraint lexChainLess(IntVar[]... vars)
vars
- collection of vectors of variablesdefault Constraint lexChainLessEq(IntVar[]... vars)
vars
- collection of vectors of variablesdefault Constraint lexLess(IntVar[] vars1, IntVar[] vars2)
vars1
- vector of variablesvars2
- vector of variablesdefault Constraint lexLessEq(IntVar[] vars1, IntVar[] vars2)
vars1
- vector of variablesvars2
- vector of variablesdefault Constraint max(IntVar max, IntVar[] vars)
max
- a variablevars
- a vector of variables, of size > 0default Constraint max(BoolVar max, BoolVar[] vars)
max
- a boolean variablevars
- a vector of boolean variables, of size > 0default Constraint mddc(IntVar[] vars, MultivaluedDecisionDiagram MDD)
vars
- the array of variablesMDD
- the multi-valued decision diagram encoding solutionsdefault Constraint min(IntVar min, IntVar[] vars)
min
- a variablevars
- a vector of variables, of size > 0default Constraint min(BoolVar min, BoolVar[] vars)
min
- a boolean variablevars
- a vector of boolean variables, of size > 0default Constraint multiCostRegular(IntVar[] vars, IntVar[] costVars, ICostAutomaton costAutomaton)
vars
- sequence of variablescostVars
- cost variablescostAutomaton
- a deterministic finite automaton defining the regular language and the costs
Can be built from method CostAutomaton.makeMultiResources(...)default Constraint multiCostRegular(IntVar[] vars, IntVar[] costVars, ICostAutomaton costAutomaton, double precision)
vars
- sequence of variablescostVars
- cost variablescostAutomaton
- a deterministic finite automaton defining the regular language and the costs
Can be built from method CostAutomaton.makeMultiResources(...)precision
- the smallest used double for MCR algorithmdefault Constraint nValues(IntVar[] vars, IntVar nValues)
This embeds a light propagator by default. Additional filtering algorithms can be added.
see atleast_nvalue and atmost_nvalue
vars
- collection of variablesnValues
- limit variabledefault Constraint or(BoolVar... bools)
bools
- an array of boolean variabledefault Constraint or(Constraint... cstrs)
cstrs
- an array of constraintsdefault Constraint path(IntVar[] vars, IntVar start, IntVar end)
Filtering algorithms: see circuit constraint
vars
- vector of variables which take their value in [0,|vars|]start
- variable indicating the index of the first variable in the pathend
- variable indicating the index of the last variable in the pathdefault Constraint path(IntVar[] vars, IntVar start, IntVar end, int offset)
Filtering algorithms: see circuit constraint
vars
- vector of variables which take their value in [offset,offset+|vars|]start
- variable indicating the index of the first variable in the pathend
- variable indicating the index of the last variable in the pathoffset
- 0 by default but typically 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)default Constraint regular(IntVar[] vars, IAutomaton automaton)
vars
- sequence of variablesautomaton
- a deterministic finite automaton defining the regular languagedefault Constraint scalar(IntVar[] vars, int[] coeffs, String operator, int scalar)
vars
- a collection of IntVarcoeffs
- a collection of int, for which |vars|=|coeffs|operator
- an operator in {"=", "!=", ">","<",">=","<="}scalar
- an integerdefault Constraint scalar(IntVar[] vars, int[] coeffs, String operator, int scalar, int minCardForDecomp)
vars
- a collection of IntVarcoeffs
- a collection of int, for which |vars|=|coeffs|operator
- an operator in {"=", "!=", ">","<",">=","<="}scalar
- an integerminCardForDecomp
- minimum number of cardinality threshold to a sum constraint to be decomposeddefault Constraint scalar(IntVar[] vars, int[] coeffs, String operator, IntVar scalar)
vars
- a collection of IntVarcoeffs
- a collection of int, for which |vars|=|coeffs|operator
- an operator in {"=", "!=", ">","<",">=","<="}scalar
- an IntVardefault Constraint scalar(IntVar[] vars, int[] coeffs, String operator, IntVar scalar, int minCardForDecomp)
vars
- a collection of IntVarcoeffs
- a collection of int, for which |vars|=|coeffs|operator
- an operator in {"=", "!=", ">","<",">=","<="}scalar
- an IntVarminCardForDecomp
- minimum number of cardinality threshold to a sum constraint to be decomposeddefault Constraint sort(IntVar[] vars, IntVar[] sortedVars)
For example:
- X= (4,2,1,3)
- Y= (1,2,3,4)
vars
- an array of variablessortedVars
- an array of variables sorted in increasing orderdefault Constraint subCircuit(IntVar[] vars, int offset, IntVar subCircuitLength)
Filtering algorithms: subtour elimination : Caseau & Laburthe (ICLP'97) allDifferent GAC algorithm: Régin (AAAI'94) dominator-based filtering: Fages & Lorca (CP'11) (adaptive scheme by default, see implementation)
vars
- a vector of variablesoffset
- 0 by default but 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)subCircuitLength
- expected number of nodes in the circuitdefault Constraint subPath(IntVar[] vars, IntVar start, IntVar end, int offset, IntVar SIZE)
Filtering algorithms: see subCircuit constraint
vars
- vector of variables which take their value in [offset,offset+|vars|]start
- variable indicating the index of the first variable in the pathend
- variable indicating the index of the last variable in the pathoffset
- 0 by default but typically 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)SIZE
- variable indicating the number of variables to belong to the pathdefault Constraint sum(IntVar[] vars, String operator, int sum)
vars
- a collection of IntVaroperator
- operator in {"=", "!=", ">","<",">=","<="}sum
- an integerdefault Constraint sum(IntVar[] vars, String operator, int sum, int minCardForDecomp)
vars
- a collection of IntVaroperator
- operator in {"=", "!=", ">","<",">=","<="}sum
- an integerminCardForDecomp
- minimum number of cardinality threshold to a sum constraint to be decomposeddefault Constraint sum(IntVar[] vars, String operator, IntVar sum)
vars
- a collection of IntVaroperator
- operator in {"=", "!=", ">","<",">=","<="}sum
- an IntVardefault Constraint sum(IntVar[] vars, String operator, IntVar sum, int minCardForDecomp)
vars
- a collection of IntVaroperator
- operator in {"=", "!=", ">","<",">=","<="}sum
- an IntVarminCardForDecomp
- minimum number of cardinality threshold to a sum constraint to be decomposeddefault Constraint sum(BoolVar[] vars, String operator, int sum)
vars
- a vector of boolean variablessum
- an integerdefault Constraint sum(BoolVar[] vars, String operator, IntVar sum)
vars
- a vector of boolean variablessum
- a variabledefault Constraint sum(BoolVar[] vars, String operator, IntVar sum, int minCardForDecomp)
vars
- a vector of boolean variablessum
- a variableminCardForDecomp
- minimum number of cardinality threshold to a sum constraint to be decomposeddefault Constraint table(IntVar[] vars, Tuples tuples)
vars
- variables forming the tuplestuples
- the relation between the variables (list of allowed/forbidden tuples)default Constraint table(IntVar[] vars, Tuples tuples, String algo)
- CT+: Compact-Table algorithm (AC),
- GAC2001: Arc Consistency version 2001 for tuples,
- GAC2001+: Arc Consistency version 2001 for allowed tuples,
- GAC3rm: Arc Consistency version AC3 rm for tuples,
- GAC3rm+ (default): Arc Consistency version 3rm for allowed tuples,
- GACSTR+: Arc Consistency version STR for allowed tuples,
- STR2+: Arc Consistency version STR2 for allowed tuples,
- FC: Forward Checking.
- MDD+: uses a multi-valued decision diagram for allowed tuples (see mddc constraint),
vars
- variables forming the tuplestuples
- the relation between the variables (list of allowed/forbidden tuples). Should not be modified once passed to the constraint.algo
- to choose among {"TC+", "GAC3rm", "GAC2001", "GACSTR", "GAC2001+", "GAC3rm+", "FC", "STR2+"}default Constraint tree(IntVar[] succs, IntVar nbTrees)
dominator-based filtering: Fages & Lorca (CP'11) However, the filtering over nbTrees is quite light here
succs
- successors variables, taking their domain in [0,|succs|-1]nbTrees
- number of arborescences (=number of loops)default Constraint tree(IntVar[] succs, IntVar nbTrees, int offset)
dominator-based filtering: Fages & Lorca (CP'11) However, the filtering over nbTrees is quite light here
succs
- successors variables, taking their domain in [offset,|succs|-1+offset]nbTrees
- number of arborescences (=number of loops)offset
- 0 by default but 1 if used within MiniZinc
(which counts from 1 to n instead of from 0 to n-1)default int[] getDomainUnion(IntVar... vars)
vars
- an array of integer variablesCopyright © 2018. All rights reserved.