2 RECOVERY MODEL
A recovery model is built to provide a robust plan-
ning process of agent systems. A lot of planning
algorithms can be exploited to perform the planning
of the agent goals. One family of these planners is
the Hierarchical Task Networks (HTN) (Erol, et al.,
1994) and (Erol, 1995). The planners under this fam-
ily achieve a plan for a set of goal tasks by decom-
posing them into more primitive tasks. The decom-
position process is repeated until the most primitive
tasks are achieved. There are many implementations
for HTN such as NOAH, NONLIN, MOLGEN,
UMCP, SHOP, SHOP2 (Nau et al., 2003) and oth-
ers. This family of planners is adopted to be sup-
ported by the proposed recovery service to prove the
concept of plan recovery.
2.1 Overview of HTN Planning
HTN planners accept the initial state of the envi-
ronment, the goal tasks, and the definition of the
problem domain as input. The output of the planner
is a plan that can achieve the goal tasks.
Tasks are classified to primitive and non-
primitive tasks. Non-primitive tasks are abstract
tasks that must be decomposed by the planner to a
set of more primitive tasks. Primitive tasks are the
tasks that can be achieved by a single action (opera-
tor).
An environment state S is a set of ground atoms
that are true in the environment. The initial state at
the beginning of planning is denoted as S
0
. An op-
erator
α
is an action that can be executed in the
agent environment. It can be represented by a tuple
(head, parameters, precond, del, add), where head is
the operator name, parameters are its variable pa-
rameters, precond is a list of precondition that must
be true in the environment state before execution of
the operator, del is a list of terms to be removed
from the state after execution, and add is a list of
terms to be added to the state.
Define a function named RESULT that maps a
pair of a state and an operator to another state:
RESULT: S × Op Æ S
A plan P is a set of operators with a dependency
between them. Formally, a plan P= {{(n
1
:
α
1
),…,
(n
k
:
α
k
) },<
p
}, where
α
i
is an operator in the plan with
labels n
i
to distinguish similar operators. Define a
function PL_RESULT that maps an initial state and a
plan to a final state:
PL_RESULT: S × P Æ S.
PL_RESULT applies the operators in plan P succes-
sively in their precedence order against an initial
state S
0
to achieve a final goal state S
g
. A method m
is used to decompose a non-primitive task. A
method m can be defined as follows:
m = (head, parameters, precond, subtasks, <
m
),
where head is the method name, parameters are a
list of method parameters, precond are the precondi-
tions of the method, subtasks are a set tasks that can
accomplish the goal task, and <
m
is the dependency
relation between tasks in subtasks. A problem do-
main D is defined as a tuple (At,Op,Me) , where At is
a list of all possible atoms in this domain, Op is a list
of possible operators and Me is a list of possible
methods. A planning problem Pr= (D,S
0
,T) consists
of a problem domain D, an initial state S
0
and goal
tasks T. Its solution is a plan P that can achieve the
goal tasks.
Generally, an HTN planner, e.g. SHOP2, repeat-
edly picks (and removes) some task from T, decom-
poses it to more primitive tasks and returns them to
T until the most primitive tasks remain in T. At this
point, each primitive task can be achieved by a sin-
gle operator. The operators used are appended to the
output plan and the plan is then returned to the exe-
cution layer after all tasks are achieved.
2.2 Assumptions
We assume that the agent environment is open, i.e. it
can be modified by other external entities, and his-
tory-independent, i.e. the outcome of an operator
does not depend on the previously executed opera-
tors. Also, it is assumed that the execution process of
the agent checks the satisfaction of all operator pre-
conditions before executing.
Plan execution can begin before the completion
of its generation. In other words, generated tasks of a
partially developed plan can be executed by the
agent. This feature is especially important in agent
systems where planning can take considerable time,
which motivates the necessity of recovery. Some
planners cannot allow early execution of plans for
certain reasons such as the use of backtracking algo-
rithms where a generated task be removed at a late
planning step. We adopt the more general case
where early execution of partially developed plans is
allowed.
2.3 Architecture of the Proposed
Recovery Model
Figure 1 depicts the architecture of the proposed
recovery model. A typical agent system is used as a
basis for the recovery service. The agent system
consists of three typical layers: Execution Process,
Planner, and Cooperation Process. The plan recov-
RECOVERY SERVICES FOR THE PLANNING LAYER OF AGENTS
139