Modifier and Type | Method and Description |
---|---|
static Constraint |
all_different(SetVar[] SETS)
Sets in SETS are all different (not necessarily disjoint)
Note that there cannot be more than two empty sets
|
static Constraint |
all_disjoint(SetVar[] SETS)
Sets in SETS are all disjoint
Note that there can be multiple empty sets
|
static Constraint |
all_equal(SetVar[] SETS)
SETS are all equal
|
static Constraint |
bool_channel(BoolVar[] BOOLEANS,
SetVar SET,
int OFFSET)
Channeling between a set variable SET and boolean variables BOOLEANS
i in SET <=> BOOLEANS[i-OFFSET] = TRUE
|
static Constraint |
cardinality(SetVar SET,
IntVar CARD)
Cardinality constraint: |SET_VAR| = CARD
|
static Constraint |
disjoint(SetVar SET_1,
SetVar SET_2)
SET_1 and SET_2 are disjoint, i.e. they cannot contain the same element.
|
static Constraint |
element(IntVar INDEX,
SetVar[] SETS,
int OFFSET,
SetVar SET)
Element constraint over sets
states that SETS[INDEX-OFFSET] = SET
|
static Constraint |
int_channel(SetVar[] SETS,
IntVar[] INTEGERS,
int OFFSET_1,
int OFFSET_2)
Channeling between set variables SETS and integer variables INTEGERS
x in SETS[y-OFFSET_1] <=> INTEGERS[x-OFFSET_2] = y
|
static Constraint |
int_values_union(IntVar[] VARS,
SetVar VALUES)
Channeling constraint ensuring that
VALUES is exactly the set of values taken by VARS,
|
static Constraint |
intersection(SetVar[] SETS,
SetVar INTERSECTION)
Constraint which ensures that the intersection of sets in SET_VAR is equal to the set SET_INTER
|
static Constraint |
inverse_set(SetVar[] SETS,
SetVar[] INVERSE_SETS,
int OFFSET_1,
int OFFSET_2)
Inverse set constraint
x in SETS[y-OFFSET_1] <=> y in INVERSE_SETS[x-OFFSET_2]
|
static Constraint |
max(SetVar INDEXES,
int[] WEIGHTS,
int OFFSET,
IntVar MAX_ELEMENT_VALUE,
boolean NOT_EMPTY)
Retrieves the maximum element MAX_ELEMENT_VALUE induced by INDEXES
max{WEIGHTS[i-OFFSET] | i in INDEXES} = MAX_ELEMENT_VALUE
|
static Constraint |
max(SetVar SET,
IntVar MAX_ELEMENT_VALUE,
boolean NOT_EMPTY)
Retrieves the maximum element MAX_ELEMENT_VALUE of SET
max{i | i in set} = MAX_ELEMENT_VALUE
|
static Constraint |
member(IntVar INTEGER,
SetVar SET)
Member constraint over an IntVar and a SetVar
states that INTEGER is included in SET
|
static Constraint |
member(SetVar[] SETS,
SetVar SET)
Member constraint over sets
states that SET belongs to SETS
|
static Constraint |
min(SetVar INDEXES,
int[] WEIGHTS,
int OFFSET,
IntVar MIN_ELEMENT_VALUE,
boolean NOT_EMPTY)
Retrieves the minimum element MIN_ELEMENT_VALUE induced by INDEXES
min{WEIGHTS[i-OFFSET] | i in INDEXES} = MIN_ELEMENT_VALUE
|
static Constraint |
min(SetVar SET,
IntVar MIN_ELEMENT_VALUE,
boolean NOT_EMPTY)
Retrieves the minimum element MIN_ELEMENT_VALUE of SET:
min{i | i in SET} = MIN_ELEMENT_VALUE
|
static Constraint |
nbEmpty(SetVar[] SETS,
IntVar NB_EMPTY_SETS)
Restricts the number of empty sets in SETS
|{s in SETS such that |s|=0}| = NB_EMPTY_SETS
|
static Constraint |
not_member(IntVar INTEGER,
SetVar SET)
NotMember constraint over an IntVar and a SetVar
states that INTEGER is not included in SET
|
static Constraint |
notEmpty(SetVar SET)
Prevents SET to be empty
|
static Constraint |
offSet(SetVar SET_1,
SetVar SET_2,
int OFFSET)
links SET_1 and SET_2 with OFFSET
x in SET_1 <=> x+OFFSET in SET_2
|
static Constraint |
partition(SetVar[] SETS,
SetVar UNIVERSE)
Partitions UNIVERSE into disjoint sets, SETS
|
static Constraint |
subsetEq(SetVar[] SETS)
Constraint which ensures that i
|
static Constraint |
sum(SetVar INDEXES,
int[] WEIGHTS,
int OFFSET,
IntVar SUM,
boolean NOT_EMPTY)
Sums weights given by a set of indexes INDEXES:
sum{WEIGHTS[i-OFFSET] | i in INDEXES} = SUM
|
static Constraint |
sum(SetVar SET,
IntVar SUM,
boolean NOT_EMPTY)
Sums elements of a SET
sum{i | i in set} = SUM
|
static Constraint |
symmetric(SetVar[] SETS,
int OFFSET)
Symmetric sets constraint
x in SETS[y-OFFSET] <=> y in SETS[x-OFFSET]
|
static Constraint |
union(SetVar[] SETS,
SetVar UNION)
Constraint which ensures that the union of sets in SET_VARS is equal to the set SET_UNION
|
public static Constraint union(SetVar[] SETS, SetVar UNION)
SETS
- set variablesUNION
- set variable representing the union of SET_VARSpublic static Constraint intersection(SetVar[] SETS, SetVar INTERSECTION)
SETS
- set variablesINTERSECTION
- set variable representing the intersection of SET_VARSpublic static Constraint subsetEq(SetVar[] SETS)
SETS
- set variablespublic static Constraint cardinality(SetVar SET, IntVar CARD)
SET
- a set variableCARD
- an integer variable representing SET_VAR's cardinality
(i.e. the number of elements in it)public static Constraint nbEmpty(SetVar[] SETS, IntVar NB_EMPTY_SETS)
SETS
- set variablesNB_EMPTY_SETS
- integer variable restricting the number of empty sets in SETSpublic static Constraint offSet(SetVar SET_1, SetVar SET_2, int OFFSET)
SET_1
- a set variableSET_2
- a set variableOFFSET
- offset indexpublic static Constraint notEmpty(SetVar SET)
SET
- a SetVarpublic static Constraint sum(SetVar SET, IntVar SUM, boolean NOT_EMPTY)
SET
- a set variableSUM
- an integer variable representing sum{i | i in SET}NOT_EMPTY
- true : the set variable cannot be empty
false : the set may be empty (if so, the SUM constraint is not applied)public static Constraint sum(SetVar INDEXES, int[] WEIGHTS, int OFFSET, IntVar SUM, boolean NOT_EMPTY)
INDEXES
- set variablesWEIGHTS
- integersOFFSET
- 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 INDEXES}NOT_EMPTY
- true : the set variable cannot be empty
false : the set may be empty (if so, the SUM constraint is not applied)public static Constraint max(SetVar SET, IntVar MAX_ELEMENT_VALUE, boolean NOT_EMPTY)
SET
- a set variableMAX_ELEMENT_VALUE
- an integer variable representing max{i | i in SET}NOT_EMPTY
- true : the set variable cannot be empty
false : the set may be empty (if so, the MAX constraint is not applied)public static Constraint max(SetVar INDEXES, int[] WEIGHTS, int OFFSET, IntVar MAX_ELEMENT_VALUE, boolean NOT_EMPTY)
INDEXES
- a set variable containing elements in range [OFFSET,WEIGHTS.length-1+OFFSET]WEIGHTS
- integersOFFSET
- 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)MAX_ELEMENT_VALUE
- an integer variable representing max{WEIGHTS[i-OFFSET] | i in INDEXES}NOT_EMPTY
- true : the set variable cannot be empty
false : the set may be empty (if so, the MAX constraint is not applied)public static Constraint min(SetVar SET, IntVar MIN_ELEMENT_VALUE, boolean NOT_EMPTY)
SET
- a set variableMIN_ELEMENT_VALUE
- an integer variable representing min{i | i in SET}NOT_EMPTY
- true : the set variable cannot be empty
false : the set may be empty (if so, the MIN constraint is not applied)public static Constraint min(SetVar INDEXES, int[] WEIGHTS, int OFFSET, IntVar MIN_ELEMENT_VALUE, boolean NOT_EMPTY)
INDEXES
- a set variable containing elements in range [OFFSET,WEIGHTS.length-1+OFFSET]WEIGHTS
- integersOFFSET
- 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)MIN_ELEMENT_VALUE
- integer variable representing min{WEIGHTS[i-OFFSET] | i in INDEXES}NOT_EMPTY
- true : the set variable cannot be empty
false : the set may be empty (if so, the MIN constraint is not applied)public static Constraint bool_channel(BoolVar[] BOOLEANS, SetVar SET, int OFFSET)
BOOLEANS
- boolean variablesSET
- 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)public static Constraint int_channel(SetVar[] SETS, IntVar[] INTEGERS, int OFFSET_1, int OFFSET_2)
SETS
- set variablesINTEGERS
- integer variablesOFFSET_1
- 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)OFFSET_2
- 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)public static Constraint int_values_union(IntVar[] VARS, SetVar VALUES)
VARS
- integer variablesVALUES
- a set variablepublic static Constraint disjoint(SetVar SET_1, SetVar SET_2)
SET_1
- a set variableSET_2
- a set variablepublic static Constraint all_disjoint(SetVar[] SETS)
SETS
- disjoint set variablespublic static Constraint all_different(SetVar[] SETS)
SETS
- different set variablespublic static Constraint all_equal(SetVar[] SETS)
SETS
- set variables to be equalspublic static Constraint partition(SetVar[] SETS, SetVar UNIVERSE)
SETS
- set variables whose values are subsets of UNIVERSEUNIVERSE
- a set variable representing union(SETS)public static Constraint inverse_set(SetVar[] SETS, SetVar[] INVERSE_SETS, int OFFSET_1, int OFFSET_2)
SETS
- set variablesINVERSE_SETS
- set variablesOFFSET_1
- 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)OFFSET_2
- 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)public static Constraint symmetric(SetVar[] SETS, int OFFSET)
SETS
- 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)public static Constraint element(IntVar INDEX, SetVar[] SETS, int OFFSET, SetVar SET)
INDEX
- an integer variable pointing to SET's index into array SETSSETS
- 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 which takes its value in SETSpublic static Constraint member(SetVar[] SETS, SetVar SET)
SETS
- set variables representing possible values for SETSET
- a set variable which takes its value in SETSpublic static Constraint member(IntVar INTEGER, SetVar SET)
INTEGER
- an integer variables which takes its values in SETSET
- a set variables representing possible values of INTEGERpublic static Constraint not_member(IntVar INTEGER, SetVar SET)
INTEGER
- an integer variables which does not take its values in SETSET
- a set variables representing impossible values of INTEGERCopyright © 2015. All rights reserved.