public abstract class Constraint extends DecomposedConstraint
Modifier and Type | Field and Description |
---|---|
boolean |
atomicExecution
It specifies if the constraint consistency function requires consistency function
executed in one atomic step.
|
java.util.Hashtable<Var,java.lang.Integer> |
consistencyPruningEvents
It specifies the event which must occur in order for the consistency function to
be called.
|
boolean |
earlyTerminationOK
It specifies if the constraint consistency function can be prematurely terminated
through other than FailureException exception.
|
java.lang.String |
id
It specifies the string id of the constraint.
|
boolean |
increaseWeight
It specifies if upon the failure of the constraint, all variables
in the constraint scope should have their weight increased.
|
int |
numberArgs
It specifies the number of variables in the constraint scope.
|
int |
numberId
It specifies the number id for a given constraint.
|
queueIndex
Constructor and Description |
---|
Constraint() |
Modifier and Type | Method and Description |
---|---|
abstract java.util.ArrayList<Var> |
arguments()
It returns the variables in a scope of the constraint.
|
void |
cleanAfterFailure()
It is executed after the constraint has failed.
|
abstract void |
consistency(Store store)
It is a (most probably incomplete) consistency function which removes the
values from variables domains.
|
java.util.ArrayList<Constraint> |
decompose(Store store)
It returns an array list of constraint which are used to decompose this
constraint.
|
abstract int |
getConsistencyPruningEvent(Var var)
It retrieves the pruning event which causes reevaluation of the
constraint.
|
Constraint |
getGuideConstraint()
It specifies a constraint which if imposed by search will enhance
propagation of this constraint.
|
int |
getGuideValue()
This function provides a value which if assigned to a variable returned
by getGuideVariable() will enhance propagation of this constraint.
|
Var |
getGuideVariable()
This function provides a variable which assigned a value returned
by will enhance propagation of this constraint.
|
abstract java.lang.String |
id()
It gives the id string of a constraint.
|
abstract void |
impose(Store store)
It imposes the constraint in a given store.
|
void |
impose(Store store,
int queueIndex)
It imposes the constraint and adjusts the queue index.
|
void |
imposeDecomposition(Store store)
It imposes the decomposition of the given constraint in a given store.
|
abstract void |
increaseWeight()
It increases the weight of the variables in the constraint scope.
|
int |
numberArgs()
It returns the number of variables within a constraint scope.
|
void |
queueVariable(int level,
Var var)
This is a function called to indicate which variable in a scope of
constraint has changed.
|
abstract void |
removeConstraint()
It removes the constraint by removing this constraint from all variables.
|
void |
removeLevel(int level)
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 |
removeLevelLate(int level)
This function is called in case of the backtrack.
|
boolean |
requiresMonotonicity()
It specifies if the constraint allows domains of variables
in its scope only to shrink its domain with the progress
of search downwards.
|
abstract boolean |
satisfied()
It checks if the constraint is satisfied.
|
void |
setConsistencyPruningEvent(Var var,
int pruningEvent)
It allows to customize the event for a given variable which
causes the re-execution of the consistency method for a constraint.
|
void |
supplyGuideFeedback(boolean feedback)
This function allows to provide a guide feedback.
|
abstract java.lang.String |
toString()
It produces a string representation of a constraint state.
|
auxiliaryVariables, imposeDecomposition
public int numberId
public java.lang.String id
public boolean increaseWeight
public int numberArgs
public java.util.Hashtable<Var,java.lang.Integer> consistencyPruningEvents
public boolean earlyTerminationOK
public boolean atomicExecution
public abstract java.util.ArrayList<Var> arguments()
public void removeLevel(int level)
level
- the level which is being removed.public void removeLevelLate(int level)
level
- the level which is being removed.public abstract void consistency(Store store)
store
- constraint store within which the constraint consistency is being checked.public abstract int getConsistencyPruningEvent(Var var)
var
- variable for which pruning event is retrievedpublic abstract java.lang.String id()
public abstract void impose(Store store)
store
- the constraint store to which the constraint is imposed to.public void impose(Store store, int queueIndex)
store
- the constraint store to which the constraint is imposed to.queueIndex
- the index of the queue in the store it is assigned to.public void queueVariable(int level, Var var)
level
- the level of the store at which the change has occurred.var
- variable which has changed.public abstract void removeConstraint()
public abstract boolean satisfied()
public abstract java.lang.String toString()
toString
in class java.lang.Object
public Constraint getGuideConstraint()
public Var getGuideVariable()
public int getGuideValue()
public void supplyGuideFeedback(boolean feedback)
feedback
- true if the guide was useful, false otherwise.public abstract void increaseWeight()
public void setConsistencyPruningEvent(Var var, int pruningEvent)
var
- variable for which the events are customized.pruningEvent
- the event which must occur to trigger execution of the consistency method.public int numberArgs()
public boolean requiresMonotonicity()
public void imposeDecomposition(Store store)
imposeDecomposition
in class DecomposedConstraint
store
- the constraint store to which the constraint is imposed to.public java.util.ArrayList<Constraint> decompose(Store store)
decompose
in class DecomposedConstraint
store
- the constraint store in which context the decomposition takes place.public void cleanAfterFailure()