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
public class VariableTrace extends Constraint implements UsesQueueVariable, RemoveLevelLate
VariableTrace is a daemon that prints information on variables whenever they are changed.- Version:
- 4.7
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.util.concurrent.atomic.AtomicInteger
idNumber
(package private) Store
store
(package private) Var[]
vars
-
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
Constructors Constructor Description VariableTrace(java.util.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consistency(Store store)
It is a (most probably incomplete) consistency function which removes the values from variables domains.int
getDefaultConsistencyPruningEvent()
void
impose(Store store)
It imposes the constraint in a given store.void
increaseWeight()
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
removeConstraint()
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
satisfied()
java.lang.String
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
-
-
-
-
Constructor Detail
-
VariableTrace
public VariableTrace(Var v)
It constructs trace daemon for variable v- Parameters:
v
- variable to be traced
-
VariableTrace
public VariableTrace(Var[] vs)
It constructs trace daemon for variables vs- Parameters:
vs
- variables to be traced
-
VariableTrace
public VariableTrace(java.util.List<Var> vs)
It constructs trace daemon for variables vs- Parameters:
vs
- variables to be traced
-
-
Method Detail
-
impose
public void impose(Store store)
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
public void consistency(Store store)
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
public void queueVariable(int level, Var var)
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
public java.lang.String 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
-
-