Presentation is loading. Please wait.

Presentation is loading. Please wait.

FIPA Agents and Platform M. Cossentino. Paradigm shift in programming time assembler procedural object agent Abstraction level.

Similar presentations


Presentation on theme: "FIPA Agents and Platform M. Cossentino. Paradigm shift in programming time assembler procedural object agent Abstraction level."— Presentation transcript:

1 FIPA Agents and Platform M. Cossentino

2 Paradigm shift in programming time assembler procedural object agent Abstraction level

3 How agent technology will progress over time according to Agentlink II Source: Agentlink II Roadmap

4 Past and future Source: Agentlink II Roadmap

5 Past and future Source: Agentlink II Roadmap

6 Agent-related concepts Platform Communication Ontology Not specifically agent concepts: –services –applications

7 Where can you find agents today distributed artificial intelligence, robotics, artificial life (also in video game), distributed object computing, human-computer interaction, intelligent and adaptive interfaces, intelligent search and filtering, information retrieval, etc.

8 Different kind of agents An example of categorization Autonomous agents –Biological agents –Computational agents Software agents –Task specific agents –Entertainment agents –Viruses Artificial life agents –Robotic agents … others to come

9 Different kinds of agents Another categorization: Mobile agents Interface agents Collaborative agents Information agents Reactive agents Hybrid agents Heterogeneous agents

10 What is an agent Perhaps the most general way in which the term agent is used is to denote a hardware or (more usually) software-based computer system that enjoys the following properties: autonomy: agents operate without the direct intervention of humans or others, and have some kind of control over their actions and internal state; social ability: agents interact with other agents (and possibly humans) via some kind of agent-communication language [Genesereth and Ketchpel, 1994]; reactivity: agents perceive their environment, (which may be the physical world, a user via a graphical user interface, a collection of other agents, the INTERNET, or perhaps all of these combined), and respond in a timely fashion to changes that occur in it; pro-activeness: agents do not simply act in response to their environment, they are able to exhibit goal-directed behaviour by taking the initiative. From Intelligent Agents: Theory and Practice of M. Wooldridge and N. Jennings (http://www.csc.liv.ac.uk/~mjw/pubs/ker95/ker95-html.html)

11 BDI Agents ALL agents (except for purely reactive agents) maintain an internal representation of their world. –There is an explicit mental state –Can be modified by some form of symbolic reasoning. An example: BDI agents (BDI = Belief, Desire, Intention) –a set of beliefs about the world; –a set of goals that the agent is currently trying to achieve (Desires) –a library of plans describing how to achieve goals and how to react to changes in beliefs –an intention structure; describing how the agent is currently achieving its goals and reacting to changes in beliefs.

12 What is FIPA FIPA (Foundation for Intelligent Physical Agents) is a non-profit organization aimed at producing standards for the interoperation of heterogeneous software agents www.fipa.org

13 Agent: FIPA definition An agent is a computational process that implements the autonomous, communicating functionality of an application. Typically, agents communicate using an Agent Communication Language.

14 FIPA Agents Agents communicate by exchanging messages which represent speech acts, and which are encoded in an agent-communication-language. Services provide support services for agents. In addition to a number of standard services including agent-directory-services and message-transport- services the FIPA Abstract Architecture defines a general service model that includes a service- directory-service.

15 FIPA Agent: Relationships to Other Elements Agent has an agent-name Agent may have agent-attributes Agent has an agent-locator, which lists the transport-descriptions for that agent Agent may be sent messages via a transport-description, using the transport corresponding to the transport-description Agent may send a transport-message to one or more agents Agent may register with one or more agent-directory-services Agent may have an agent-directory-entry, which is registered with an agent-directory- service Agent may modify its agent-directory-entry as registered by an agent-directory-service Agent may deregister its agent-directory-entry from an agent-directory-service. Agent may search for an agent-directory-entry registered within an agent-directory-service Agent is addressable by the mechanisms described in its transport-descriptions in its agent-directory-entry

16 Concrete implementation of the FIPA Agent an agent may be realized in a variety of ways, for example as a Java component, a COM object, a self-contained Lisp program, or a TCL script. It may execute as a native process on some physical computer under an operating system, or be supported by an interpreter such as a Java Virtual Machine or a TCL system. The relationship between the agent and its computational context is specified by the agent lifecycle.

17 Agents (FIPA) State-machine agent

18 Agents: a software engineering point of view An agent is a subsystem –High decoupling with other subsystems (agents) –High coherence of internal classes (behaviors of the same agent) –It offers services to other agents FIPA agents are communication oriented –High Standardization in communications provide interoperability: Ontology Agent Interaction Protocols (and communicative acts) Content language

19 PASSI Agent The instance of an agent class It is the software implementation of an autonomous entity capable of pursuing an objective through its autonomous decisions, actions and social relationships. An agent may occupy several functional roles to achieve its goals The function temporarily assumed by the agent in the society while pursuing a sub- goal In playing a role the agent uses one or more of its tasks. A series of elementary pieces of behavior (actions) necessary for a specific purpose. Each task carries out one of the agent’s decisions/ actions/ social relationships Elementary behavior Each task is composed of several elementary behaviors

20 Platform

21 Platforms What is a platform –A place where agents live not always needed Platform responsibilities –Agent management creation – termination security –Agent communication services –Agent directory services

22 Communications (conversations)

23 Agents’ interactions (FIPA point of view) Agents communicate by exchanging messages which represent speech acts 2, and which are encoded in an agent- communication-language. The simplest for of speech act (we can refer to it as a message) is: – –Where: i is the originator of the speech act (we can refer to it as a message), act is the name of the act (it communicates the speaker’s intention to the hearer) j is the target C the semantic content Examples of communicative acts 1 (also called performatives) –Query, Inform, Request, Agree, Refuse 1 FIPA Communicative Act Library Specification. Foundation for Intelligent Physical Agents, Document FIPA00037 (2000). http://www.fipa.org/specs/fipa00037/.http://www.fipa.org/specs/fipa00037/ 2 Searle, J.R., Speech Acts. Cambridge University Press, 1969.

24 Messages and performatives Is the door open? Open the door (for me) OK! I’ll open the door The door is open I am unable to open the door I will not open the door Say when the door becomes open Anyone wants to open the door? I can open the door for you..at a price Door? What’s that? Don’t understand... query request agree inform failure refuse Subscribe cfp Propose Not- understood

25 A layered model One conversation can be composed of several messages, each one addressing one different performative (or communicative act)

26 Conversations Conversations are composed by one or more messages They are ruled by agent interaction protocols (AIP, discussed later) Given a message (and its specific performative), the AIP defines which is the set of performatives that could be associated to the following messages If a message does not comply to this rule, the agent could not understand it

27 Message elements

28 Components of a message Parameter Category of Parameters performativeType of communicative acts senderParticipant in communication receiverParticipant in communication reply-toParticipant in communication contentContent of message languageDescription of Content encodingDescription of Content ontologyDescription of Content protocolControl of conversation conversation-idControl of conversation reply-withControl of conversation in-reply-toControl of conversation reply-byControl of conversation

29 A layered model

30 Content and Content language The content denotes the content of the message; equivalently denotes the object of the action. The content language denotes the language in which the content is expressed. FIPA content languages: –SL, CCL, KIF, RDF

31 A layered model

32 Agent communication Language The structure of a message is a key-value- tuple and is written in an agent-communication- language, such as FIPA ACL. The content of the message is expressed in a content-language, such as KIF, SL or RDF. The content-language may reference an ontology, which grounds the concepts being discussed in the content.

33 ACL message example

34 A layered model

35 Transport Message When a message is sent it is transformed into a payload, and included in a transport-message. The payload is encoded using the encoding-representation appropriate for the transport.

36 A layered model

37 Message Transport Protocol Each agent has an agent-name. This agent-name is unique and unchangeable. Each agent has one or more transport-descriptions, which are used by other agents to send a transport- message. Each transport-description correlates to a particular form of message transport, such as IIOP, SMTP, or HTTP. A transport-message is a message expressed in a format (or encoding) that is appropriate to the transport being used. A set of transport-descriptions can be held in a locator.

38 Example of transport description Directory entry for agent “ABC” Agent-name: ABC Locator : Transport- type Transport-specific-addressTransport-specific- property HTTPhttp://www.whiz.net/abc(none) SMTPAbc@lowcal.whiz.net(none)

39 A layered model Out of our scope

40 Ontology

41 Concepts (categories, entities of the domain) Predicates (assertions on properties of concepts) Actions (that agents can perform in the domain). Ontology Book_in_stock Searched_book

42

43 Agents Interaction Protocols (AIP)

44

45

46

47 Message Content Languages

48 A proposition in RDF Proposition: "The statement 'W. Richard Stevens is the author of TCP/IP Illustrated' is true". <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:fipa=http://www.fipa.org/schemas/fipa-rdf0#"> TCP/IP Illustrated W. Richard Stevens true TCP/IP Illustrated W. Richard Stevens author

49 A communication (ACL+RDF+Request AIP) Scenario: Mary requests John to open door 1 and door 2 and then wants John to inform her if he performed the action and what the result is. Message 1: Request from Mary to John containing the description of the action, Message 2: Inform from John to Mary, referring to the action and stating the completion of the action. (request :sender Mary :receiver John :content ( <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“ xmlns:fipa="http://www.fipa.org/schemas#"> John open door1 door2 ) :language fipa-rdf0)

50 A communication (ACL+RDF+Request AIP) (inform :sender John :receiver Mary :content ( <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax- ns#" xmlns:fipa="http://www.fipa.org/schemas#"> true doors closed ) :language fipa-rdf0)

51 The FIPA Platform

52 Agent Management System (AMS) –The AMS provides white-page and life-cycle service, maintaining a directory of agent identifiers (AID) and agent state. –Each agent must register with an AMS in order to get a valid AID. Directory Facilitator (DF) –the agent who provides the default yellow page service in the platform. Message Transport System (MTS) –the software component controlling all the exchange of messages within the platform, including messages to/from remote platforms. –also called Agent Communication Channel (ACC) The FIPA platform

53 Agents interactions  Agent Communication Channel : All agents have access to at least one ACC. The ACC is the default communication method that connects all agents within an AP and between AP’s. Internal Platform Message Transport Agent Directory Facilitator Agent Management System Software Agent Platform ACC

54 Other topics Agents Services Directory services –Starting/ finding an agent See FIPA-presentation.docFIPA-presentation.doc

55

56 The FIPA platform implementation The operating shell

57 Jade Behaviors

58 An Example Sender agent Receiver agent

59 (Performative, ontology, content language, content) This is not common in PASSI PASSI syntax: (AIP, Performative, Ontology)

60 Agent Sender public class AgentSender extends Agent { class SendBehaviour extends SimpleBehaviour { private boolean finished = false; public SendBehaviour (Agent a) { super(a);} public void action() { try{ System.out.println("\nEnter responder agent name (e.g. da0@myhost:1099/JADE): "); BufferedReader buff = new BufferedReader (new InputStreamReader(System.in)); String responder = buff.readLine(); AID r = new AID(); r.setName(responder); ACLMessage msg = new ACLMessage(ACLMessage.INFORM); msg.setSender(getAID()); msg.addReceiver(r); msg.setContent("FirstInform"); send(msg); System.out.println("\nFirst INFORM sent"); doWait(5000); msg.setLanguage("PlainText"); msg.setContent("SecondInform"); send(msg); System.out.println("\nSecond INFORM sent"); doWait(5000); // same that second msg.setContent("\nThirdInform"); send(msg); System.out.println("\nThird INFORM sent"); doWait(1000); msg.setOntology("ReceiveTest"); msg.setContent("FourthInform"); send(msg); System.out.println("\nFourth INFORM sent"); finished = true; myAgent.doDelete(); }catch (IOException ioe){ioe.printStackTrace();} } public boolean done(){ return finished;} } protected void setup() { SendBehaviour mysendbehaviour = new SendBehaviour(this); addBehaviour(mysendbehaviour); }

61 Agent Receiver1/2 public class AgentReceiver extends Agent { class my3StepBehaviour extends SimpleBehaviour { final int FIRST = 1; final int SECOND = 2; final int THIRD = 3; private int state = FIRST; private boolean finished = false; public my3StepBehaviour (Agent a) { super(a); } public void action() { switch (state){ case FIRST: {if (op1()) state = SECOND; else state= FIRST; break;} case SECOND:{op2(); state = THIRD; break;} case THIRD:{op3(); state = FIRST; finished = true; break;} } public boolean done() { return finished; } public int onEnd() { reset(); myAgent.addBehaviour(this); return 0; } public void reset() { super.reset(); finished = false; state = FIRST; } private boolean op1(){ MessageTemplate m1 = MessageTemplate.MatchPerformative(ACLMessage.INFORM); MessageTemplate m2 = MessageTemplate.MatchLanguage("PlainText"); MessageTemplate m3 = MessageTemplate.MatchOntology("ReceiveTest"); MessageTemplate m1andm2 = MessageTemplate.and(m1,m2); MessageTemplate notm3 = MessageTemplate.not(m3); MessageTemplate m1andm2_and_notm3 = MessageTemplate.and(m1andm2, notm3); System.out.println( "\nAgent "+getLocalName()+" in state FIRST.op1 is waiting for a message matching the template "); //The agent waits for a specific message. If it doesn't arrive the behaviour is suspended until a new message arrives. ACLMessage msg = receive(m1andm2_and_notm3); if (msg!= null){ System.out.println("\nAgent "+ getLocalName() + " received the following message in state FIRST.op1: "); System.out.println(msg.toString()); return true; } else { System.out.println("\nNo message matching the template received in state FIRST.op1. Blocking the behaviour"); block(); return false; } } // End of op1

62 Agent Receiver2/2 private void op2(){ System.out.println("\nAgent "+ getLocalName() + " in state SECOND.op2 is waiting for any message in next 5000 msec"); //Using a blocking receive causes the block of all the //behaviours ACLMessage msg = blockingReceive(5000); if(msg != null) { System.out.println("\nAgent "+ getLocalName() + " received the following message in state SECOND.op2: "); System.out.println(msg.toString()); } else{ System.out.println("\nNo message received in state SECOND.op2"); } } // End of op2 private void op3(){ MessageTemplate m1 = MessageTemplate.MatchPerformative(ACLMessage.INFORM); MessageTemplate m2 = MessageTemplate.MatchLanguage("PlainText"); MessageTemplate m3 = MessageTemplate.MatchOntology("ReceiveTest"); MessageTemplate m1andm2 = MessageTemplate.and(m1,m2); MessageTemplate m1andm2_and_m3 = MessageTemplate.and(m1andm2, m3); System.out.println("\nAgent: "+getLocalName()+" in state THIRD.op3 is blocked waiting for a message matching the template"); //blockingReceive and template ACLMessage msg = blockingReceive(m1andm2_and_m3); if (msg!= null) System.out.println("\nAgent "+ getLocalName() + " received the following message in state THIRD.op3: "+msg.toString()); else System.out.println("\nNo message received in state THIRD.op3"); } // End of op3 } // End of my3StepBehaviour class (the agent behaviour) protected void setup() { my3StepBehaviour mybehaviour = new my3StepBehaviour(this); addBehaviour(mybehaviour); } } // End of agent

63 MAS References Agentlink Roadmap: www.agentlink.orgwww.agentlink.org Intelligent Agents: Theory and Practice. M. Wooldridge, N. Jennings (http://www.csc.liv.ac.uk/~mjw/pubs/ker95/ ker95-html.html) Objects and Agents Compared. J. Odell. (http://www.jot.fm/issues/issue_2002_05/column4) Searle, J.R., Speech Acts. Cambridge University Press, 1969.

64 Ontology References What are ontologies and why do we need them. B. Chandrasekaran et al. (http://portal.acm.org/citation.cfm?id=630436&dl=ACM&coll=portal) Ontologies from AI Topics library of AAAI. http://www.aaai.org/AITopics/html/ontol.html Ontology Development 101: A Guide to Creating Your First Ontology. Natalya F. Noy and Deborah L. McGuinness. (http://www.ksl.stanford.edu/people/dlm/papers/ontology101/ontology 101-noy-mcguinness.html) Designing Ontology with RDF in PASSI. M. Cossentino Modeling XML Vocabularies with UML. D. Carlson. (http://www.xml.com/pub/a/2001/08/22/uml.html) RDF (Resource Description Framework). W3C Consortium. (http://www.w3.org/RDF/)

65 FIPA References FIPA website: www.fipa.orgwww.fipa.org FIPA Abstract Architecture (http://www.fipa.org/repository/architecturespecs.html) Agent Interaction Protocols (http://www.fipa.org/repository/ips.php3) Communication Content Languages (http://www.fipa.org/repository/cls.php3) (Design) Methodology Technical Committee: (http://www.fipa.org/activities/methodology.html) Communicative Act Library Specification: (http://www.fipa.org/specs/fipa00037/)

66 JADE References JADE (Java Agent DEvelopment Framework) (http://sharon.cselt.it/projects/jade/)http://sharon.cselt.it/projects/jade/ Jade Tutorial: http://www.iro.umontreal.ca/~vaucher/Agents/Jade/ JadePrimer.html AgentFactory: http:// mozart.csai.unipa.it/af


Download ppt "FIPA Agents and Platform M. Cossentino. Paradigm shift in programming time assembler procedural object agent Abstraction level."

Similar presentations


Ads by Google