Interface IReificationFactory
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidifOnlyIf(Constraint cstr1, Constraint cstr2)Posts an equivalence constraint stating that cstr1 is satisfied <=> cstr2 is satisfied, BEWARE : it is automatically posted (it cannot be reified)default voidifThen(Constraint ifCstr, Constraint thenCstr)Posts a constraint ensuring that if ifCstr is satisfied, then thenCstr is satisfied as well BEWARE : it is automatically posted (it cannot be reified)default voidifThen(BoolVar ifVar, Constraint thenCstr)Posts an implication constraint: ifVar => thenCstr Also called half reification constraint Ensures:default voidifThenElse(Constraint ifCstr, Constraint thenCstr, Constraint elseCstr)Posts a constraint ensuring that if ifCstr is satisfied, then thenCstr must be satisfied as well Otherwise, elseCstr must be satisfied ifCstr => ThenCstr not(ifCstr) => ElseCstr BEWARE : it is automatically posted (it cannot be reified)default voidifThenElse(BoolVar ifVar, Constraint thenCstr, Constraint elseCstr)Posts an implication constraint: ifVar => thenCstr && not(ifVar) => elseCstr.default voidreification(BoolVar var, Constraint cstr)Reify a constraint with a boolean variable: var = 1 <=> cstr is satisfied, Equivalent to ifOnlyIf BEWARE : it is automatically posted (it cannot be reified)default voidreifyXeqC(IntVar X, int C, BoolVar B)Posts one constraint that expresses : (x = c) ⇔ b.default voidreifyXeqY(IntVar X, IntVar Y, BoolVar B)Posts one constraint that expresses : (x = y) ⇔ b.default voidreifyXgtC(IntVar X, int C, BoolVar B)Posts one constraint that expresses : (x > c) ⇔ b.default voidreifyXinS(IntVar X, IntIterableRangeSet S, BoolVar B)Posts one constraint that expresses : (X ∈ S) ⇔ B.default voidreifyXleY(IntVar X, IntVar Y, BoolVar B)Posts one constraint that expresses : (x ≤ y) ⇔ b.default voidreifyXltC(IntVar X, int C, BoolVar B)Posts one constraint that expresses : (x < c) ⇔ b.default voidreifyXltY(IntVar X, IntVar Y, BoolVar B)Posts one constraint that expresses : (x < y) ⇔ b.default voidreifyXltYC(IntVar X, IntVar Y, int C, BoolVar B)Posts one constraint that expresses : (x < y + c) ⇔ b.default voidreifyXneC(IntVar X, int C, BoolVar B)Posts one constraint that expresses : (x ≠ c) ⇔ b.default voidreifyXneY(IntVar X, IntVar Y, BoolVar B)Posts one constraint that expresses : (x ≠ y) ⇔ b.
-
-
-
Method Detail
-
ifThenElse
default void ifThenElse(Constraint ifCstr, Constraint thenCstr, Constraint elseCstr)
Posts a constraint ensuring that if ifCstr is satisfied, then thenCstr must be satisfied as well Otherwise, elseCstr must be satisfied ifCstr => ThenCstr not(ifCstr) => ElseCstr BEWARE : it is automatically posted (it cannot be reified)- Parameters:
ifCstr- a constraintthenCstr- a constraintelseCstr- a constraint
-
ifThenElse
default void ifThenElse(BoolVar ifVar, Constraint thenCstr, Constraint elseCstr)
Posts an implication constraint: ifVar => thenCstr && not(ifVar) => elseCstr.
Ensures: - ifVar = 1 => thenCstr is satisfied,
- ifVar = 0 => elseCstr is satisfied,
- thenCstr is not satisfied => ifVar = 0
- elseCstr is not satisfied => ifVar = 1
In order to get ifVar <=> thenCstr, use reification BEWARE : it is automatically posted (it cannot be reified)- Parameters:
ifVar- variable of reificationthenCstr- the constraint to be satisfied when ifVar = 1elseCstr- the constraint to be satisfied when ifVar = 0
-
ifThen
default void ifThen(Constraint ifCstr, Constraint thenCstr)
Posts a constraint ensuring that if ifCstr is satisfied, then thenCstr is satisfied as well BEWARE : it is automatically posted (it cannot be reified)- Parameters:
ifCstr- a constraintthenCstr- a constraint
-
ifThen
default void ifThen(BoolVar ifVar, Constraint thenCstr)
Posts an implication constraint: ifVar => thenCstr Also called half reification constraint Ensures:
- ifVar = 1 => thenCstr is satisfied,
- thenCstr is not satisfied => ifVar = 0
Example :
-ifThen(b1, arithm(v1, "=", 2));: b1 is equal to 1 => v1 = 2, so v1 != 2 => b1 is equal to 0 But if b1 is equal to 0, nothing happens BEWARE : it is automatically posted (it cannot be reified)- Parameters:
ifVar- variable of reificationthenCstr- the constraint to be satisfied when ifVar = 1
-
ifOnlyIf
default void ifOnlyIf(Constraint cstr1, Constraint cstr2)
Posts an equivalence constraint stating that cstr1 is satisfied <=> cstr2 is satisfied, BEWARE : it is automatically posted (it cannot be reified)- Parameters:
cstr1- a constraint to be satisfied if and only if cstr2 is satisfiedcstr2- a constraint to be satisfied if and only if cstr1 is satisfied
-
reification
default void reification(BoolVar var, Constraint cstr)
Reify a constraint with a boolean variable: var = 1 <=> cstr is satisfied, Equivalent to ifOnlyIf BEWARE : it is automatically posted (it cannot be reified)- Parameters:
var- variable of reificationcstr- the constraint to be satisfied if and only if var = 1
-
reifyXeqC
default void reifyXeqC(IntVar X, int C, BoolVar B)
Posts one constraint that expresses : (x = c) ⇔ b. Bypasses the reification system.- Parameters:
X- a integer variableC- an intB- a boolean variable
-
reifyXneC
default void reifyXneC(IntVar X, int C, BoolVar B)
Posts one constraint that expresses : (x ≠ c) ⇔ b. Bypasses the reification system.- Parameters:
X- a integer variableC- an intB- a boolean variable
-
reifyXeqY
default void reifyXeqY(IntVar X, IntVar Y, BoolVar B)
Posts one constraint that expresses : (x = y) ⇔ b. Bypasses the reification system.- Parameters:
X- an integer variableY- an integer variableB- a boolean variable
-
reifyXneY
default void reifyXneY(IntVar X, IntVar Y, BoolVar B)
Posts one constraint that expresses : (x ≠ y) ⇔ b. Bypasses the reification system.- Parameters:
X- an integer variableY- an integer variableB- a boolean variable
-
reifyXltC
default void reifyXltC(IntVar X, int C, BoolVar B)
Posts one constraint that expresses : (x < c) ⇔ b. Bypasses the reification system.- Parameters:
X- a integer variableC- an intB- a boolean variable
-
reifyXltY
default void reifyXltY(IntVar X, IntVar Y, BoolVar B)
Posts one constraint that expresses : (x < y) ⇔ b. Bypasses the reification system.- Parameters:
X- an integer variableY- an integer variableB- a boolean variable
-
reifyXleY
default void reifyXleY(IntVar X, IntVar Y, BoolVar B)
Posts one constraint that expresses : (x ≤ y) ⇔ b. Bypasses the reification system.- Parameters:
X- an integer variableY- an integer variableB- a boolean variable
-
reifyXltYC
default void reifyXltYC(IntVar X, IntVar Y, int C, BoolVar B)
Posts one constraint that expresses : (x < y + c) ⇔ b. Bypasses the reification system.- Parameters:
X- an integer variableY- an integer variableC- an intB- a boolean variable
-
reifyXgtC
default void reifyXgtC(IntVar X, int C, BoolVar B)
Posts one constraint that expresses : (x > c) ⇔ b. Bypasses the reification system.- Parameters:
X- a integer variableC- an intB- a boolean variable
-
reifyXinS
default void reifyXinS(IntVar X, IntIterableRangeSet S, BoolVar B)
Posts one constraint that expresses : (X ∈ S) ⇔ B. Bypasses the reification system.- Parameters:
X- an integer variableS- a set of valuesB- a boolean variable
-
-