Package org.jacop.constraints
Class DisjointCondVar
java.lang.Object
org.jacop.constraints.DisjointCondVar
- All Implemented Interfaces:
Stateful
,MutableVar
Defines a Variable for Diff2 constraints and related operations on it. It
keeps current recatngles for evaluation ([[R2, R3], [R1, R3], ...]
- Version:
- 4.9
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
(package private) Store
(package private) DisjointCondVarValue
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescription(package private) int
index()
previous()
It returns the earlier value of variable comparing to the current one.void
removeLevel
(int removeLevel) This function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid.void
It replace the current representation of the value with a new representation.(package private) int
stamp()
toString()
It returns string representation of Mutable variable.void
update
(MutableVarValue val) It updates the value of a mutable variable based on value given as a parameter, the stamp level of current value and stamp value of passed value.value()
It returns current value of MutableVariable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jacop.api.Stateful
isStateful
-
Field Details
-
index
int index -
store
Store store -
value
DisjointCondVarValue value
-
-
Constructor Details
-
DisjointCondVar
DisjointCondVar(Store S) -
DisjointCondVar
DisjointCondVar(Store S, RectangleWithCondition[] R) -
DisjointCondVar
DisjointCondVar(Store S, List<RectangleWithCondition> R)
-
-
Method Details
-
index
int index() -
previous
Description copied from interface:MutableVar
It returns the earlier value of variable comparing to the current one.- Specified by:
previous
in interfaceMutableVar
- Returns:
- previous value of a mutable variable.
-
removeLevel
public void removeLevel(int removeLevel) Description copied from interface:Stateful
This function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid. This function is called *before* all timestamps, variables, mutablevariables have reverted to their previous value.- Specified by:
removeLevel
in interfaceStateful
- Parameters:
removeLevel
- the level which is being removed.
-
setCurrent
Description copied from interface:MutableVar
It replace the current representation of the value with a new representation. It ignores the store level.- Specified by:
setCurrent
in interfaceMutableVar
- Parameters:
o
- value to which a mutable variable is set.
-
stamp
int stamp() -
toString
Description copied from interface:MutableVar
It returns string representation of Mutable variable.- Specified by:
toString
in interfaceMutableVar
- Overrides:
toString
in classObject
-
update
Description copied from interface:MutableVar
It updates the value of a mutable variable based on value given as a parameter, the stamp level of current value and stamp value of passed value.- Specified by:
update
in interfaceMutableVar
- Parameters:
val
- it specifies the new value of a mutable variable.
-
value
Description copied from interface:MutableVar
It returns current value of MutableVariable.- Specified by:
value
in interfaceMutableVar
- Returns:
- current value of the mutable variable.
-