public interface ISetConstraintFactory
Modifier and Type | Method and Description |
---|---|
default Constraint |
allDifferent(SetVar... sets)
Creates a constraint stating that sets should all be different (not necessarily disjoint)
Note that there cannot be more than one empty set
|
default Constraint |
allDisjoint(SetVar... sets)
Creates a constraint stating that the intersection of sets should be empty
Note that there can be multiple empty sets
|
default Constraint |
allEqual(SetVar... sets)
Creates a constraint stating that sets should be all equal
|
default Constraint |
disjoint(SetVar set1,
SetVar set2)
Creates a constraint stating that the intersection of set1 and set2 should be empty
Note that they can be both empty
|
default Constraint |
element(IntVar index,
SetVar[] sets,
int offset,
SetVar set)
Creates a constraint enabling to retrieve an element set in sets:
sets[index-offset] = set
|
default Constraint |
element(IntVar index,
SetVar[] sets,
SetVar set)
Creates a constraint enabling to retrieve an element set in sets:
sets[index] = set
|
default Constraint |
intersection(SetVar[] sets,
SetVar intersectionSet)
Creates a constraint which ensures that the intersection of sets is equal to intersectionSet
|
default Constraint |
intersection(SetVar[] sets,
SetVar intersectionSet,
boolean boundConsistent)
Creates a constraint which ensures that the intersection of sets is equal to intersectionSet
|
default Constraint |
inverseSet(SetVar[] sets,
SetVar[] invSets,
int offset1,
int offset2)
Creates a constraint stating that :
x in sets[y-offset1] <=> y in invSets[x-offset2]
|
default Constraint |
max(SetVar indices,
int[] weights,
int offset,
IntVar maxElementValue,
boolean notEmpty)
Creates a constraint over the maximum element induces by a set:
max{weights[i-offset] | i in indices} = maxElementValue
|
default Constraint |
max(SetVar set,
IntVar maxElementValue,
boolean notEmpty)
Creates a constraint over the maximum element in a set:
max{i | i in set} = maxElementValue
|
default Constraint |
member(int cst,
SetVar set)
Creates a member constraint stating that the constant cst is in set
|
default Constraint |
member(IntVar intVar,
SetVar set)
Creates a member constraint stating that the value of intVar is in set
|
default Constraint |
member(SetVar[] sets,
SetVar set)
Creates a member constraint stating that set belongs to sets
|
default Constraint |
min(SetVar indices,
int[] weights,
int offset,
IntVar minElementValue,
boolean notEmpty)
Creates a constraint over the minimum element induces by a set:
min{weights[i-offset] | i in indices} = minElementValue
|
default Constraint |
min(SetVar set,
IntVar minElementValue,
boolean notEmpty)
Creates a constraint over the minimum element in a set:
min{i | i in set} = minElementValue
|
default Constraint |
nbEmpty(SetVar[] sets,
int nbEmpty)
Creates a constraint counting the number of empty sets sets
|{s in sets where |s|=0}| = nbEmpty
|
default Constraint |
nbEmpty(SetVar[] sets,
IntVar nbEmpty)
Creates a constraint counting the number of empty sets sets
|{s in sets where |s|=0}| = nbEmpty
|
default Constraint |
notEmpty(SetVar set)
Creates a constraint preventing set to be empty
|
default Constraint |
notMember(int cst,
SetVar set)
Creates a member constraint stating that the constant cst is not in set
|
default Constraint |
notMember(IntVar intVar,
SetVar set)
Creates a member constraint stating that the value of intVar is not in set
|
default Constraint |
offSet(SetVar set1,
SetVar set2,
int offset)
Creates a constraint linking set1 and set2 with an index offset :
x in set1 <=> x+offset in set2
|
default Constraint |
partition(SetVar[] sets,
SetVar universe)
Creates a constraint stating that partitions universe into sets:
union(sets) = universe
intersection(sets) = {}
|
default Constraint |
setBoolsChanneling(BoolVar[] bools,
SetVar set)
Creates a constraint channeling a set variable with boolean variables :
i in set <=> bools[i] = TRUE
|
default Constraint |
setBoolsChanneling(BoolVar[] bools,
SetVar set,
int offset)
Creates a constraint channeling a set variable with boolean variables :
i in set <=> bools[i-offset] = TRUE
|
default Constraint |
setsIntsChanneling(SetVar[] sets,
IntVar[] ints)
Creates a constraint channeling set variables and integer variables :
x in sets[y] <=> ints[x] = y
|
default Constraint |
setsIntsChanneling(SetVar[] sets,
IntVar[] ints,
int offset1,
int offset2)
Creates a constraint channeling set variables and integer variables :
x in sets[y-offset1] <=> ints[x-offset2] = y
|
default Constraint |
subsetEq(SetVar... sets)
Creates a constraint establishing that sets[i] is a subset of sets[j] if i |
default Constraint |
sum(SetVar set,
IntVar sum)
Creates a constraint summing elements of set
sum{i | i in set} = sum
|
default Constraint |
sumElements(SetVar indices,
int[] weights,
int offset,
IntVar sum)
Creates a constraint summing weights given by a set of indices:
sum{weights[i-offset] | i in indices} = sum
Also ensures that elements in indices belong to [offset, offset+weights.length-1]
|
default Constraint |
sumElements(SetVar indices,
int[] weights,
IntVar sum)
Creates a constraint summing weights given by a set of indices:
sum{weights[i] | i in indices} = sum
Also ensures that elements in indices belong to [0, weights.length-1]
|
default Constraint |
symmetric(SetVar... sets)
Creates a constraint stating that sets are symmetric sets:
x in sets[y] <=> y in sets[x]
|
default Constraint |
symmetric(SetVar[] sets,
int offset)
Creates a constraint stating that sets are symmetric sets:
x in sets[y-offset] <=> y in sets[x-offset]
|
default Constraint |
union(IntVar[] ints,
SetVar union)
Creates a constraint ensuring that union is exactly the union of values taken by ints,
|
default Constraint |
union(SetVar[] sets,
SetVar unionSet)
Creates a constraint which ensures that the union of sets is equal to unionSet
|
default Constraint union(IntVar[] ints, SetVar union)
ints
- an array of integer variablesunion
- a set variabledefault Constraint union(SetVar[] sets, SetVar unionSet)
sets
- an array of set variablesunionSet
- set variable representing the union of setsdefault Constraint intersection(SetVar[] sets, SetVar intersectionSet)
sets
- an array of set variablesintersectionSet
- a set variable representing the intersection of setsdefault Constraint intersection(SetVar[] sets, SetVar intersectionSet, boolean boundConsistent)
sets
- an array of set variablesintersectionSet
- a set variable representing the intersection of setsboundConsistent
- adds an additional propagator to guarantee BCdefault Constraint subsetEq(SetVar... sets)
sets
- an array of set variablesdefault Constraint nbEmpty(SetVar[] sets, int nbEmpty)
sets
- an array of set variablesnbEmpty
- integer restricting the number of empty sets in setsdefault Constraint nbEmpty(SetVar[] sets, IntVar nbEmpty)
sets
- an array of set variablesnbEmpty
- integer variable restricting the number of empty sets in setsdefault Constraint offSet(SetVar set1, SetVar set2, int offset)
set1
- a set variableset2
- a set variableoffset
- offset indexdefault Constraint notEmpty(SetVar set)
set
- a SetVar which should not be emptydefault Constraint sum(SetVar set, IntVar sum)
set
- a set variablesum
- an integer variable representing sum{i | i in set}default Constraint sumElements(SetVar indices, int[] weights, IntVar sum)
indices
- a set variableweights
- integers representing the weight of each element in indicessum
- an integer variable representing sum{weights[i] | i in indices}default Constraint sumElements(SetVar indices, int[] weights, int offset, IntVar sum)
indices
- a set variableweights
- integers representing the weight of each element in indicesoffset
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)sum
- an integer variable representing sum{weights[i-offset] | i in indices}default Constraint max(SetVar set, IntVar maxElementValue, boolean notEmpty)
set
- a set variablemaxElementValue
- an integer variable representing the maximum element in setnotEmpty
- true : the set variable cannot be empty
false : the set may be empty (if set is empty, this constraint is not applied)default Constraint max(SetVar indices, int[] weights, int offset, IntVar maxElementValue, boolean notEmpty)
indices
- a set variable containing elements in range [offset,weights.length-1+offset]weights
- integers representing the weight of each element in indicesoffset
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)maxElementValue
- an integer variable representing the maximum weight induced by indicesnotEmpty
- true : the set variable cannot be empty
false : the set may be empty (if indices is empty, this constraint is not applied)default Constraint min(SetVar set, IntVar minElementValue, boolean notEmpty)
set
- a set variableminElementValue
- an integer variable representing the minimum element in setnotEmpty
- true : the set variable cannot be empty
false : the set may be empty (if set is empty, this constraint is not applied)default Constraint min(SetVar indices, int[] weights, int offset, IntVar minElementValue, boolean notEmpty)
indices
- a set variable containing elements in range [offset,weights.length-1+offset]weights
- integers representing the weight of each element in indicesoffset
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)minElementValue
- an integer variable representing the minimum weight induced by indicesnotEmpty
- true : the set variable cannot be empty
false : the set may be empty (if indices is empty, this constraint is not applied)default Constraint setBoolsChanneling(BoolVar[] bools, SetVar set)
bools
- an array of boolean variablesset
- a set variabledefault Constraint setBoolsChanneling(BoolVar[] bools, SetVar set, int offset)
bools
- an array of boolean variablesset
- a set variableoffset
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)default Constraint setsIntsChanneling(SetVar[] sets, IntVar[] ints)
sets
- an array of set variablesints
- an array of integer variablesdefault Constraint setsIntsChanneling(SetVar[] sets, IntVar[] ints, int offset1, int offset2)
sets
- an array of set variablesints
- an array of integer variablesoffset1
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)offset2
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)default Constraint disjoint(SetVar set1, SetVar set2)
set1
- a set variableset2
- a set variabledefault Constraint allDisjoint(SetVar... sets)
sets
- an array of disjoint set variablesdefault Constraint allDifferent(SetVar... sets)
sets
- an array of different set variablesdefault Constraint allEqual(SetVar... sets)
sets
- an array of set variables to be equaldefault Constraint partition(SetVar[] sets, SetVar universe)
sets
- an array of set variables whose values are subsets of universeuniverse
- a set variable representing the union of setsdefault Constraint inverseSet(SetVar[] sets, SetVar[] invSets, int offset1, int offset2)
sets
- an array of set variablesinvSets
- an array of set variablesoffset1
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)offset2
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)default Constraint symmetric(SetVar... sets)
sets
- an array of set variablesdefault Constraint symmetric(SetVar[] sets, int offset)
sets
- an array of set variablesoffset
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)default Constraint element(IntVar index, SetVar[] sets, SetVar set)
index
- an integer variable pointing to set's index into array setssets
- an array of set variables representing possible values for setset
- a set variable equal to sets[index]default Constraint element(IntVar index, SetVar[] sets, int offset, SetVar set)
index
- an integer variable pointing to set's index into array setssets
- an array of set variables representing possible values for setoffset
- offset index : should be 0 by default
but generally 1 with MiniZinc API
which counts from 1 to n instead of counting from 0 to n-1 (Java standard)set
- a set variable equal to sets[index-offset]default Constraint member(SetVar[] sets, SetVar set)
sets
- set variables representing possible values for setset
- a set variable which takes its value in setsdefault Constraint member(IntVar intVar, SetVar set)
intVar
- an integer variables which takes its value in setset
- a set variables containing possible values for intVardefault Constraint member(int cst, SetVar set)
cst
- an integerset
- a set variabledefault Constraint notMember(IntVar intVar, SetVar set)
intVar
- an integer variables which does not take its values in setset
- a set variables representing impossible values for intVardefault Constraint notMember(int cst, SetVar set)
cst
- an integerset
- a set variableCopyright © 2018. All rights reserved.