Package org.jacop.constraints
Class VariableTrace
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.VariableTrace
- All Implemented Interfaces:
RemoveLevelLate
,UsesQueueVariable
VariableTrace is a daemon that prints information on variables whenever they are changed.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static AtomicInteger
(package private) Store
(package private) Var[]
Fields inherited from class org.jacop.constraints.Constraint
afcWeight, atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace, watchedVariableGrounded
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
Constructor Summary
ConstructorsConstructorDescriptionVariableTrace
(List<Var> vs) It constructs trace daemon for variables vsVariableTrace
(Var v) It constructs trace daemon for variable vVariableTrace
(Var[] vs) It constructs trace daemon for variables vs -
Method Summary
Modifier and TypeMethodDescriptionvoid
consistency
(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.int
void
It imposes the constraint in a given store.void
It increases the weight of the variables in the constraint scope.void
queueVariable
(int level, Var var) This is a function called to indicate which variable in a scope of constraint has changed.void
It removes the constraint by removing this constraint from all variables.void
removeLevelLate
(int level) This function is called in case of the backtrack.boolean
toString()
It produces a string representation of a constraint state.Methods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, imposeDecomposition, intArrayToString, long2int, numberArgs, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, toInt, toInt, updateAFC, watchedVariableGrounded
Methods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
Field Details
-
Constructor Details
-
VariableTrace
It constructs trace daemon for variable v- Parameters:
v
- variable to be traced
-
VariableTrace
It constructs trace daemon for variables vs- Parameters:
vs
- variables to be traced
-
VariableTrace
It constructs trace daemon for variables vs- Parameters:
vs
- variables to be traced
-
-
Method Details
-
impose
Description copied from class:Constraint
It imposes the constraint in a given store.- Overrides:
impose
in classConstraint
- Parameters:
store
- the constraint store to which the constraint is imposed to.
-
consistency
Description copied from class:Constraint
It is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.- Specified by:
consistency
in classConstraint
- Parameters:
store
- constraint store within which the constraint consistency is being checked.
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Specified by:
getDefaultConsistencyPruningEvent
in classConstraint
-
queueVariable
Description copied from class:Constraint
This is a function called to indicate which variable in a scope of constraint has changed. It also indicates a store level at which the change has occurred.- Overrides:
queueVariable
in classConstraint
- Parameters:
level
- the level of the store at which the change has occurred.var
- variable which has changed.
-
removeLevelLate
public void removeLevelLate(int level) Description copied from interface:RemoveLevelLate
This function is called in case of the backtrack. It is called after all timestamps, variables, mutablevariables have reverted to their values *after* removing the level.- Specified by:
removeLevelLate
in interfaceRemoveLevelLate
- Parameters:
level
- the level which is being removed.
-
removeConstraint
public void removeConstraint()Description copied from class:Constraint
It removes the constraint by removing this constraint from all variables.- Overrides:
removeConstraint
in classConstraint
-
satisfied
public boolean satisfied() -
toString
Description copied from class:Constraint
It produces a string representation of a constraint state.- Overrides:
toString
in classConstraint
-
increaseWeight
public void increaseWeight()Description copied from class:Constraint
It increases the weight of the variables in the constraint scope.- Overrides:
increaseWeight
in classConstraint
-