|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--PL_Planner
This class is for the generation and maintenance of HTN plans for individual DECAF agents. A plan consists of three kinds (classes) of nodes: Conjunctions represent AND and OR branches in the plan, allowing the scheduler to select different branches at run time if a branch is ORed. Each Conjunction has a KnowledgeBase where information about the state of the plan at that point is stored. Children of a Conjunction node may be either Conjunctions or ObjectiveCells. A Conjunction's parent may be a Task or another Conjunction. ObjectiveCells contain a set of ANDed predicate goals that the planner will try to achieve, and a list of the tasks that the planner has selected to achieve them. An ObjectiveCell has one or more Tasks as children, and a Conjunction as parent. 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.
Inner Class Summary | |
(package private) static interface |
PL_Planner.Status
|
Field Summary | |
(package private) PL_MyAgent |
agent
|
(package private) boolean |
assumePreconditionsFlag
|
(package private) static int |
CIRC_LIMIT
|
(package private) static boolean |
DEBUG
|
(package private) static java.lang.String |
em
|
(package private) java.util.Vector |
incompletePathNodes
|
(package private) static java.lang.String |
loc
|
(package private) Task |
nextTask
|
(package private) static int |
numberTasksExpected
|
(package private) int |
planStatus
|
(package private) java.util.Vector |
provides
|
(package private) Task |
root
|
(package private) AttributeCell |
standard
|
(package private) java.util.Hashtable |
taskObjectiveMap
In taskObjectiveMap, key is a Task, value is vector of Objective s that task addresses in this branch of plan. |
(package private) java.util.Vector |
tasks
|
Constructor Summary | |
PL_Planner()
|
|
PL_Planner(Conjunction c)
|
|
PL_Planner(Task t)
|
Method Summary | |
void |
addProvides(PEComponentData p)
|
void |
addProvides(java.util.Vector v)
|
void |
convertAttributes()
|
void |
fillTaskProvisionsFromElsewhereInPlan(Task task)
Take Task provisions that aren't filled from parent, and look to fill them from KBs up the tree. |
Predicate |
findMoreSpecificPredicateOrNull(Predicate p,
java.lang.Object node)
Climb up tree, stopping at Conjunctions to check if there is a more specific predicate in the kB of the conjunction, until we hit root. |
AttributeCell |
getAttributeStandards()
|
Task |
getBestNextTask(ObjectiveCell o,
java.util.Hashtable taskObjectiveMap)
Chooses task that addresses the most objectives by counting mappings in hash table parameter; then the one with the fewest variables in Effects. |
KnowledgeBase |
getNextKnowledgeBase(java.lang.Object node)
Return closest KnowledgeBase in plan tree at or above this node, or null if none. |
java.lang.Object |
getParent(java.lang.Object o)
|
Task |
getParentTask(java.lang.Object o1)
|
java.util.Vector |
getProvides()
|
void |
handleExceptionAtConjunction(Conjunction c,
java.lang.Exception e)
Want to pass all exceptions through an AND; but Ors should check to see if all options are exhausted before passing the exception. |
boolean |
isRoot(java.lang.Object o)
|
static void |
main(java.lang.String[] args)
|
void |
peComponentPrint()
|
void |
peComponentWrite(java.lang.String filename,
boolean appendFlag)
|
static ProvisionCell |
PL_run(Agent local)
|
private Conjunction |
placeAndAfterOrNode(Conjunction orNode,
ObjectiveCell oC)
replace oC child of orNode with new AND; oC becomes child of AND. |
void |
plan(Conjunction c)
|
void |
plan(Conjunction c,
java.util.Hashtable taskObjectiveMap)
Here distinguish between AND and OR branches by how we pass the uT and taskObjectiveMap. |
void |
plan(ObjectiveCell currentObjectives)
Loop on objectives to get all possible tasks; choose single task using getBestNextTask; determine what else the best task covers, then plan again for objectives that are not covered. |
void |
plan(ObjectiveCell currentObjectives,
java.util.Hashtable taskObjectiveMap)
|
void |
print()
|
void |
propagateAttributes(java.lang.Object node)
|
void |
setAttributeStandards(AttributeCell attCell)
|
void |
simulateActionOutcomes(Action a,
java.lang.Object node)
Simulate the effects of an action in the plan by placing the instantiated versions of the outcome specifications into the nearest Conjunction's kB. |
void |
subpeComponentPrint(Node n,
java.lang.String indent)
|
void |
subpeComponentWrite(Node n,
java.io.FileWriter fw)
|
void |
subPrint(Conjunction o,
java.lang.String indent)
|
void |
subPrint(ObjectiveCell o,
java.lang.String indent)
|
void |
subPrint(java.lang.Object o,
java.lang.String indent)
|
void |
subPrint(Task p,
java.lang.String indent)
|
boolean |
tasksCoverObjectives(ObjectiveCell o)
returns true iff each objective is addressed by some task in the ObjectiveCell's possibleTasks list. |
java.lang.String |
tellAgentAboutPlan(Agent local)
|
boolean |
unifyAddressedPredicatesWithTaskVars(java.util.Vector addressedPredicates,
Task task,
java.lang.Object node)
Unify variable names between Predicates in Vector and Predicates in Task.outcomeSpecs. |
boolean |
verifyConstraintInAgentKB(Predicate p)
|
boolean |
verifyConstraintInPlanTree(Predicate p,
java.lang.Object node)
Climb up tree, stopping at Conjunctions to check if there is a more specific predicate in the kB of the conjunction, until we hit root. |
Methods inherited from class java.lang.Object |
|
Field Detail |
PL_MyAgent agent
Task root
java.util.Vector tasks
java.util.Vector provides
java.util.Vector incompletePathNodes
int planStatus
Task nextTask
java.util.Hashtable taskObjectiveMap
AttributeCell standard
static int numberTasksExpected
static int CIRC_LIMIT
static final boolean DEBUG
boolean assumePreconditionsFlag
static java.lang.String em
static java.lang.String loc
Constructor Detail |
public PL_Planner()
public PL_Planner(Conjunction c)
public PL_Planner(Task t)
Method Detail |
public void plan(ObjectiveCell currentObjectives) throws CircularityException, PlanningException
public void plan(Conjunction c) throws CircularityException, PlanningException
public void plan(Conjunction c, java.util.Hashtable taskObjectiveMap) throws CircularityException, PlanningException
public void handleExceptionAtConjunction(Conjunction c, java.lang.Exception e) throws java.lang.Exception
public void plan(ObjectiveCell currentObjectives, java.util.Hashtable taskObjectiveMap) throws CircularityException, PlanningException
public void fillTaskProvisionsFromElsewhereInPlan(Task task)
public boolean tasksCoverObjectives(ObjectiveCell o)
public Task getBestNextTask(ObjectiveCell o, java.util.Hashtable taskObjectiveMap)
public boolean unifyAddressedPredicatesWithTaskVars(java.util.Vector addressedPredicates, Task task, java.lang.Object node)
public KnowledgeBase getNextKnowledgeBase(java.lang.Object node)
public void peComponentPrint()
public void subpeComponentPrint(Node n, java.lang.String indent)
public void peComponentWrite(java.lang.String filename, boolean appendFlag) throws java.io.IOException
public void subpeComponentWrite(Node n, java.io.FileWriter fw) throws java.io.IOException
public void print()
public void subPrint(ObjectiveCell o, java.lang.String indent)
public void subPrint(Conjunction o, java.lang.String indent)
public void subPrint(Task p, java.lang.String indent)
public void subPrint(java.lang.Object o, java.lang.String indent)
public void simulateActionOutcomes(Action a, java.lang.Object node)
public boolean verifyConstraintInAgentKB(Predicate p)
public boolean verifyConstraintInPlanTree(Predicate p, java.lang.Object node)
public Predicate findMoreSpecificPredicateOrNull(Predicate p, java.lang.Object node)
public void propagateAttributes(java.lang.Object node)
public Task getParentTask(java.lang.Object o1)
public java.lang.Object getParent(java.lang.Object o)
public boolean isRoot(java.lang.Object o)
private Conjunction placeAndAfterOrNode(Conjunction orNode, ObjectiveCell oC)
public void addProvides(PEComponentData p)
public void addProvides(java.util.Vector v)
public java.util.Vector getProvides()
public void convertAttributes()
public void setAttributeStandards(AttributeCell attCell)
public AttributeCell getAttributeStandards()
public java.lang.String tellAgentAboutPlan(Agent local)
public static ProvisionCell PL_run(Agent local)
public static void main(java.lang.String[] args)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |