Hierarchical Task Networks
- Each task can be accomplished by one or more "methods".
- Each method, in turn, specifies lower-level tasks to be accomplished.
- At the bottom-level tasks, actions are added to the plan.
- Encodes a domain-specific planning algorithm.
Example HTN Planner: Pyhop
- Pyhop is written as a Python library
- Operators and methods are simply Python functions
- States are Python data structures
- Pyhop algorithm:
- Initialize task list to contain the top-level task in the hierarchy.
- Initialize plan to empty
- Seek-Plan(state, tasks, plan)
- If tasks is empty, return plan
- Examine the first task from tasks
- If this task is an operator
- Apply the operator to update the state
- Call Seek-Plan(newstate, the remaining tasks, plan + operator)
and return the resulting plan (if found)
- If this task is a method
- For each relevant method
- Call Seek-Plan(state, subtasks + remaining tasks, plan) and
return the resulting plan (if found)
- Return with failure
- Observations
- Performs depth-first search
- Does not attempt to find optimal plans
- Only backtracks due to failure