Temporal Planning in Dynamic Environments for P-CLAIM Agents Muhammad Adnan Hashmi Laboratoire d’Informatique de Paris 6 Universit´ e Pierre et Marie Curie 75016 Paris, France Email: Adnan.Hashmi@lip6.fr Amal El Fallah Seghrouchni Laboratoire d’Informatique de Paris 6 Universit´ e Pierre et Marie Curie 75016 Paris, France Email: Amal.Elfallah@lip6.fr Abstract—Time and uncertainty of the environment are very important aspects in the development of real world applications. Another important issue for the real world agents is, the balance between deliberation and reactivity. But most of the agent oriented programming languages ignore some or all of these important aspects. In this paper we try to fill this gap by present- ing an extension to the architecture of CLAIM agent oriented programming language to endow the agents with the planning capability. We remove the assumption that agents’ actions are instantaneous. We are interested in the temporal planning of on the fly goals. A coherrent framework is proposed in which agents are able to generate, monitor and repair their temporal plans. Our proposed framework creates a balance between reactivity and deliberation. This work could be considered as a first step towards a complete temporal planning solution for an AOP language. I. I NTRODUCTION Most of the agent oriented programming languages in the current literature use a PRS like approach to achieve the goals of agent. Some examples of these programming languages are Jason[1], 3APL[2], 2APL[3] and JACK[4]. But these languages lack the ability to incorporate planning. Sometimes the execution of the actions without planning results in the unability to achieve the goals. There has been some work to incorporate planning within such programming languages [5], [6], [7] but these systems do not take into account the duration of agent actions, neither do they consider the uncertainty of the environment. These systems assume that the agents’ actions are instantaneous and that the effects produced on the environ- ment are only those which are produced by the agent’s actions. But these assumptions are unrealistic for the development of real world applications. There are some systems like ZENO[8], TGP[9], SAPA[10] which give the ability to plan with durative tasks and even there are systems which give this ability in the dynamic environments like IxTeT[11]. But these systems are separate planning solutions. They are not programming languages, so they lack the flexibility and control that a programming language offers to its programmers. Moreover, these systems are built on a proactive approach but in the real world applications it is necessary to create a balance between proactivity and reactivity because it is a dynamic world and the goals of agents are not necessarily given to him at the start, new goals arrive and some old goals are dropped during the life cycle of the agent and some goals require immediate achievement. In this work, we try to fill these gaps by incorporating a temporal planner, an executor, an execution monitor and a plan repairing component to a CLAIM agent[12]. We call this extension of the language as P-CLAIM. The main problems dealt with in this work are 1) Modifications and extensions to the CLAIM agent’s architecture to include a temporal planning component. 2) Execution monitoring and plan repairing. 3) Creating a balance between deliberation and reactivity. In our proposed framework, we have made use of Hier- archical Task Network (HTN) planning technique. The main algorithm used to generate plan for a goal is JSHOP2[13], which is very efficient HTN planning system and plans for tasks in the same order that they will later be executed. The main motivation behind using the HTN planning technique is the similarities among the BDI model of agency and the HTN planning technique[14]. Due to these similarities HTN planning is more suitable and natural candidate for incorporating planning in a BDI like system. The remainder of this paper is organized as follows. Section 2 puts some light on the current architecture of CLAIM language and JSHOP2 planner. In section 3, some important representations are presented which are helpful in under- standing the agent architecture in P-CLAIM. Our proposed architecture of P-CLAIM agent with planning, execution and plan repairing components is presented in section 4. In section 5, we give an example to describe the working of system. Section 6 discussed some of the related work. Section 7 concludes the paper and some future directions are discussed. II. BACKGROUND In this section, we briefly discuss the architecture of CLAIM language and JSHOP2 algorithm to generate a plan. A multi- agent system in CLAIM is a set of distributed hierarchies of agents deployed on computers connected via a network. All the computers have a global clock. With respect to the hierarchical representation, an agent is a node in a hierarchy. It is an autonomous, intelligent and mobile entity. It has a parent and contains (optional) sub-agents, running processes and cognitive elements (e.g. knowledge, goals, capabilities). An agent can dynamically create another agent, and the newly