public abstract class MetaConstraint extends Constraint
MetaConstraint is a generalization of the concept of constraint in classical CSPs. Like variables in a metaCSP,
constraints are often implicit - e.g., a resource in scheduling, whose principal feature is a capacity; or an operator in planning,
whose principal features are expressed as preconditions and effects. All MetaConstraints have in common a number of
features:
MetaVariables in the meta-CSP - e.g., ordering constraints
for the activities in a scheduling problem. MetaConstraints.
For instance, in scheduling, a variable ordering heuristic may use the capacity of a resource to assess how critical a particular
conflict set is.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
independentMC |
protected MetaConstraintSolver |
metaCS |
protected ValueOrderingH |
valOH |
protected VariableOrderingH |
varOH |
annotation, autoRemovable, color, id, logger, masked, numIDs, scope| Constructor and Description |
|---|
MetaConstraint(VariableOrderingH varOH,
ValueOrderingH valOH)
Creates a
MetaConstraint with given variable and value ordering heuristics (one or both of these can be null). |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
draw(ConstraintNetwork network)
Method to draw the metaCSP's constraint network according to the rationale of
this
MetaConstraint (e.g., for a resource, this could be the resource usage profile
as it is determined by the given constraint network). |
java.lang.String |
getDescription()
Get the description of this
Constraint's type. |
abstract ConstraintSolver |
getGroundSolver()
Provides the definition of how to get the/a groundSolver for this
MetaConstraint. |
ConstraintNetwork |
getMetaValue(MetaVariable metaVariable)
Get one meta value for a given
MetaVariable. |
abstract ConstraintNetwork[] |
getMetaValues(MetaVariable metaVariable)
Get all meta values for a given
MetaVariable. |
ConstraintNetwork |
getMetaVariable()
Get one
MetaVariable according to this MetaConstraint. |
abstract ConstraintNetwork[] |
getMetaVariables()
Get all
MetaVariables according to this MetaConstraint. |
ValueOrderingH |
getValOH()
Method to get the Value Ordering heuristic used by this
MetaConstraint. |
VariableOrderingH |
getVarOH()
Method to get the Variable Ordering heuristic used by this
MetaConstraint. |
abstract void |
markResolvedSub(MetaVariable metaVariable,
ConstraintNetwork metaValue)
Method to mark a
MetaVariable as solved. |
void |
setMetaSolver(MetaConstraintSolver metaCS)
Set the
MetaConstraintSolver of this MetaConstraint. |
void |
setValOH(ValueOrderingH valOH)
Method to set the Value Ordering heuristic of this
MetaConstraint. |
void |
setVarOH(VariableOrderingH varOH)
Method to set the Variable Ordering heuristic of this
MetaConstraint. |
clone, getAnnotation, getColor, getEdgeLabel, getID, getScope, isAutoRemovable, isEquivalent, isMasked, isSkippableSolver, isUnary, mask, setAnnotation, setAutoRemovable, setColor, setScope, skipSolver, toString, unmaskprotected VariableOrderingH varOH
protected ValueOrderingH valOH
protected MetaConstraintSolver metaCS
protected boolean independentMC
public MetaConstraint(VariableOrderingH varOH, ValueOrderingH valOH)
MetaConstraint with given variable and value ordering heuristics (one or both of these can be null).
This constructor must be called by the implementing class.varOH - The variable ordering heuristic to be used by the meta-CSP search when dealing with this MetaConstraint.valOH - The value ordering heuristic to be used by the meta-CSP search when dealing with this MetaConstraint.public void setMetaSolver(MetaConstraintSolver metaCS)
MetaConstraintSolver of this MetaConstraint.metaCS - The MetaConstraintSolver of this MetaConstraint.public ConstraintNetwork getMetaVariable()
MetaVariable according to this MetaConstraint. This returns the
highest-priority MetaVariable according to this MetaConstraint's variable ordering heuristic.MetaVariable according to this MetaConstraint.public abstract ConstraintNetwork[] getMetaVariables()
MetaVariables according to this MetaConstraint. This method must be implemented by the
designer of the implementing MetaConstraint class.MetaVariables according to this MetaConstraint.public ConstraintNetwork getMetaValue(MetaVariable metaVariable)
MetaVariable. Note that this calls
the getMetaValues method (which must be implemented in the specific
MetaConstraint) and returns the value with highest score as determined
by this MetaConstraint's ValueOrderingH.metaVariable - The MetaVariable for which we seek a meta value.MetaVariable.public abstract ConstraintNetwork[] getMetaValues(MetaVariable metaVariable)
MetaVariable. This method must be
implemented in the specific MetaConstraint.metaVariable - The MetaVariable for which we seek meta values.MetaVariable.public abstract void markResolvedSub(MetaVariable metaVariable, ConstraintNetwork metaValue)
MetaVariable as solved. This method is called by the
MetaConstraintSolver and must be implemented by the developer of the
MetaConstraint.metaVariable - The MetaVariable that is to be considered solved by
the given meta value.metaValue - The solving meta value.public abstract void draw(ConstraintNetwork network)
MetaConstraint (e.g., for a resource, this could be the resource usage profile
as it is determined by the given constraint network). This method must be implemented by the
developer of the MetaConstraint.network - The constraint network to draw.public java.lang.String getDescription()
ConstraintConstraint's type.getDescription in class ConstraintConstraint's type.public VariableOrderingH getVarOH()
MetaConstraint.MetaConstraint.public void setVarOH(VariableOrderingH varOH)
MetaConstraint.varOH - the Variable Ordering heuristic of this MetaConstraintpublic ValueOrderingH getValOH()
MetaConstraint.MetaConstraint.public void setValOH(ValueOrderingH valOH)
MetaConstraint.valOH - the Value Ordering heuristic of this MetaConstraintpublic abstract ConstraintSolver getGroundSolver()
MetaConstraint.MetaConstraint.