Presentation is loading. Please wait.

Presentation is loading. Please wait.

EEL 5937 The Bond Agent System (2) EEL 5937 Multi Agent Systems Lecture 9, Feb. 4, 2003 Lotzi Bölöni.

Similar presentations


Presentation on theme: "EEL 5937 The Bond Agent System (2) EEL 5937 Multi Agent Systems Lecture 9, Feb. 4, 2003 Lotzi Bölöni."— Presentation transcript:

1 EEL 5937 The Bond Agent System (2) EEL 5937 Multi Agent Systems Lecture 9, Feb. 4, 2003 Lotzi Bölöni

2 EEL 5937 Checking the state of the Bond multiplane state machine

3 EEL 5937 Checking the state (tree)

4 EEL 5937 Handling states in Bond

5 EEL 5937 States of strategies Strategies frequently pass through internal states. For example, a strategy to run an application passes through states for –Starting –Running –Closing –Handling failures –Etc. It is recommended to handle these states explicitly The bond.util.fsm.FSM class is a general purpose finite state machine implementation which is used in many places in Bond. –Provides visualization –Allows introspection

6 EEL 5937 Bond.util.fsm.FSM Represents states and transitions. Building the state machine: –addState(String) –addTransition(String, String, int) Setting the state: –setState(String) –It can throw FSMException Testing state: –getState() –stateIs(statename)  recommended for if statements –Iterators: getStates(), getTransitions() Change tracking: –provides change notification to classes implementing FSMChangeListener Visualization –show() -- shows a window with the current state of the FSM.

7 EEL 5937 Handling intentions in Bond

8 EEL 5937 Intentions An intention is a knowledgebase object of the class Bond.Agent.BDI.Intention or inheriting from it. An intention contains an action and a set of additional meta-data. This meta-data is used by the intention execution strategies. The metadata associated with the intentions are: –category –priority –scheduling information –Source (the entity which generated the intention) –retry count –recurring actions –dependencies

9 EEL 5937 Intention pool. Lifecycle of intentions. Every agent maintains a list of intentions called the intention pool. The intention pool changes dynamically in time as a result of the activity of the strategies. Some strategies (such as planning strategies) are creating intentions, others are removing them (for instance, the intention execution strategies). Generally, intentions can be created in one of the following ways: –Intentions can be entered by a human user, either through the default agent user interface, or through a GUI strategy. –Intentions can be part of the initial knowledgebase of the agent. –Intentions can be created as a result of messages (orders) received from other agents. –Intentions can be created by a planning strategy (which creates intentions based on desires). Intentions can be destroyed in the following ways: –An intention is succesfully executed by the agent (more exactly, by an intention execution strategy) –A planning strategy removes previous intentions as part of the re- planning process.

10 EEL 5937 Executing intentions Executing intentions is such an important part of an agent's structure, that Bond contains extra classes to support this –IntentionExecStrategy –DefaultIntentionExecStrategy – adds selection of intentions While intentions vary, there is a common life-cycle and modus operandi of all strategies which execute intentions. The flow of execution for the DefaultIntentionExecStrategy (a) Select an intention from the current intention pool. The intention is selected randomly from the ones available for execution and whose category matches the categories which are handled by the strategy. (b) Set the state of the intention to InExecution (c) Extract the action object from the intention. (d) Start the execution of the action. (e) If the execution failed, and the retry count is non-zero, decrease the retry count and jump to (d). If the retry count is zero, (f) If the execution succeeded, set the state of the intention to Terminated

11 EEL 5937 The DefaultIntentionExecutor state machine

12 EEL 5937 Single-shot vs. Multi-shot intention execution The transitions performed by a strategy, determines its behavior in the multi-plane state machine of the Bond agents. All intention executions strategies can operate in two modes. In the single-shot mode, –SUCCESS transition at the successful completion of the intention –FAILURE transition in case of failure –IDLE transition if there is no applicable intention in the intention queue In the multi-shot mode –IDLE transition if there is no applicable intention in the intention queue –FAILURE transition if there is a failure. –No transition after successful execution (tries to pick up the next available intention)

13 EEL 5937 Checking the BDI queues in Bond

14 EEL 5937 Basic messaging

15 EEL 5937 Basic messaging in Bond / Jade Bond agents are communicating using FIPA ACL messages. In the simplest understanding ACL messages are a set of name / value pairs. For now, we will just assume the messages as ways to pass information. We will cover the advanced things later –What is REALLY interesting is how agents understand each other –Even if they were developed by different developers

16 EEL 5937 Sending messages ACLMessage requestMsg = new ACLMessage(ACLMessage.REQUEST); requestMsg.setSender(theAgent.getAID()); requestMsg.addReceiver(remoteAgentAddress); requestMsg.setContent(“MyContent”); // … or // requestMsg.setContentObject(mySerializable Obj); theAgent.send(requestMsg); Addresses are in the format: AgentName@hostname:1099/JADE

17 EEL 5937 Receiving messages msg = theAgent.receive() msg = theAgent.receive(messageTemplate) msg = theAgent.blockingReceive() msg = theAgent.blockingReceive(messageTemplate) Blocking messages block the whole agent! Use message templates to filter out messages of interest.

18 EEL 5937 Basic strategies. Strategy database

19 EEL 5937 Running Applications

20 EEL 5937 Running Agents


Download ppt "EEL 5937 The Bond Agent System (2) EEL 5937 Multi Agent Systems Lecture 9, Feb. 4, 2003 Lotzi Bölöni."

Similar presentations


Ads by Google