public class SimpleDomain extends MetaConstraint
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleDomain.markings |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Vector<java.lang.String> |
actuators |
protected java.util.Vector<java.lang.String> |
contextVars |
protected java.util.HashMap<SimpleReusableResource,java.util.HashMap<Variable,java.lang.Integer>> |
currentResourceUtilizers |
protected long |
filteringTime |
protected java.util.Vector<SimpleOperator> |
operators |
protected java.util.HashMap<SimpleOperator,java.lang.Integer> |
operatorsLevels |
protected java.lang.String[] |
resourceNames |
protected java.util.HashMap<java.lang.String,SimpleReusableResource> |
resourcesMap |
protected java.util.Vector<java.lang.String> |
sensors |
java.util.HashMap<SymbolicVariableActivity,SymbolicVariableActivity> |
unificationTrack |
independentMC, metaCS, valOH, varOHannotation, autoRemovable, color, id, logger, masked, numIDs, scope| Modifier | Constructor and Description |
|---|---|
|
SimpleDomain(int[] capacities,
java.lang.String[] resourceNames,
java.lang.String domainName) |
protected |
SimpleDomain(int[] capacities,
java.lang.String[] resourceNames,
java.lang.String domainName,
java.lang.String everything) |
| Modifier and Type | Method and Description |
|---|---|
void |
addActuator(java.lang.String actuator) |
void |
addContextVar(java.lang.String cv) |
void |
addOperator(SimpleOperator r) |
void |
addResourceMap(java.lang.String resourcename,
SimpleReusableResource simpleReusableResource) |
void |
addResourceUtilizer(SimpleReusableResource rr,
Variable var,
java.lang.Integer amount) |
void |
addResourceUtilizers(SimpleReusableResource rr,
java.util.HashMap<Variable,java.lang.Integer> hm) |
void |
addSensor(java.lang.String sensor) |
java.lang.Object |
clone() |
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). |
protected ConstraintNetwork |
expandOperator(SimpleOperator possibleOperator,
SymbolicVariableActivity problematicActivity) |
java.lang.String[] |
getActuators() |
java.util.HashMap<SimpleReusableResource,java.util.HashMap<Variable,java.lang.Integer>> |
getAllResourceUsageLevel() |
java.lang.String[] |
getContextVars() |
SimpleReusableResource[] |
getCurrentReusableResourcesUsedByActivity(Variable act) |
java.lang.String |
getEdgeLabel()
Every
Constraint should implement this method - its value is
what is drawn by the ConstraintNetwork rendering methods. |
ConstraintSolver |
getGroundSolver()
Provides the definition of how to get the/a groundSolver for this
MetaConstraint. |
ConstraintNetwork[] |
getMetaValues(MetaVariable metaVariable)
Get all meta values for a given
MetaVariable. |
ConstraintNetwork[] |
getMetaVariables()
Get all
MetaVariables according to this MetaConstraint. |
SimpleOperator[] |
getOperators() |
java.util.HashMap<java.lang.String,SimpleReusableResource> |
getResources() |
int |
getResourceUsageLevel(SimpleReusableResource rr,
Variable act) |
Schedulable[] |
getSchedulingMetaConstraints() |
java.lang.String[] |
getSensors() |
java.lang.String[] |
getTimelines() |
protected ConstraintNetwork[] |
getUnifications(SymbolicVariableActivity activity) |
java.util.HashMap<SymbolicVariableActivity,SymbolicVariableActivity> |
getUnificationTrack() |
static java.lang.String |
instantiateVariable(java.lang.String var) |
boolean |
isActuator(java.lang.String component) |
boolean |
isContextVar(java.lang.String component) |
boolean |
isEquivalent(Constraint c)
Method for assessing the "equivalence" between two constraints.
|
boolean |
isSensor(java.lang.String component) |
void |
markResolvedSub(MetaVariable con,
ConstraintNetwork metaValue)
Method to mark a
MetaVariable as solved. |
static SimpleDomain |
parseDomain(MetaConstraintSolver sp,
java.lang.String filename,
java.lang.Class<?> domainType)
Parses a domain file (see domains/testDomain.ddl for an example), instantiates
the necessary
MetaConstraints and adds them to the provided SimplePlanner. |
protected static java.lang.String[] |
parseKeyword(java.lang.String keyword,
java.lang.String everything) |
java.lang.String[] |
parseUserKeyword(java.lang.String keyword)
Parse a user-defined keyword in the domain, in the form
(UserKeyword value1 [value2 ... |
protected static java.util.HashMap<java.lang.String,java.lang.Integer> |
processResources(java.lang.String[] resources) |
void |
resetAllResourceAllocation() |
void |
setFileteringTime(long filteringTime) |
java.lang.String |
toString()
Every
Constraint should implement a toString method (used by the
ConstraintNetwork rendering methods). |
getDescription, getMetaValue, getMetaVariable, getValOH, getVarOH, setMetaSolver, setValOH, setVarOHgetAnnotation, getColor, getID, getScope, isAutoRemovable, isMasked, isSkippableSolver, isUnary, mask, setAnnotation, setAutoRemovable, setColor, setScope, skipSolver, unmaskprotected java.util.Vector<SimpleOperator> operators
protected java.lang.String[] resourceNames
protected java.util.HashMap<java.lang.String,SimpleReusableResource> resourcesMap
protected java.util.HashMap<SimpleReusableResource,java.util.HashMap<Variable,java.lang.Integer>> currentResourceUtilizers
protected long filteringTime
protected java.util.Vector<java.lang.String> sensors
protected java.util.Vector<java.lang.String> actuators
protected java.util.Vector<java.lang.String> contextVars
protected java.util.HashMap<SimpleOperator,java.lang.Integer> operatorsLevels
public java.util.HashMap<SymbolicVariableActivity,SymbolicVariableActivity> unificationTrack
public SimpleDomain(int[] capacities,
java.lang.String[] resourceNames,
java.lang.String domainName)
protected SimpleDomain(int[] capacities,
java.lang.String[] resourceNames,
java.lang.String domainName,
java.lang.String everything)
public java.lang.String[] getTimelines()
public Schedulable[] getSchedulingMetaConstraints()
public java.util.HashMap<SymbolicVariableActivity,SymbolicVariableActivity> getUnificationTrack()
public void setFileteringTime(long filteringTime)
public void addResourceUtilizers(SimpleReusableResource rr, java.util.HashMap<Variable,java.lang.Integer> hm)
public void addResourceUtilizer(SimpleReusableResource rr, Variable var, java.lang.Integer amount)
public void addResourceMap(java.lang.String resourcename,
SimpleReusableResource simpleReusableResource)
public void addOperator(SimpleOperator r)
public SimpleOperator[] getOperators()
public ConstraintSolver getGroundSolver()
MetaConstraintMetaConstraint.getGroundSolver in class MetaConstraintMetaConstraint.public ConstraintNetwork[] getMetaVariables()
MetaConstraintMetaVariables according to this MetaConstraint. This method must be implemented by the
designer of the implementing MetaConstraint class.getMetaVariables in class MetaConstraintMetaVariables according to this MetaConstraint.protected ConstraintNetwork expandOperator(SimpleOperator possibleOperator, SymbolicVariableActivity problematicActivity)
public void addSensor(java.lang.String sensor)
public java.lang.String[] getSensors()
public void addActuator(java.lang.String actuator)
public java.lang.String[] getActuators()
public void addContextVar(java.lang.String cv)
public java.lang.String[] getContextVars()
public boolean isSensor(java.lang.String component)
public boolean isActuator(java.lang.String component)
public boolean isContextVar(java.lang.String component)
protected ConstraintNetwork[] getUnifications(SymbolicVariableActivity activity)
public ConstraintNetwork[] getMetaValues(MetaVariable metaVariable)
MetaConstraintMetaVariable. This method must be
implemented in the specific MetaConstraint.getMetaValues in class MetaConstraintmetaVariable - The MetaVariable for which we seek meta values.MetaVariable.public void markResolvedSub(MetaVariable con, ConstraintNetwork metaValue)
MetaConstraintMetaVariable as solved. This method is called by the
MetaConstraintSolver and must be implemented by the developer of the
MetaConstraint.markResolvedSub in class MetaConstraintcon - The MetaVariable that is to be considered solved by
the given meta value.metaValue - The solving meta value.public void draw(ConstraintNetwork network)
MetaConstraintMetaConstraint (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.draw in class MetaConstraintnetwork - The constraint network to draw.public java.util.HashMap<java.lang.String,SimpleReusableResource> getResources()
public SimpleReusableResource[] getCurrentReusableResourcesUsedByActivity(Variable act)
public int getResourceUsageLevel(SimpleReusableResource rr, Variable act)
public java.util.HashMap<SimpleReusableResource,java.util.HashMap<Variable,java.lang.Integer>> getAllResourceUsageLevel()
public void resetAllResourceAllocation()
public java.lang.String toString()
ConstraintConstraint should implement a toString method (used by the
ConstraintNetwork rendering methods).toString in class ConstraintString representation of this Constraint.public java.lang.String getEdgeLabel()
ConstraintConstraint should implement this method - its value is
what is drawn by the ConstraintNetwork rendering methods.getEdgeLabel in class ConstraintString representation of the constraint to be used for
ConstraintNetwork rendering.public java.lang.Object clone()
clone in class Constraintpublic boolean isEquivalent(Constraint c)
ConstraintisEquivalent in class Constraintc - The Constraint to compare against.true iff the two constraints are considered to be equivalent.public static java.lang.String instantiateVariable(java.lang.String var)
protected static java.lang.String[] parseKeyword(java.lang.String keyword,
java.lang.String everything)
protected static java.util.HashMap<java.lang.String,java.lang.Integer> processResources(java.lang.String[] resources)
public java.lang.String[] parseUserKeyword(java.lang.String keyword)
(UserKeyword value1 [value2 ... valueN])keyword - The keyword to parse, i.e., UserKeyword["value11 value12", "value21 value22 value23", "value31", ...]public static SimpleDomain parseDomain(MetaConstraintSolver sp, java.lang.String filename, java.lang.Class<?> domainType)
MetaConstraints and adds them to the provided SimplePlanner.sp - The SimplePlanner that will use this domain.filename - Text file containing the domain definition.