Unformatted text preview:

The Bond Agent System (2)Checking the state of the Bond multiplane state machineChecking the state (tree)Handling states in BondStates of strategiesBond.util.fsm.FSMHandling intentions in BondIntentionsIntention pool. Lifecycle of intentions.Executing intentionsThe DefaultIntentionExecutor state machineSingle-shot vs. Multi-shot intention executionChecking the BDI queues in BondBasic messagingBasic messaging in Bond / JadeSending messagesReceiving messagesBasic strategies. Strategy databaseRunning ApplicationsRunning AgentsEEL 5937The Bond Agent System(2)EEL 5937 Multi Agent SystemsLecture 9, Feb. 4, 2003Lotzi BölöniEEL 5937Checking the state of the Bond multiplane state machineEEL 5937Checking the state (tree)EEL 5937Handling states in BondEEL 5937States 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 introspectionEEL 5937Bond.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.EEL 5937Handling intentions in BondEEL 5937Intentions• 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–dependenciesEEL 5937Intention 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.EEL 5937Executing 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 TerminatedEEL 5937The DefaultIntentionExecutor state machineEEL 5937Single-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)EEL 5937Checking the BDI queues in BondEEL 5937Basic messagingEEL 5937Basic 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 developersEEL 5937Sending messagesACLMessage requestMsg = new ACLMessage(ACLMessage.REQUEST);requestMsg.setSender(theAgent.getAID());requestMsg.addReceiver(remoteAgentAddress);requestMsg.setContent(“MyContent”);// … or// requestMsg.setContentObject(mySerializableObj);theAgent.send(requestMsg);Addresses are in the format:AgentName@hostname:1099/JADEEEL 5937Receiving messagesmsg = 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.EEL 5937Basic strategies.Strategy databaseEEL 5937Running ApplicationsEEL 5937Running


View Full Document

UCF EEL 5937 - The Bond Agent System

Documents in this Course
Load more
Download The Bond Agent System
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view The Bond Agent System and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view The Bond Agent System 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?