ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.rules
Class AbleHierarchicalPlanningRule

java.lang.Object
  extended bycom.ibm.able.rules.AbleRule
      extended bycom.ibm.able.rules.AblePlanningRule
          extended bycom.ibm.able.rules.AbleHierarchicalPlanningRule
All Implemented Interfaces:
java.io.Serializable

public class AbleHierarchicalPlanningRule
extends AblePlanningRule
implements java.io.Serializable

This class defines a hierarchical planning rule (action or operator) which consists of a set of formal parameters, a preCondition expression, a set of effects, and one or more expansion sets.

See Also:
AblePlanningEngine, Serialized Form

Field Summary
protected  java.util.Vector myExpansions
          myExpansions is a Vector of Vectors of consequent clauses (AbleConsequentClause objects).
 
Fields inherited from class com.ibm.able.rules.AblePlanningRule
myBindings, myEffects, myParameters, myPrecondition
 
Fields inherited from class com.ibm.able.rules.AbleRule
myBooleanTruth, myBreakpoint, myComment, myEnabled, myFinalFlag, myFiredCount, myFiredFlag, myId, myLabel, myLocation, myPreConditions, myPriority, myPrompt, myProperties, myRdRefs, myRuleBlock, myRuleSet, myTemplateFlag, myTemplateName, myTemplateValues, myWrRefs, PriorityDefault, RuleIdInitial
 
Constructor Summary
AbleHierarchicalPlanningRule(java.lang.String theLabel, AbleRd thePriority, java.util.Vector theParameters, AbleExpression thePrecondition, java.util.Vector theEffects, java.util.Vector theExpansions, AbleRuleSet theRuleSet)
          Create a new planning rule with the specified priority, preconditions and effects.
 
Method Summary
 java.lang.String arlString()
          Return a formal Able Rule Language (ARL) String.
 java.lang.String armlString()
          Return a formal XML string.
 java.util.Vector getExpansions()
          Retrieve the rule's list of possible expansions.
 java.lang.String getTemplateString(java.util.Vector theTemplateVars)
          Retrieve a text format string for use by rule templates.
 java.lang.String traceString(int theTraceStringFlavor)
          Retrieve a string describing (the contents of) the object.
 java.lang.String xmlString()
          Return a formal XML string.
 
Methods inherited from class com.ibm.able.rules.AblePlanningRule
getBindings, getEffects, getParameters, getPrecondition, getRuleBindings, getVariables, isTriggered, removeBindings, reset, setBindings, setBindings, toString
 
Methods inherited from class com.ibm.able.rules.AbleRule
addHeaderRdReferences, addRdReference, addRdReferences, addWrReference, addWrReferences, arlActionBlockString, arlPreConditionsString, armlPreConditionsString, armlPriorityString, armlPropertiesString, checkTimePeriodPreConditions, clearBreakpoint, getArlComment, getBooleanTruth, getBreakpoint, getComment, getId, getIdLabelString, getLabel, getLocation, getMetaData, getPreConditions, getPriority, getPrompt, getPromptString, getProperties, getProperty, getRdReferences, getTemplateActionBlockString, getTemplateHeaderString, getTemplateName, getTemplateValues, getTemplateVars, getWrReferences, isDefaultPriority, isEnabled, isFinal, isFired, isGeneratedFromTemplate, isTemplate, logTrace, removeProperty, setBooleanTruth, setBreakpoint, setComment, setEnabled, setFinal, setFired, setId, setLocation, setMetaData, setPreConditions, setPriority, setPrompt, setProperties, setProperty, setTemplate, setTemplateName, setTemplateValues, xmlPreConditionsString, xmlPriorityString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myExpansions

protected java.util.Vector myExpansions
myExpansions is a Vector of Vectors of consequent clauses (AbleConsequentClause objects).

Constructor Detail

AbleHierarchicalPlanningRule

public AbleHierarchicalPlanningRule(java.lang.String theLabel,
                                    AbleRd thePriority,
                                    java.util.Vector theParameters,
                                    AbleExpression thePrecondition,
                                    java.util.Vector theEffects,
                                    java.util.Vector theExpansions,
                                    AbleRuleSet theRuleSet)
Create a new planning rule with the specified priority, preconditions and effects.

Parameters:
theLabel - The unique label, or name, of this rule.

thePriority - The priority of this rule.

theParameters - A list of AbleVariable objects that define the formal parameters of this rule.
thePrecondition - A boolean AbleExpression that defines the necessary precondition of this rule.

theEffects - A list of AbleConsequentClause objects that define the consequents or actions of this rule.

* @param theExpansions A Vector of Vectors of AbleConsequentClause objects that define the possible expansions of this rule.

* @param theRuleSet A ruleset that provides the context for this rule.

Method Detail

getExpansions

public final java.util.Vector getExpansions()
Retrieve the rule's list of possible expansions.

Returns:
A reference to the actual list of expansions This list may not be empty.

arlString

public java.lang.String arlString()
Return a formal Able Rule Language (ARL) String.

Overrides:
arlString in class AblePlanningRule
Returns:
A String describing the object in Able rule language.

xmlString

public java.lang.String xmlString()
Return a formal XML string.

Overrides:
xmlString in class AblePlanningRule
Returns:
A String describing the object in XML.

armlString

public java.lang.String armlString()
Return a formal XML string.

Overrides:
armlString in class AblePlanningRule
Returns:
A String describing the object in XML.

getTemplateString

public java.lang.String getTemplateString(java.util.Vector theTemplateVars)
                                   throws AbleDataException
Retrieve a text format string for use by rule templates. The string contains "{n}" strings, where the index 'n' corresponds to the template variables defined in the rule template. This string is based on the standard arlString() representation of the rule. After replacement of the template variable values, the resulting string must be a valid ARL format string that can be parsed.

Overrides:
getTemplateString in class AblePlanningRule
Parameters:
theTemplateVars - An ordered list of template variables referenced by this rule.
Returns:
A Text format string used to create a new rule instance.
Throws:
AbleDataException
See Also:
AbleRuleTemplate

traceString

public java.lang.String traceString(int theTraceStringFlavor)
Retrieve a string describing (the contents of) the object.

Overrides:
traceString in class AblePlanningRule
Parameters:
theTraceStringFlavor - An Able.TraceStringFlavor value.

Returns:
A String containing the current contents of the object.

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005