Acting Within BDI Agent Architecture –
Total Page:16
File Type:pdf, Size:1020Kb
Automated Planning and Acting – Acting within BDI Agent Architecture – O. Boissier IMT Mines Saint-Etienne, France Défi IA — Spring 2021 Acting I How to perform chosen actions I Acting6=Execution ActorAgent Deliberation components I Agent is situated in a dynamic Objectives Planning unpredictable environment QueriesDeliberation Other Plans actorsagents I Adapt actions to current Actingcomponents Messages context I React to events Commands Percepts I Relies on ExecutionExecution platformplatform I Operational models of actions Actuations Signals I Observations of current state External World I Acting6=Planning 2 Outline Agent Oriented Programming BDI Architecture Agent Oriented Programming with Jason Comparison with other paradigms Conclusions and wrap-up 3 Agent Oriented Programming Features I Reacting to events × long-term goals I Course of actions depends on circumstance I Plan failure (dynamic environments) I Social ability ; see course on Integrating and engineering intelligent systems I Combination of theoretical and practical reasoning I Theoretical reasoning is directed towards beliefs, knowledge ; see course on Knowledge representation and reasoning I Practical reasoning is directed towards actions ; this course 4 Agent Oriented Programming Fundamentals I Use of mentalistic notions and a societal view of computation [Shoham, 1993] I Heavily influenced by the BDI architecture and reactive planning systems [Bratman et al., 1988] 5 Literature Agent Oriented Programming Books: [Bordini et al., 2005], [Bordini et al., 2009] Proceedings: ProMAS, DALT, LADS, EMAS, AGERE, ... Surveys: [Bordini et al., 2006], [Fisher et al., 2007] ... Languages of historical importance: Agent0 [Shoham, 1993], AgentSpeak(L) [Rao, 1996], MetateM [Fisher, 2005], 3APL [Hindriks et al., 1997], Golog [Giacomo et al., 2000] Other prominent languages: Jason [Bordini et al., 2007a], Jadex [Pokahr et al., 2005], 2APL [Dastani, 2008], GOAL [Hindriks, 2009], JACK [Winikoff, 2005], JIAC, AgentFactory But many other languages and platforms... 6 Some Languages and Platforms Agent Oriented Programming Jason (Hübner, Bordini, ...); 3APL and 2APL (Dastani, van Riemsdijk, Meyer, Hindriks, ...); Jadex (Braubach, Pokahr); MetateM (Fisher, Guidini, Hirsch, ...); ConGoLog (Lesperance, Levesque, ... / Boutilier – DTGolog); Teamcore/ MTDP (Milind Tambe, ...); IMPACT (Subrahmanian, Kraus, Dix, Eiter); CLAIM (Amal El Fallah-Seghrouchni, ...); GOAL (Hindriks); BRAHMS (Sierhuis, ...); SemantiCore (Blois, ...); STAPLE (Kumar, Cohen, Huber); Go! (Clark, McCabe); Bach (John Lloyd, ...); MINERVA (Leite, ...); SOCS (Torroni, Stathis, Toni, ...); FLUX (Thielscher); JIAC (Hirsch, ...); JADE (Agostino Poggi, ...); JACK (AOS); Agentis (Agentis Software); ...Jackdaw (Calico Jack); simpAL, ALOO (Ricci, ...); 7 Theories, Models, Architectures Agent Oriented Programming I Agents are used to solve problems (e.g. to find solutions, to take decisions, to act on the environment) I The characteristics of the problem influence the way the agents are built ; we then talk about agent architectures I It may be the case that some architectures are designed using general principles ; we then talk about agent models I Some of these models have a theory associated with them that allows the verification of some properties ; we then talk about agent theories Several agent architectures, models and theories exist in the literature!!! 8 Agent Architectures Agent Oriented Programming I Modules Organisation: P P A P A A P : perception, A : action a) horizontal architecture b) modular vertical architecture c) layered vertical architecture one path two paths I Control flow: one / several I Data flow: broadcast, translation I Control structure: inhibition, hierarchy, ... 9 Outline Agent Oriented Programming BDI Architecture Agent Oriented Programming with Jason Comparison with other paradigms Conclusions and wrap-up 10 BDI “Mental” Notions (the mentalistic view) The behavior of the agent is explained in terms of its mental state: I Beliefs (B): information that the agent has about its environment (updated by perception, reasoning, communication) I Desires (D): states/goals that the agent wishes to be true (aka Goals) I Intentions (I): desires the agent has committed to (based on the current beliefs, desires and other intentions) 11 BDI architecture [Wooldridge, 2009] 1 while true do 2 B brf (B;perception()) ; // belief revision 3 D options(B;I ) ; // desire revision 4 I filter(B;D;I ) ; // deliberation 5 π plan(B;I ;A) ; // means-end 6 while π 6= ; do 7 execute( head(π) ) 8 π tail(π) 12 BDI architecture [Wooldridge, 2009] 1 while true do 2 B brf (B;perception()) ; // belief revision 3 D options(B;I ) ; // desire revision 4 I filter(B;D;I ) ; // deliberation 5 π plan(B;I ;A) ; // means-end 6 while π 6= ; do 7 execute( head(π) ) 8 π tail(π) fine for pro-activity, but not for reactivity (over commitment) 12 BDI architecture [Wooldridge, 2009] 1 while true do 2 B brf (B;perception()) ; // belief revision 3 D options(B;I ) ; // desire revision 4 I filter(B;D;I ) ; // deliberation 5 π plan(B;I ;A) ; // means-end 6 while π 6= ; do 7 execute( head(π) ) 8 π tail(π) 9 B brf (B;perception()) 10 if :sound(π;I ;B) then 11 π plan(B;I ;A) revise commitment to plan – re-planning for context adaptation 12 BDI architecture [Wooldridge, 2009] 1 while true do 2 B brf (B;perception()) ; // belief revision 3 D options(B;I ) ; // desire revision 4 I filter(B;D;I ) ; // deliberation 5 π plan(B;I ;A) ; // means-end 6 while π 6= ; and :succeeded(I ;B) and :impossible(I ;B) do 7 execute( head(π) ) 8 π tail(π) 9 B brf (B;perception()) 10 if :sound(π;I ;B) then 11 π plan(B;I ;A) revise commitment to intentions – Single-Minded Commitment 12 BDI architecture [Wooldridge, 2009] 1 while true do 2 B brf (B;perception()) ; // belief revision 3 D options(B;I ) ; // desire revision 4 I filter(B;D;I ) ; // deliberation 5 π plan(B;I ;A) ; // means-end 6 while π 6= ; and :succeeded(I ;B) and :impossible(I ;B) do 7 execute( head(π) ) 8 π tail(π) 9 B brf (B;perception()) 10 if reconsider(I ;B) then 11 D options(B;I ) 12 I filter(B;D;I ) 13 if :sound(π;I ;B) then 14 π plan(B;I ;A) reconsider the intentions (not always!) 12 Intentions I Intentions pose problems for the agents: they need to determine a way to achieve them (planning and acting) I Intentions provide a “screen of admissibility” for adopting new intentions I Agents keep tracking their success of attempting to achieve their intentions I Agents should not spend all their time revising intentions (losing pro-activity and reactivity) 13 Outline Agent Oriented Programming BDI Architecture Agent Oriented Programming with Jason Agent Abstractions in Jason Agent Dynamics Other language features Comparison with other paradigms Conclusions and wrap-up 14 Overall view Agent Oriented Programming with Jason Dimension Belief * Goal Concept * Event * * * * Action Agent Plan * * * composition * Agent Simplified Conceptual View (Jason meta-model [Bordini et al., 2007b]): Simple Agent Program: example bob.asl example carl.asl 15 Jason The foundational language for Jason is AgentSpeak I Originally proposed by Rao [Rao, 1996] I Programming language for BDI agents I Elegant notation, based on logic programming I Inspired by PRS [Georgeff and Lansky, 1987], dMARS [d’Inverno et al., 1997], and BDI Logics [Rao et al., 1995] I Abstract programming language aimed at theoretical results 16 Jason A practical implementation of a variant of AgentSpeak / BDI I Jason implements the operational semantics of a variant of AgentSpeak I Has various extensions aimed at a more practical programming language (e.g. definition of the MAS, communication, ...) I Highly customised to simplify extension and experimentation I Developed by Jomi F. Hübner, Rafael H. Bordini, and others 17 Outline Agent Oriented Programming BDI Architecture Agent Oriented Programming with Jason Agent Abstractions in Jason Agent Dynamics Other language features Comparison with other paradigms Conclusions and wrap-up 18 Main Language Constructs Beliefs: represent the information available to an agent (e.g. about the environment or other agents) Goals: represent states of affairs the agent wants to bring about Plans: are recipes for action, representing the agent’s know-how Actions can be internal, external, communicative or organisational ones Events: happen as consequence to changes in the agent’s beliefs or goals Intentions: plans instantiated to achieve some goal Note: identifiers starting in upper case denote variables 19 Main Language Constructs and Runtime Structures Beliefs: represent the information available to an agent (e.g. about the environment or other agents) Goals: represent states of affairs the agent wants to bring about Plans: are recipes for action, representing the agent’s know-how Actions can be internal, external, communicative or organisational ones Runtime structures: Events: happen as consequence to changes in the agent’s beliefs or goals Intentions: plans instantiated to achieve some goal Note: identifiers starting in upper case denote variables 19 Belief representation Agent Oriented Programming with Jason Syntax Beliefs are represented by annotated literals of first order logic functor(term1, ..., termn)[annot1, ..., annotm] Example (belief base of agent Tom) red(box1)[source(percept)]. friend(bob,alice)[source(bob)]. lier(alice)[source(self),source(bob)]. ~lier(bob)[source(self)]. 20 Goal representation Agent Oriented Programming with Jason Syntax Goals are represented as beliefs with a prefix: I ! to denote achievement goal (goal to do) I ?