Class Task

java.lang.Object
  |
  +--Node
        |
        +--Task
Direct Known Subclasses:
Action, DiscourseTask, PL_BlockOffAction, PL_BlockOnAction, PL_DummyTask, PL_EpsIbmAction, PL_EpsTask, PL_PerTask, PL_Report3Task, PL_StartTask

class Task
extends Node

Tasks contain a Conjunction of Predicate specifications for their preconditions and outcomes, and a Vector of Predicate specifications for their parameters and provisions, so that the planner knows when and how they can be used. A Task node is parent to Conjunctions, and child to an ObjectiveCell.


Field Summary
(package private)  java.util.Vector available
           
(package private)  int circularityCount
           
(package private) static boolean DEBUG
           
(package private) static java.lang.String em
           
(package private) static int expectedProvisionsCount
           
(package private) static java.lang.String loc
           
(package private)  PL_Planner myPlan
           
(package private)  java.util.Hashtable outcomes
           
(package private)  java.util.Vector outcomeSpecs
           
(package private)  java.util.Vector outcomeVars
           
(package private)  java.util.Vector parameterSpecs
           
(package private)  ObjectiveCell parent
           
(package private)  Conjunction preconditions
           
(package private)  java.util.Vector preconditionSpecs
           
(package private)  java.util.Vector predicatesAddressed
           
(package private)  java.util.Vector provisionSpecs
           
(package private)  java.util.Vector provisionVars
           
(package private)  Conjunction subObjectives
           
(package private)  java.util.Vector subObjectiveSpecs
           
(package private)  java.lang.String varMapString
           
(package private) static java.lang.String wm
           
 
Fields inherited from class Node
ac, em, loc, peData
 
Constructor Summary
Task(java.lang.String name, java.lang.String type)
          Constructor.
 
Method Summary
 void addOutcomeVariable(java.lang.String outcomeName, Variable var)
          Add a variable to the list of vars associated with an outcome name in the hashtable "outcomes".
 java.util.Vector addPredicatesAddressed(Predicate p)
           
 java.util.Vector addPredicatesAddressed(java.util.Vector v)
           
 boolean addressesPredicate(Predicate p2)
          Determines whether this task has outcomeSpecs to address the Predicate argument.
 void addToOutcomeVars(Predicate p)
          Removes Variables from a Predicate and adds them to Vector outcomeVars.
 void addToProvisionSpecs(Predicate p)
          Adds a Predicate to a Vector of specifications of Task inputs.
 void addToProvisionVars(Predicate p)
          Removes Variables from a Predicate and adds them to Vector ProvisionVars.
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
          Just tests to see if the class of Task is the same.
 java.lang.String getName()
           
 java.util.Vector getOutcomeSpecs()
           
 java.util.Vector getOutcomeVars()
           
 ObjectiveCell getParent()
           
 Conjunction getPreconditions()
           
 java.util.Vector getPredicatesAddressed()
           
 java.util.Vector getProvisionNames()
          Returns a Vector of String names of provision variables for the Task.
 java.util.Vector getProvisions()
          Returns names of provisions.
 java.util.Vector getProvisionSpecs()
          Returns a Vector of Predicate specifications of Task inputs.
 Predicate getSpecificationOfVariable(java.lang.String varName, java.util.Vector specList)
          Find the specification that corresponds to the variable name.
 Conjunction getSubObjectives()
           
 java.util.Vector getSubObjectiveSpecs()
           
 java.util.Vector getTopicVarsFromPredVector(java.util.Vector pv)
           
 java.util.Vector getUnAddressedProvisionsSpecs()
          Return provisionSpecs of a Task that have not yet been addressed by Provides in ObjectiveCell parent.
 java.lang.String getVarMapString()
           
static void main(java.lang.String[] args)
           
 void makeOutcome(java.lang.String outcomeName, java.util.Vector vars)
          Associate a vector of variables with an outcome name in the hashtable "outcomes".
 java.util.Vector makeProvidesForProvisions(Task parentTask, KnowledgeBase kB)
          Return a Vector of PEComponentData "provides" that describe which provision of the ObjectiveCell is connected to which provision of the Task below.
 java.util.Vector makeProvidesFromOtherOutcomesToProvisions(Task otherTask)
          Connect an outcome of otherTask to a provision of this task.
 java.util.Vector makeProvidesFromOutcomesToParent(Task parentTask, KnowledgeBase kB)
          Looks for shared variables between outcomes of task and parent.
 Task makeTask()
          Create a Task to correspond to this Task.
 java.util.Vector nextMakeProvidesForProvisions(Task parentTask, KnowledgeBase kB)
          This version of makeProvidesForProvisions looks to fill provision variables by making Provides between the vars and vars of the parent that they are unified with.
 void print()
           
 void propagateAttributes()
          The Attributes of a Task are the combined Attributes of the preconditions and the subobjectives.
 void setParent(ObjectiveCell o)
           
 void setProvisions()
           
 java.lang.String setVarMapString(java.lang.String inputNames)
           
 boolean vectorsShareVariables(java.util.Vector vars1, java.util.Vector specList1, java.util.Vector vars2, java.util.Vector specList2)
          Return true if any Variables in the vectors match (i.e.
 
Methods inherited from class Node
checkAttributes, convertAttributes, getAttributeCell, getAttributeFeatureAverage, getAttributeFeatureNames, getAttributeNames, getCost, getDuration, getNodeChildren, getQuality, makeAttribute, setCost, setDuration, setQuality, updateAttributeFeature
 
Methods inherited from class java.lang.Object
, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

myPlan

PL_Planner myPlan

parent

ObjectiveCell parent

subObjectives

Conjunction subObjectives

preconditions

Conjunction preconditions

circularityCount

int circularityCount

outcomes

java.util.Hashtable outcomes

varMapString

java.lang.String varMapString

outcomeSpecs

java.util.Vector outcomeSpecs

parameterSpecs

java.util.Vector parameterSpecs

provisionVars

java.util.Vector provisionVars

provisionSpecs

java.util.Vector provisionSpecs

outcomeVars

java.util.Vector outcomeVars

preconditionSpecs

java.util.Vector preconditionSpecs

subObjectiveSpecs

java.util.Vector subObjectiveSpecs

available

java.util.Vector available

predicatesAddressed

java.util.Vector predicatesAddressed

em

static java.lang.String em

wm

static java.lang.String wm

loc

static java.lang.String loc

DEBUG

static boolean DEBUG

expectedProvisionsCount

static int expectedProvisionsCount
Constructor Detail

Task

public Task(java.lang.String name,
            java.lang.String type)
Constructor.
Method Detail

getName

public java.lang.String getName()

getParent

public ObjectiveCell getParent()

setParent

public void setParent(ObjectiveCell o)

getOutcomeSpecs

public java.util.Vector getOutcomeSpecs()

getOutcomeVars

public java.util.Vector getOutcomeVars()

getSubObjectiveSpecs

public java.util.Vector getSubObjectiveSpecs()

getSubObjectives

public Conjunction getSubObjectives()

getPreconditions

public Conjunction getPreconditions()

propagateAttributes

public void propagateAttributes()
The Attributes of a Task are the combined Attributes of the preconditions and the subobjectives. Both are Conjunctions, and a Task is effectively an AND of the two. Get attributes of children and calc this Task's attributes. Parent of a Task is an ObjectiveCell.
Overrides:
propagateAttributes in class Node

getPredicatesAddressed

public java.util.Vector getPredicatesAddressed()

addPredicatesAddressed

public java.util.Vector addPredicatesAddressed(Predicate p)

addPredicatesAddressed

public java.util.Vector addPredicatesAddressed(java.util.Vector v)

addToProvisionVars

public void addToProvisionVars(Predicate p)
Removes Variables from a Predicate and adds them to Vector ProvisionVars.

addToOutcomeVars

public void addToOutcomeVars(Predicate p)
Removes Variables from a Predicate and adds them to Vector outcomeVars.

makeOutcome

public void makeOutcome(java.lang.String outcomeName,
                        java.util.Vector vars)
Associate a vector of variables with an outcome name in the hashtable "outcomes".

addOutcomeVariable

public void addOutcomeVariable(java.lang.String outcomeName,
                               Variable var)
Add a variable to the list of vars associated with an outcome name in the hashtable "outcomes".

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Just tests to see if the class of Task is the same.
Overrides:
equals in class java.lang.Object

addressesPredicate

public boolean addressesPredicate(Predicate p2)
Determines whether this task has outcomeSpecs to address the Predicate argument.

makeProvidesForProvisions

public java.util.Vector makeProvidesForProvisions(Task parentTask,
                                                  KnowledgeBase kB)
Return a Vector of PEComponentData "provides" that describe which provision of the ObjectiveCell is connected to which provision of the Task below. Cannot just compare provisions of parent task directly: no comparison between: child spec (KNOW ?company_name5 (EPS ?company_name5 ?value5)) and parent spec (KNOW ?company_name4 (Report3 ?company_name4 ?text3)). So look at objectives of parent, to connect var names, then find var names in parent's provisions if possible (it is possible that a var could exist in an objective and not have been passed as a provision). Allows provision names to be different.

nextMakeProvidesForProvisions

public java.util.Vector nextMakeProvidesForProvisions(Task parentTask,
                                                      KnowledgeBase kB)
This version of makeProvidesForProvisions looks to fill provision variables by making Provides between the vars and vars of the parent that they are unified with. Starts by getting list of provision specs for this task that have not been filled. This method allows use of vars in a provision spec that will not appear in the outcomes list.

makeProvidesFromOtherOutcomesToProvisions

public java.util.Vector makeProvidesFromOtherOutcomesToProvisions(Task otherTask)
Connect an outcome of otherTask to a provision of this task.

makeProvidesFromOutcomesToParent

public java.util.Vector makeProvidesFromOutcomesToParent(Task parentTask,
                                                         KnowledgeBase kB)
Looks for shared variables between outcomes of task and parent. If a pair of outcomes shares a variable (based on the outcome specs for predicates about that variable) then the two outcomes are connected with a PROVIDES.

getTopicVarsFromPredVector

public java.util.Vector getTopicVarsFromPredVector(java.util.Vector pv)

vectorsShareVariables

public boolean vectorsShareVariables(java.util.Vector vars1,
                                     java.util.Vector specList1,
                                     java.util.Vector vars2,
                                     java.util.Vector specList2)
Return true if any Variables in the vectors match (i.e. have the same specification)

makeTask

public Task makeTask()
Create a Task to correspond to this Task.

setProvisions

public void setProvisions()

getUnAddressedProvisionsSpecs

public java.util.Vector getUnAddressedProvisionsSpecs()
Return provisionSpecs of a Task that have not yet been addressed by Provides in ObjectiveCell parent.

getSpecificationOfVariable

public Predicate getSpecificationOfVariable(java.lang.String varName,
                                            java.util.Vector specList)
Find the specification that corresponds to the variable name. Prefer a spec that has var as topic variable.

getProvisions

public java.util.Vector getProvisions()
Returns names of provisions.

getProvisionNames

public java.util.Vector getProvisionNames()
Returns a Vector of String names of provision variables for the Task.

setVarMapString

public java.lang.String setVarMapString(java.lang.String inputNames)

getVarMapString

public java.lang.String getVarMapString()

getProvisionSpecs

public java.util.Vector getProvisionSpecs()
Returns a Vector of Predicate specifications of Task inputs.

addToProvisionSpecs

public void addToProvisionSpecs(Predicate p)
Adds a Predicate to a Vector of specifications of Task inputs.

print

public void print()

main

public static void main(java.lang.String[] args)