scieee AI-readable full text Open interactive document viewer

Reactive execution for solving plan failures in planning control applications

Gúzman Álvarez, César Augusto,Castejón Navarro, Pablo,Onaindia de la Rivaherrera, Eva,Frank, Jeremy

Abstract

We present a novel reactive execution model for planning control applications which repairs plan failures at runtime. Our proposal is a domain-independent regression planning model which provides good-quality responses in a timely fashion. The use of a regressed model allows us to work exclusively with the sufficient and necessary information to deal with the plan failure. The model performs a time-bounded process that continuously operate on the plan to recover from incoming failures. This process guarantees there always exists a plan repair for a plan failure at anytime. The model is tested on a simulation of a real-world planetary space mission and on a well-known vehicle routing problem.

Full text

Integrated Computer-Aided Engineering 22 (2015) 343–360 343 DOI 10.3233/ICA-150493 IOS Press Reactive execution for solving plan failures in planning control applications Cesar Guzmana, Pablo Castejona, Eva Onaindiaa,∗and Jeremy Frankb aUniversitat Politècnica de València, Valencia, Spain bNASA Ames Research Center, Moffet Field, CA, USA Abstract. We present a novel reactive execution model for planning control applications which repairs plan failures at runtime. Our proposal is a domain-independent regression planning model which provides good-quality responses in a timely fashion. The use of a regressed model allows us to work exclusively with the sufficient and necessary information to deal with the plan failure. The model performs a time-bounded process that continuously operate on the plan to recover from incoming failures. This process guarantees there always exists a plan repair for a plan failure at anytime. The model is tested on a simulation of a real-world planetary space mission and on a well-known vehicle routing problem. Keywords: Reactive planning, dynamic execution, monitoring plan execution, reactive execution agent, unpredictable environment 1. Introduction The application of Artificial Intelligence AI planning techniques is helping industries to improve their efficiency and performance in a great variety of applications: manufacturing and telecommunication networks [31,37], education [20], route planning [10,41], military and civilian coalition operations [36], space exploration [9], etc. In general, even though much of the research on AI planning is aimed at generating domain-independent planning technology, the application of planning to industry gives rise to special-purpose systems, which are expensive to extend to other cases. On the other hand, there exist few systems that integrate automated planning and plan execution and this is, perhaps, one of the main causes of the relatively low deployment of automated planning applications [22]. While the primary focus of planning is on deliberative tools to calculate plans that achieve operation goals, the focus of execu- ∗Corresponding author: Eva Onaindia, Department de Sistemas Informáticos y Computación, Universitat Politècnica de València, Spain. Tel.: +34 963 877 755; Fax: +34 963 877 359; E-mail: [email protected].es. tion is on developing control methods over relatively short time spans to ensure the plan actions are executed stably [3]. Most planning and execution (P&E) systems follow an integrated approach in which the execution monitoring system is integrated with the planner or vice versa. Systems like IXTET-EXEC [29] or TPOPEXEC [46] work under a continual planning approach [6], interleaving planning and execution in a world under continual change. Another example can be found in [9], where the planner of a spacecraft continuously operates on the plan execution to repair failures. IDEA (Intelligent Distributed Execution Architecture) [1] is a real-time architecture that proposes a unified view of deliberation and execution where the planner is embedded within the executor; and T-REX [32](Teleo- Reactive EXecutive) is a deliberative P&E system for AUV control inspired from IDEA. This type of unified approaches allows only for a strict and controlled interleaving of P&E, making it difficult to have a generalpurpose planner for different types of executor systems. Some of the aforementioned P&E systems [29,46], deal with temporal plans and focus on a unified approach that accommodates flexible plan executions, but ISSN 1069-2509/15/$35.00 c 2015 – IOS Press and the author(s). All rights reserved This article is published online with Open Access and distributed under the terms of the Creative Commons Attribution Non-Commercial License. 344 C. Guzman et al. / Reactive execution for solving plan failures in planning control applications they are not concerned with providing responses in a timely fashion. In contrast, the works in [1,32], besides generating plans over relatively long time periods, they also introduce a reactive planner to allow robust performance in dynamic environments. The term reactive planning has been approached from different perspectives [8]: –Responding very quickly to changes in the environment through a reactive plan library that stores the best course of action to each possible contingency. –Choosing the immediate next action on the basis of the current context; in this case, a deliberative procedure can be used to specify the next act. –Using more complex constructs in order to handle execution failures or environmental changes. The first approach, used by early P&E systems, implies storing a plan for each possible state of the world, an option which is not affordable in highly dynamic environments. Hierarchical control structures provide a mechanism to choose the immediate next action when a quick response is required in unpredictable environments [7]. This is the approach followed by the models that emphasize reactiveness, computing just one next action in every instant, based on the current context [32]. The use of more complex structures allow to consider more deliberative (long horizon) responses rather than short-term reactiveness but, in practice, none of these reactive frameworks have ever exploited the idea of providing quick deliberative responses. They react to a change or failure but they do not guarantee a response within a limited time. A key aspect of reactive planning is that it is not only about providing quick responses to changes but also preserving the plan stability [18] and guarantee that the operation goals achieved by the plan are still reachable after the plan repair. In contrast to control applications that use condition monitoring for anticipating and reacting to faults [4,40], reactive planning is about repairing a fault when is detected while trying to maintain the executability of the rest of the plan. The focus of this work is on the development of a reactive P&E system capable to provide fast deliberative responses to repair a failed action without explicitly representing contingency branches and eligible plans for each possible state of the world. Our system does not simply return the immediate next executable action but it operates over a planning horizon that is longer than the minimum latency interval starting at the current execution time. This idea was exposed, though never exploited,in IDEA [13], which in practice works with the minimal planning horizon in order to reduce the reactive planner’s search space; that is, the shorter the planning horizon, the more reactivity, but also the less contextual information to repair the failure. The idea of planning horizon has been also exploited in non-reactive dynamic planning applications [47]. In this work, we propose a novel reactive P&E model that keeps track of the execution of a plan and repairs the incoming failures. The executor-repairing system incorporates a reactive planning procedure which is exclusively used for plan repair and it is independent of the deliberative planner that computes the solution plan for the problem. Unlike the integrated P&E approaches mentioned before, ours is a highly modular and reconfigurable P&E architecture. The reactive planner is specialized in small plan repairs that must be accomplished promptly. Additionally, it precomputes an initial search space which encodes solution plans for potential failures in a fragment of the plan named plan window (we use this term equivalently to the concept of planning horizon in IDEA [1]). The construction of the search space is a time-bounded process subject to the agent’s execution latency and the number of execution cycles in the plan window, whose objective is to have a solution plan available when a failure arises. Once the search space is built, the agent proceeds with the plan execution, and simultaneously the reactive planner computes the search space of the next plan window. The reactive model is thus capable to deduce strict limits to the length of the plan window and compute the largest search space within the time limit. Then, if a failure occurs, the corresponding search space is used to find a recovery plan. This gives our reactive model an anytime-like behaviour. Our model contributes with several novelties: (a) it is a domain-independent P&E model that can be exploited in any application context; (b) it is independent of the deliberative planner; (c) it trades off deliberative and reactive mechanisms to provide goodquality responses in a timely fashion; (d) it avoids dealing with unnecessary information from the world, handling specifically the information relevant to the failure; and (e) it performs a time-bounded deliberative process that permits to continuously operate on the plan to repair problems during execution. This paper is organized as follows. Section 2 presents some related work and Section 3 outlines the general P&E architecture where the reactive model is integrated. The two following sections present some formal concepts and introduce the reactive planning model to recover from plan failures. Section 6 presents C. Guzman et al. / Reactive execution for solving plan failures in planning control applications 345 a motivation example on the Mars space mission. Section 7 presents the model evaluation, Section 8 discusses some limitation of the model and, finally, the last section concludes and outlines future research lines. 2. Related work Classical planning refers generically to planning for state-transition systems that adopt a series of assumptions like that the system is deterministic and static, that actions are instantaneous transitions and that the planner is not concerned with any change that may occur in the system while it is planning [21]. In contrast, reactive planning operates in a timely fashion with highly dynamic, non-deterministic and unpredictable environments, assuming uncertainty in the world and the existence of multiple outcomes due to action failures or exogenous events [34]. Our reactive planner is not a temporal planner but it is designed to return timely responses in highly dynamic environments. Regarding non-deterministic planning, the study of finding the sequence of actions or events that explain the current observed state of the world is called diagnosis. Most of the research on diagnosis put the emphasis in malfunctioning components and obtaining a plan to recover from the component failure rather than monitoring a plan execution [5,43]. Particularly, the work in [43] provides a formal characterization of diagnosis and its relation to planning and, in [5], authors propose an evolutionary strategy that successfully diagnoses several types of component failures, such as the separation of a body part or the complete failure of a sensor or motor. Planning in non-deterministic environments has also been addressed from a probabilistic perspective, representing probabilities over the expected action outcomes or belief state space. Planning based on Markov Decision Processes is a well-known approach to deal with non-determinism when an accurate probability distribution on each state transition is available [27,33]. In highly dynamic environments where exogenous events frequently occur, it is not possible to have a model of the uncertainty in the world. Likewise, a Finite State Machine (FSM) can also be used to implement a reactive behaviour [39] but FSM requires an explicit modeling of a finite set of plans (states and transitions) and it is particularly aimed at choosing only the immediate next action. When a plan is to be executed in an unpredictable environment, it is impractical to have all potential repair plans explicitly represented and the emphasis is not only on short-term reactivity but also on preserving the achievability of the operation goals. For this reason, a time-bounded reactive planner that calculates promptly recovery plans over a planning horizon is the more suitable solution. 3. An architecture for planning and execution Our work takes place in the context of PELEA [24], a single-agent architecture in which an agent is endowed with capabilities for generating a plan, executing, plan monitoring and, optionally, learning. Our ultimate goal of extending this model to a multi-agent context is discussed in Section 8. Before addressing this issue, our purpose is to have an agent equipped with a reactive execution mechanism that enables the agent to repair a plan at runtime, thus avoiding the need to resort to the deliberative planner each time a failure occurs. In the following, we will refer to the concept of agent, specifically to execution agent, as an autonomous entity capable of performing reasoning and communicating with other entities of the system like the deliberative planner, which offers a planning service. In our approach, a planning service provides execution agents with independent plans to be executed. An agent, which is an extension of a PELEA1agent [24], executes and monitors one action at a time and calls its repairing mechanism for a recovery plan whenever a failure arises. In case the agent is unable to solve the failure by its own, it will request the planning service anewplan. The focus of this paper is on the repairing mechanism of the execution agent. The planning module embedded into the execution agent is a reactive planner, which is used to recover from failures at runtime. The components of an execution agent (see Fig. 1) are: –Execution module (EX). The EX is initialized with a planning task, which current state is read from the environment through the sensors. The EX is responsible of reading and communicating the current state to the rest of modules as well as executing the actions of the plan in the environment. –Monitoring module (MO). The main task of the MO is to verify that the actions are executable in 1A more detailed description may be found at http://servergrps. dsic.upv.es/pelea/. 346 C. Guzman et al. / Reactive execution for solving plan failures in planning control applications Fig. 1. Flow of the reactive execution model. the current state before sending them to the EX. When the EX reports the MO the state resulting from the execution of some action of the plan, the MO checks whether the next action of the plan is executable in the resulting state. This process is called plan monitoring, verifying whether the values of the variables of the received state match the expected values or not. Otherwise, the MO will determine the existence of a plan failure. –Reactive Planner module (RP). The RP is used when a plan failure is detected by the MO and a recovery is required. The RP uses a precomputed search space, called repairing structure, to promptly find a plan that brings the current state to one from which the plan execution can be resumed (see Section 5). In case the RP is not able to find a plan with its repairing structure, the MO requests the planning service a new plan. The EX, MO, and RP modules of an execution agent operate the Reactive Execution Model. The control flow of the reactive execution model is shown in Fig. 1. An action plan Πfor solving a planning task is calculated by the planning service. Πconsists of a series of actions to be executed at given time steps, each of which makes a deterministic change to the current world state. The elapsed time from one time step to the next one defines an execution cycle; i.e., the monitor/acting/sensing cycle of an action execution. The model follows several execution cycles, performing the scheduled action in each cycle until the plan execution is completed. Initially, the MO receives the plan Πfrom the planning service and, before sending Πto execution, it performs two operations: 1. It sends Πto the RP, which creates a repairing structure for a fragment of Πof length lcalled plan window,wherelis the number of actions or execution cycles in the plan window. The repairing structure associated to the plan window contains information, in the form of alternative plans, to repair a failure that affects any of the l actions included in the plan window. 2. When the time of the RP expires, and a repairing structure has been calculated for a particular plan window, the MO monitors the variables of the first action of the window. If the sensed values of the action variables match the required values for the action to be executed, the MO sends the scheduled action to the EX for its execution (see Fig. 1). Otherwise, a failure is detected and the MO calls the RP, which will make use of the repairing structure to fix the failing action. Notice that a failure that occurs in the first action of a window is due to an exogenous event (e.g. other agents change the world state) and not due to an erroneous execution of the preceding action in the plan. The MO receives the result of the sensing task from the EX after executing the action, it updates the plan window accordingly by eliminating the already executed action and proceeds with the next action of the plan window. For instance, assuming a plan of five actions and a repairing structure for a plan window of l=3([a1,a 2,a 3]), the plan window will be updated to [a2,a 3]after successfully executing a1,andtheRP will use the same repairing structure to fix a potential failure in the remaining actions of the plan window, that is, a2or a3. Subsequently, the RP will create a new repairing structure, for example, for the plan window [a4,a 5]. The flow goes on as long as no plan failures are encountered. In case that a non-executable action is found, the MO reports the failure to the RP. Then, the RP uses the repairing structure associated to the plan window of the non-executableaction and obtains a new plan Πthat solves the failure and replaces the old plan Π, attaining likewise the goals of the planning task. The RP is constantly working while the EX is executing the actions of the plan. Hence, besides having a repairing structure ready to attend a failure in an action of the current plan window, the RP is also generating the subsequent structure for the next plan window. Typically, the time for the RP to compute the repairing structure of the subsequent plan window is the time that the EX will take to execute the actions included in the current window. Therefore, the C. Guzman et al. / Reactive execution for solving plan failures in planning control applications 347 more actions in the current plan window, the more time the RP will have to create the next repairing structure and, consequently, the longer the window associated to this repairing structure. This working scheme gives our model an anytime behaviour, thus guaranteeing the RP can be interrupted at anytime and will always have a repairing structure available to attend an immediate plan failure. On the other hand, some similarities between our model and the life cycle of a scientific workflow can be found. Following [23], we can do this analogy: the modeling phase is equivalent to the planning task modeling; the deployment phase amounts to the plan Πcalculated by the planning service; and the execution and monitoring phase would be the same in our model. Unlike scientific workflow, our model does not include an analysis phase; however, successively repetitions of the deployment (repair plan) and execution phases happen when a plan failure arises. 4. Formal model In this section, we formalize the concept of planning task, partial state and a solution plan for a task as a sequence of partial states [21]. Our planning formalism is based on a multi-valued state-variable representation where each variable is assigned a value from a multiple value domain (finite domain of a variable). For modeling planning problems, we used PDDL3.1,2the most recent version of the Planning Domain Definition Language [17] (PDDL). Definition 1. Planning task A planning task is given by the 4-tuple P=V,I,G,A: –Vis a finite set of state variables, each associated to a finite domain, Dv, of mutually exclusive values that refer to objects in the world. v∈Vmaps a tuple of objects to an object pof the planning task, which represents the value of v.Forexample, in a planetary Mars rovers domain,3arover (B) can be placed at any of the waypoints w1,w2or w3. Hence, the variable loc-Brepresents the location of rover B,andDloc-B={w1,w2,w3}. A variable assignment or fluent is a function fon avariablevsuch that f(v)∈D v,whereverf(v) 2PDDL syntax definition introduced in 2008 by M. Helmert (http: //ipc.informatik.uni-freiburg.de/PddlExtension/). 3Our PDDL specification of this domain can be found at http:// servergrps.dsic.upv.es/planinteraction/resources/. Fig. 2. Plan as a sequence of partial states. Variables are loc-B:location of rover B;link-w1-w2: map to travel from w1to w2;com-r: communication of the results of analyzing the rock r. Underlined variables are the preconditions of the action Navigate. is defined. A fluent is represented as a tuple v,p, meaning that the variable vtakes the value p. A total variable assignment or state applies the function fto all variables in V. A state is always interpreted as a world state. A partial variable assignment or partial state over Vapplies the function fto some subset of V. –Iis a state that represents the initial state of the planning task. –Gis a partial state over Vcalled the problem goal state. –Ais a finite set of actions over V. An action a is defined as a partial variable assignment pair a=pre,eff over Vcalled preconditions and effects, respectively. If an action is executable in a state, i.e. its preconditions hold in such a state, the values of the state variables (fluents) change as specified in the effects. An action plan, ΠA, that solves a planning task Pis a sequence of actions ΠA=a1,...,a nthat applied in the initial state Isatisfies the goal state G. An action ai∈ΠAis executable in a world state Sif the fluents contained in Ssatisfy the preconditions of ai;i.e. pre(ai)⊆S. The result of executing aiin a state Sis anewstateSthat contains the fluents of Swhich are not modified by eff(ai)plus the fluents as specified in eff(ai). Then, executing ΠAin the initial state Iresults in a sequence of states S1,...,S nsuch that S1is the result of applying a1in I,S2is the result of applying a2in S1,..., and Snis the result of applying anin Sn−1.AplanΠAis a solution plan iff G⊆Sn[21]. A plan can also be viewed from the point of view of the world conditions (fluents) that are necessary for the plan to be executed. That is, instead of viewing a plan as the result of its execution, we can view a plan as the necessary conditions for its execution. Thus, a plan can also be defined as a sequence of partial states, rather than world states, containing the minimal set of 348 C. Guzman et al. / Reactive execution for solving plan failures in planning control applications Fig. 3. Plan as a sequence of partial states for the plan ΠA. Variables are loc-B: location of rover B;loc-L: location of lander L;loc-r-w3: location of the rock r;have-B: indicates if Bhas the rock r;link-wi-wj: map to travel from wito wj;vis-w3-w2: location w2is visible from w3. com-r: results of analyzing the rock rare communicated. fluents thatmustholdintheworldfortheplantobe executableinsuchaworldstate. In the example depicted in Fig. 2, the partial state Gis the goal state Gof a planning task P,andit contains two fluents. Let’s consider the last action of aplanis(Navigate Bw 1w2), which achieves the effect loc-B,w2. Then, the necessary fluents to be able to execute the action and achieve the fluents in Gare represented in state G. We can observe that Gdoes not only contain the fluents that match the preconditions of the action Navigate (i.e., loc-B,w1and link-w1-w2,true, which represent that the location of rover Bmust be the waypoint w1and a link between w1and w2must exist, respectively) but also the fluent com-r,true. This is because this fluent (communicating the results of analyzing the rocks r) is a goal of Gthat is not achieved by the effects of the action Navigate. Thereby, com-r,trueis achieved earlier in the plan and it must hold in Gin order to guarantee that it is satisfied in G. The state Gin Fig. 2 is called a regressed partial state because it is calculated by regressing the goals in Gthrough the action Navigate. Likewise, the same regression can be applied to the rest of actions of a given plan ΠA.Letaibe an action and Ga goal state such that P=pre(ai),E=eff(ai)and E⊆G.Thepartial state Gin which aican be applied is calculated by the regressed transition function Γ(G, ai),definedas: G:= Γ(G, ai):=G\E∪P(1) Gis a partial state that represents the minimal set of fluents that must hold in the world state in order to achieve Gby means of the execution of ai. Notice that Gincludes P, the preconditions of ai, plus the fluents which are in Gbut are not produced by E(G\E); i.e., the fluents that are achieved before Gin the plan and must keep their values until G. The regressed partial state approach was first used by PLANEX [11] to supervise the execution of a se- Fig. 4. Plan ΠAfor a planetary Mars rover domain. quence of actions. Plans are represented by means of a triangle table (this structure provides support for plan monitoring) and the problem goals are regressed from the last column of the table, including action preconditions, through the remaining actions of the plan. Roughly, the regression of a fluent over an action (through the regressed transition function Γ)isasufficient and necessary condition for the satisfaction of the fluent following the execution of the action. The work in [19] formalizes this concept in the situation calculus language whereas we apply the same formalization in PDDL. Definition 2. Solution plan as a sequence of partial states Given a solution plan ΠA=a1,...,a nfor a planning task P,theregressed plan for ΠAis defined as a chronologically ordered sequence of partial states G0,G 1,...G n,where: Gn:= G G0⊆I Gi−1:= Γ(Gi,a i) A regressed plan is denoted by ΠG0−Gn,whereG0 is the initial partial state and Gnis the final partial state of the plan ΠA. Definition 2 specifies the relevant fluents at each time step for the successful execution of ΠA, where each ai∈ΠAis the relevant action for achieving Gifrom Gi−1. Hence, a regressed plan ΠG0−Gnderived from ΠAdenotes the fluents that must hold in the environment at each time step to successfully execute the actions in ΠA. In other words, this definition allows us to discern between the fluents that are relevant for the execution of a plan and those ones that are not. It exploits the idea of annotating plans C. Guzman et al. / Reactive execution for solving plan failures in planning control applications 349 Fig. 5. Repairing structures for a rover Bin a Planetary Mars Domain. a: regressed plan ΠG0−G5for a1,a 2,a 3,a 4,a 5,b1: the repairing structure of the plan window [a1,a2,a3], and b2: the repairing structure of the plan window [a4,a5]. with conditions that can be checked at execution time to confirm the validity of a plan [11]. That is, if the fluents of a partial state Gihold in a world state S (Gi⊆S) then the actions comprised in the plan fragment ΠGi−Gnare executable in S, thus guaranteeing the goals of the planning task are achieved. Figure 3 shows the regressed plan ΠG0−G5derived from the solution plan shown in Fig. 4, and calculated through the successive application of the regressed transition function Γ. The plan in Fig. 4 shows the actions for a rover to gather a rock sample, communicate the results of analyzing the rock and navigate back to the initial position. Action a2, for instance, creates the fluent have-B,rin G2; and the partial state G1 is the result from applying Γ(G2,a 2), which includes pre(a2)(the fluents which are underlined in node G1 of Fig. 3) plus the fluents that are in G2but are not produced by eff(a2). Therefore, if the sensor reading returns a world state in which all of the fluents in G1 hold, then action a2is executable in such a world state; if the fluents in G2occur in the subsequent world state then a3is executable and so on. The last partial state, G5, comprises G, the goals of the planning task. In terms of plan monitoring, G5represents the fluents that satisfy the preconditions of a fictitious final action, af, where pre(af)=Gand eff(af)=∅,i.e.Gis monitored by checking the preconditions of af. As a final remark, we note that the reactive execution model is defined at the same granularity level than the planning model, and both use PDDL as the specification language. This eases the communication between the planning service and execution agents and avoids the overhead of translating a high-level planning specification into a low-level description as it happens in other models [14]. 5. Reactive execution model The key concept of our reactive execution model is the repairing structure. Generally speaking, given a solution plan ΠA, a repairing structure Tis a partial-state search tree that encodes recovery plans for a plan window of ΠA. Since nodes in Tare partial states, the reactive execution model only handles the minimal data set that is necessary to carry out a repairing task. Figure 5 shows two repairing structures, T1and T2, for the regressed plan in Fig. 3 (for simplicity, we do 350 C. Guzman et al. / Reactive execution for solving plan failures in planning control applications not show all the partial states that would be generated). T1is the search tree associated to the plan window [a1,a 2,a 3], or, equivalently, to the regressed subplan ΠG0−G3. The length of the window is three (l=3), because it comprises three actions, and the partial state G3is called the root node (Gr)ofT1. A path in T1 represents a (regressed) plan to reach the root node G3. Specifically, a path in a repairing structure is interpreted as a recovery plan that leads the current world state to another state from which the execution of the plan ΠAcan be resumed. All recovery plans in T1 have one thing in common: they eventually guide the execution of the plan towards G3, the root node of T1. For instance, suppose that Sis the set of fluents that represents the state of the world state such that G 16 ⊆S(see Fig. 5 b1). The application of the plan Π=a1,a 4,a 8,a 6to Swill reach the partial state G3, from which the rest of the plan ΠA,a4,a 5, can be executed. The tree T2(see Fig. 5 b2) is associated to the plan window [a4,a 5], or to the regressed plan ΠG3−G5.The number of repairing structures necessary to keep track of the execution of a plan ΠAdepends on the time limit to create the search trees, which, in turn, delimits the size of the tree. Two parameters determine the size of a search space T, the length of the plan window associated to T(l), and the depth of the tree (d). In general, the larger the value of l, the more alternatives to find a recovery plan; and the deeper the tree, the longer the recovery plans comprised in T. The minimum value of dmust be l+1in order to ensure that the tree comprises at least one action that repairs the first action of the plan window associated to T. On the other hand, the maximum value of dis determined by the available time to build T. Particularly, in T1,d=6,whichresults from l=3and the time limit to build T1(Section 5.3 explains in detail how to estimate the maximum size of a repairing structure). In the following, we explain (1) the process to build a repairing structure, (2) how to find a plan in a search tree to repair a failure and (3) the analysis to estimate the size of the search tree. 5.1. Building a repairing structure T The construction of the repairing structure Tstarts after estimating the size of T; i.e., when the values of l and dare known. The generation process, shown in Algorithm 1, consists in expanding Tfrom the root node Grvia the application of the regressed transition function Γ(G, a)following Eq. (1) (line 6 of Algorithm 1). The algorithm is a classical backward construction of a planning search space [21], where a node Gis expanded until depth(G)=d;i.e.,Greaches the maximum depth tree (line 4), or Gis superseded by another node that exists in the tree (lines 7 to 13 define a mechanism for the control of repeated states which is detailed below). Input: Gr,d Output: T 1: Q←{Gr},T←{Gr} 2: while Q =∅do 3: G←remove first node from Q 4: if depth(G)<dthen 5: for all {a|a∈Ais a relevant action to G}do 6: G←Γ(G, a) 7: if G/∈T then 8: if ∃G∈T |G⊂Gthen 9: mark Gas superset of G 10: else 11: Q←Q∪G 12: set transition (labeled a) from Gto G 13: T←T∪G 14: else 15: Q←∅ 16: return T Algorithm 1: Generating the repairing structure T. The purpose of Algorithm 1 is to generate multiple regressed plans from Gr. Unlike the application of Γ(G, a)in Definition 2, which departs from a given solution plan ΠA, such a plan does not exist when building a tree T. Actually, the aim of Algorithm 1 is precisely to find the relevant actions for a node G(line 5), and eventually create a plan ΠAthat links two particular partial states. The operation of regressing a fluent fin a node G over an action achecks whether ais a relevant action to achieve for not. An action ais relevant for f,and originates an arc (G,G)in T, if it does not cause any conflict with the fluents in Gand G. The construction of Thas then to check two consistency restrictions: (1) that eff(a)does not conflict with the fluents in G,and (2) that pre(a)does not conflict with the fluents in G. We define Φ(G,G)as the function that returns whether or not a conflict between two sets of fluents Gand Gexists. Φ(G,G)holds if ∃v,p∈Gand ∃v,p∈Gand p=p. Definition 3. Relevant action Given a fluent f∈G, ais a relevant action for fif the following conditions hold: 1) f∈eff(a)and C. Guzman et al. / Reactive execution for solving plan failures in planning control applications 351 2) ¬Φ(eff(a),G)and 3) G=Γ(G, a)∧¬Φ(pre(a),G ) The construction of Tfollows the application of Definition 3 for each fluent of a partial state Gwhich has not reached depth(G)=d(lines4and5ofAlgo- rithm 1), and the expansion continues until no new partial states are added to the tree. The search space Tis actually a graph due to the existence of multiple paths that reach the same partial state from the root node during the construction of T. Multiple paths are originated because of actions like (Communicate rock B L w3w2) and (Communicate soil B L w3w2), which can be executed in either order, or the existence of reversible actions like (Navigate Bw 1w2)and(Navigate Bw 2w1). Consequently, Tmay contain many redundant paths. A set of state variables induce a state space that has a size that is exponential in the set, and, for this reason, planning, as well as many search problems, suffer from a combinatorial explosion. Even though nodes in Tare partial states that contain far less fluents than world states, the large size of the repairing structures are sometimes unaffordable for a reactive system. With the aim of reducing the size of T, we only consider for expansion the fluents of Gthat are related to the relevant variables, that is, the variables involved in the preconditions of the actions of the plan window. Thus, given a plan window [a1,a 2,a 3], we approximate Tby expanding only the fluents related to the relevant variables involved in the set pre(a1)∪pre(a2)∪pre(a3), which is actually the set of fluents that might need to be repaired. The time complexity of Algorithm 1 responds to the classical complexity of the generation of a tree, that is O(ˆ bd),whereˆ bis the estimated branching factor of Tthat is detailed in Section 5.3. The generation process makes two nodes in Tbe connected by a unique simple path. Since we are interested in keeping only the shortest (optimal) paths, the construction of Tprunes repeated states (line 7 in Algorithm 1) and avoids the expansion of superset nodes (lines 8 and 9). Let’s assume that Tcontains a path from a node Gto the root node Grof T. A node G such that G⊂Gis said to be a superset of node G.In this case: –Gstands for the minimal set of fluents that must hold in Sin order to execute the actions of the path that reaches Gr. –The best recovery plan from Gis also the best path from Gbecause the RP returns the shortest plan to Gr. All in all, a repairing structure encodes the optimal path between each pair of nodes for which a recovery plan can be found. Once the RP has created T,itcommunicates the MO all the variables involved in T. 5.2. Repairing a failure When an action of the plan window associated to a repairing structure Tfails, the RP finds a way to keep the plan going, either by reaching a partial state in T from which to execute the faulty action again or rather another state from which to execute a later action of the plan window. Let Tbe a repairing structure of a regressed plan ΠG0−Grassociated to the plan window [a1,...,a r]of aplanΠA.Whenanactionin[a1,...,a r] fails, a repairing task defined as R=S, Gtis activated, where S4is the set of fluents of the current world state and Gt is the target state we want to reach in T. The node Gt varies depending on the failed action and the particular repairing task for such action. Since several recovery plans can be found to fix a faulty action, the RP will successively execute a repairing task until one of them is successful for fixing the action. This way, if the erroneous action is a1, the RP will first try the repairing task R=S, G0; otherwise, it will try R=S, G1 and so on until Gt=Gr; if the failure occurs in a2, the first attempt will be R=S, G1and the last attempt will be for Gt=Gr; in the case that the failure affects ar, only two repairing tasks can be realized, R=S, Gr−1and R=S, Gr. More formally, given R=S, Gtfor a faulty action a, the RP applies a modified breadth-first search from Gtuntil a node Gsthat satisfies Gs⊆Sis found in T.Gsis a consistent state with S, a state that comprises all the necessary fluents to execute in the current world state the plan formed with the actions from Gsto Gt.IfGs⊆Sis found, the recovery plan from Gsto Gtis concatenated with the plan from Gtto Gr(unless Gt=Gr), and with the plan from Grto Gn,whereGnis the last state of the original plan ΠA which contains G, the problem goal state. If Gs⊆S is not found, the RP will execute the subsequent repairing task R=S, Gt+1until one of them successfully retrieves a recovery plan or Ris invoked with Gt =Grand a plan is not found. In this latter case, T does not comprise the necessary information to find a 4Technically speaking, the MO does not communicate the RP all of the fluents in Sbut only the values of the variables that appear in T; these variables were sent by the RP to the MO after building T. 358 C. Guzman et al. / Reactive execution for solving plan failures in planning control applications Table 4 Summary of statistics for RP, LPG-ADAPT and LAMA performance Stability (%) ΔΠ ATime (ms) μσ μσ μ σ RP 92 19 0.97 0.85 1.85 4.33 LPG-ADAPT 85 19 2.40 1.94 49.47 4.72 LAMA 51 27 1.33 1.52 62.83 36.99 alyze it, or calibrating the rover’s camera again (e.g., failure 2 of problem 4). Failures of type C were found in two cases, which could be repaired because their respective T1included paths involving the second rover (e.g., failure 3 of problem 6). Here, a hardware failure prevent the rover from analyzing the soil in a specific location, our model repairs the failure using the second rover that explores the area seeking for soils, analyzes the soil and communicates the results to the lander. In the failures of type D, the RP takes advantage of the positive failure, which achieves the effects of the next action to execute and, consequently, the RP proceeds with the following action in ΠA. The performance results in Table 3 and the summary of statistics in Table 4 show that our RP performs admirably well in all the measured dimensions. Regarding stability, RP outperfomrs LPG-ADAPT and LAMA. LAMA is the approach with the worst rate of stability (51%), which is reasonable since the planner does not repair a plan but it computes a new plan. In Table 3 we can see that the plan quality or number of actions of Π Ais slightly higher with the RP than with LAMA in some cases (e.g., failure 1 of problem 12 or failure 3 of problem 7), and lower in some other cases (e.g. failure 2 of problem 12 or failures 1 and 2 of problem 10). LAMA is able to find shorter plans in a few cases because it computes a plan for the new situation without being subject to keep the actions in ΠA. Nevertheless, all in all, the RP returns plans of better quality than LAMA as Table 4 shows (the mean value in the increase of the number of actions is 0.97 in RP against 1.33 in LAMA). The comparison between RP and LPG-ADAPT clearly benefits RP in both stability and quality of the recovery plan, particularly in the most complex problems (10 to 12). As for the computation time, finding a recovery path to the root node is more costly since the repairing mechanism explores the entire search space. However, RP shows outstanding results compared to LPG-ADAPT and LAMA, which proves the benefit of using the RP to repair plan failures in reactive environments besides avoiding the overhead of communicating with a deliberative planner. In conclusion, we can affirm that our model is a robust recovery mechanism for reactive planning that also provides good-quality solutions. 8. Limitations and extensions of the model The results in Section 7 show that our reactive execution model meets the performance needs of a reactive plan repair and that it also outperforms other repairing mechanisms. However, the model presents some limitations that we intend to overcome in the future. One limitation is the machine dependency of the estimation model explained in Section 5.3. In order to reproduce the experiments, or to export them to other systems, the training of the estimation model must be repeated to adjust the value of ¯ tΓfor a particular processor. Assuming several agents executing their plans in a common environment, a repairing task of an agent might cause conflicts in the plan of the others. Additionally, the occurrence of failures could restrict the capabilities of the agents, preventing them from achieving some goal. Therefore, a multi-agent approach where execution agents act, coordinate and jointly repair a failure is desirable [2,16,35]. A communication protocol that helps agents request, provide and agree on a particular recovery plan is a desirable approach for a multi-agent repair system [25]. Particularly, the present work represents a first step towards a multi-agent P&E system capable of coordinating agents plans while minimizing crowd-effects [44]. Our model can be easily extended to parallel and temporal planning. The parallel execution of several actions of an agent is achievable by grouping together the preconditions and effects of the parallel actions into a new action. The existence of grouped actions would avoid the duplicated states that arise from the multiple serialization of the actions in the group. On the other hand, handling durative actions in temporal planning would involve creating a regressed partial state at each relevant time point of an action and adding fluents to represent the ongoing executing actions at each execution cycle. 9. Conclusions and future works This paper presents a reactive execution model, which comprises a RP, to recover from failures in planning control applications. The model is embedded into a P&E system where an execution agent receives a plan from a deliberative planner and its mission is to monitor, execute and repair the given plan. Providing time-bounded responses in reactive environments is a difficult and sometimes unfeasible task C. Guzman et al. / Reactive execution for solving plan failures in planning control applications 359 due to the unpredictability of the environment and the impossibility to guarantee a response within a given time. An alternative solution to overcome this difficulty is working with time-bounded data structures rather than designing time-bounded reasoning processes. By following this approach, our model ensures the availability of a repairing structure, or search tree, within a given time, which is later used to fix the action failures during the plan execution. Several features have been considered in order to have a search tree generated in due time: (1) the tree is formed of partial states which contain far less fluents than world states; (2) the tree is limited to a particular fragment of the plan and tree depth that are calculated by an estimation model; and (3) the expansion of the tree only considers the relevant variables that might potentially fail during the plan execution.Under these criteria, we show the results obtained for two different domains, a simulation of a real NASA space problem, and a vehicle routing domain. The results corroborate that there is a 95% likelihood to obtain a repairing structure in time. Additionally, the exhaustive experimentation on the repairing tasks confirm that the repairing structure together with the search recovery process is a very suitable mechanism to fix failures that represent slight deviations from the main course of action in a planning control application. The results support several conclusions: the accuracy of the model to generate repairing structures in time, the usefulness of a single repairing structure to repair more than one action in a plan fragment while reusing the original plan as much as possible, and the reliability and performance of our recovery search procedure in comparison with other well-known classical planning mechanisms. The current RP can be extended in several different directions as, for instance, by including the necessary machinery to deal with temporal plans. Our next future work is to exploit this model for a multi-agent recovery mechanism in which agents dynamically form a teamwork at execution time and work together in the repair of a plan failure. Acknowledgments This work has been partly supported by the Spanish MICINN under the projects TIN2014-55637-C2-2-R, and the Valencian project PROMETEOII/2013/019. References [1] P. Aschwanden, V. Baskaran, S. Bernardini, C. Fry, M. Moreno, N. Muscettola, C. Plaunt, D. Rijsman and P. Tompkins, Model-unified planning and execution for distributed autonomous system control, in: AAAI Fall Symposium on Spacecraft Autonomy, (2006). [2] R. Badawy, A. Yassine, A. Heßler, B. Hirsch and S. Albayrak, A novel multi-agent system utilizing quantum-inspired evolution for demand side management in the future smart grid, Integrated Comp-Aided Engineering 20(2) (2013), 127–141. [3] A.G. Banerjee and S.K. Gupta, Research in automated planning and control for micromanipulation, IEEE Transactions on Automation Science and Engineering 10(3) (2013), 485– 495. [4] P. Baraldi, R. Canesi, E. Zio, R. Seraoui and R. Chevalier, Genetic algorithm-based wrapper approach for grouping condition monitoring signals of nuclear power plant components, Integrated Comp-Aided Engineering 18(3) (2011), 221–234. [5] J.C. Bongard and H. Lipson, Automated damage diagnosis and recovery for remote robotics, in: IEEE Robotics and Automation 4(2004), 3545–3550. [6] M. Brenner and B. Nebel, Continual planning and acting in dynamic multiagent environments, Autonomous Agents and Multi-Agent Systems 19(3) (2009), 297–331. [7] B. Browning, J. Bruce, M. Bowling and M. Veloso, STP: Skills, tactics and plays for multi-robot control in adversarial environments, IEEE Journal of Control and Systems Engineering 219 (2005), 33–52. [8] J. Bryson and L.A. Stein, Modularity and design in reactive intelligence, Intl Joint Conference on Artificial Intelligence (2001), 1115–1120. [9] S. Chien, B. Cichy, A. Davies, D. Tran, G. Rabideau, R. Castaño, R. Sherwood, D. Mandl, S. Frye, S. Shulman, J. Jones and S. Grosvenor, An autonomous earth-observing sensorweb, IEEE Intelligent Systems 20(2005), 16–24. [10] J.Y.J. Chow, Activity-based travel scenario analysis with routing problem reoptimization, Comp-Aided Civil and Infrastruct Engineering 29(2) (2014), 91–106. [11] R.E. Fikes, P.E. Hart and N.J. Nilsson, Learning and executing generalized robot plans, Artificial Intelligence 3(1972), 251– 288. [12] W. Fink, J.M. Dohm, M.A. Tarbell, T.M. Hare and V.R. Baker, Next-generation robotic planetary reconnaissance missions: A paradigm shift, Planetary and Space Science 53(14) (2005), 1419–1426. [13] A. Finzi, F. Ingrand and N. Muscettola, Model-based executive control through reactive planning for autonomous rovers, in: IEEE Intelligent Robots Systems 1(2004), 879–884. [14] L. Flückiger and H. Utz, Service oriented robotic architecture for space robotics: Design, testing, and lessons learned, Jof Field Robotics 31(1) (2014), 176–191. [15] T.W. Fong, M. Bualat, M. Deans, M. Allan, X. Bouyssounouse, M. Broxton, L. Edwards, R. Elphic, L. Fluckiger, J. Frank, L. Keely, L. Kobayashi, P. Lee, S.Y. Lee, D. Lees, E. Pacis, E. Park, L. Pedersen, D. Schreckenghost, T. Smith, V. To and H. Utz, Field testing of utility robots for lunar surface operations, in: AIAA Space Conference and Exposition (2008), 22–27. [16] A. Fougères and E. Ostrosi, Fuzzy agent-based approach for consensual design synthesis in product configuration, Integrated Comp-Aided Engineering 20(3) (2013), 259–274. [17] M. Fox and D. Long, Pddl2.1: An extension to pddl for expressing temporal planning domains, Journal of Artificial Intelligence Research,20 (2003), 61–124. [18] M. Fox, A. Gerevini, D. Long and I. Serina, Plan stability: Replanning versus plan repair, in: Automated Planning and 360 C. Guzman et al. / Reactive execution for solving plan failures in planning control applications Scheduling (2006), 212–221. [19] C. Fritz and S.A. McIlraith, Monitoring plan optimality during execution, in: Automated Planning and Scheduling (2007), 144–151. [20] A. Garrido and E. Onaindia, Assembling learning objects for personalized learning: An ai planning perspective, IEEE Intelligent Systems 28(2) (2013), 64–73. [21] M. Ghallab, D. Nau and P. Traverso, Automated Planning: Theory & Practice, Elsevier, 2004. [22] M. Ghallab, D.S. Nau and P. Traverso, The actor’s view of automated planning and acting: A position paper, Artificial Intelligence Journal 208 (2014), 1–17. [23] K. Görlach, M. Sonntag, D. Karastoyanova, F. Leymann and M. Reiter, Conventional workflow technology for scientific simulation, in: Guide to e-Science (2011), 323–352. [24] C. Guzmán, V. Alcázar, D. Prior, E. Onaindia, D. Borrajo, J. Fdez-Olivares and E. Quintero, PELEA: A domainindependent architecture for planning, execution and learning, in: Scheduling and Planning Applications woRKshop 12 (2012), 38–45. [25] C. Guzmán, P. Castejon, E. Onaindia and J. Frank, Multiagent reactive planning for solving plan failures, in: Hybrid Artificial Intelligent Systems – 8th International Conference, Lecture Notes in Computer Science 8073 (2013), 530–539. [26] M.R. Hagerty and V. Srinivasan, Comparing the predictive powers of alternative multiple regression models, Psychometrika 56(1) (1991), 77–85. [27] R. Haijema and E.M.T. Hendrix, Traffic responsive control of intersections with predicted arrival times: A markovian approach, Comp-Aided Civil and Infrastruct Engineering 29(2) (2014), 123–139. [28] Y. Kuwata, A. Elfes, M. Maimone, A. Howard, M. Pivtoraiko, T.M. Howard and A. Stoica, Path planning challenges for planetary robots, in: IEEE Intelligent Robots Systems (2008), 22–27. [29] S. Lemai and F. Ingrand, Interleaving temporal planning and execution in robotics domains, in: Innovative Applications of Artificial Intelligence (2004), 617–622. [30] M.W. Maimone, P.C. Leger and J.J. Biesiadecki, Overview of the mars exploration rovers’ autonomous mobility and vision capabilities, in: IEEE Robotics and Automation, Jet Propulsion Laboratory, NASA (2007). [31] M.G. Marchetta and R. Forradellas, An artificial intelligence planning approach to manufacturing feature recognition, Comp-Aided Design 42(3) (2010), 248–256. [32] C. McGann, F. Py, K. Rajan, H. Thomas, R. Henthorn and R. McEwen, A deliberative architecture for auv control, in: IEEE Robotics and Automation (2008), 1049–1054. [33] N. Meuleau and D.E. Smith, Optimal limited contingency planning, Uncertainty in Artificial Intelligence (2003), 417– 426. [34] A. Milani and V. Poggioni, Planning in reactive environments, Computational Intelligence 23(4) (2007), 439–463. [35] I. Montalvo, J. Izquierdo, R. Pérez-García and M. Herrera, Water distribution system computer-aided design by agent swarm optimization, Comp-Aided Civil and Infrastruct Engineering 29(6) (2014), 433–448. [36] J. Patel, M.C. Dorneich, D.H. Mott, A. Bahrami and C. Giammanco, Improving coalition planning by making plans alive, IEEE Intelligent Systems 28(1) (2013), 17–25. [37] C. Piacentini, V. Alimisis, M. Fox and D. Long, Combining a temporal planner with an external solver for the power balancing problem in an electricity network, in: the 23th Automated Planning and Scheduling, AAAI (2013), 398–406. [38] S. Richter and M. Westphal, The LAMA planner: Guiding cost-based anytime planning with landmarks, Journal of Artificial Intelligence Research 39(1) (2010), 127–177. [39] A. Rodríguez and J.A. Reggia, Collective-movement teams for cooperative problem solving, Integrated Comp-Aided Engineering 12(3) (Jul 2005), 217–235. [40] M. Santofimia, X. del Toro, P. Roncero-Sánchez, F. Moya, M. Martinez and J. López, A qualitative agent-based approach to power quality monitoring and diagnosis, Integrated Comp- Aided Engineering 17(4) (2010), 305–319. [41] J. Sedano, C. Chira, J. Villar and E. Ambel, An intelligent route management system for electric vehicle charging, Integrated Comp-Aided Engineering 20(4) (2013), 321–333. [42] M. Smart, B. Ratnakumar, L. Whitcanack, F. Puglia, S. Santee and R. Gitzendanner, Life verification of large capacity yardney li-ion cells and batteries in support of nasa missions, Intl Journal of Energy Research 34(2) (2010), 116–132. [43] S. Sohrabi, J.A. Baier and S.A. McIlraith, Diagnosis as planning revisited, in: 21st Intl Workshop on the Principles of Diagnosis (2010), [44] Q. Sun and S. Wu, A configurable agent-based crowd model with generic behavior effect representation mechanism, Comp-Aided Civil and Infrastruct Engineering 29(7) (2014), 531–545. [45] P. Toth and D. Vigo, The Vehicle Routing Problem, Philadelphia, PA, USA: Society for Industrial and Applied Mathematics, 2001. [46] C. uise, J.C. Beck and S.A. McIlraith, Flexible execution of partial order plans with temporal constraints, in: the 23th Intl Joint Conference on Artificial Intelligence, AAAI, (2013), 2328–2335. [47] W. Xie and Y. Ouyang, Dynamic planning of facility locations with benefits from multitype facility colocation, Comp-Aided Civil and Infrastruct Engineering 28(9) (2013), 666–678.