EEL 5937 The Bond Agent System (1) EEL 5937 Multi Agent Systems Lecture 8, Jan 30, 2003 Lotzi Bölöni
EEL 5937 Origins Bond 1 – , TCL based agent system –Purdue University –Structural biology applications Bond 2 – –Purdue University –Java based, general purpose distributed object system and agent framework –Handwritten communication frameworks, persistency models etc. –Introduced the notion of “agent surgery” Bond 3 – 2002-… –General purpose agent system –Testbed for agent research –Integration of best of breed technologies
EEL 5937 Architecture
EEL 5937 Builds on: Protégé-2000 ontology framework Uses the ontology framework as a knowledgebase library. Every agent has a knowledgebase which is relying on a set of ontologies which can be pre-edited in Protégé The Protégé forms are used as data entry widgets in Bond
EEL 5937 Builds on: Jade agent framework Bond takes from the Jade agent framework: –The communication framework –The message formats –The directory service –The agent containers Bond builds on: –The Jade behavior architecture. Things which Bond is not using / replaces –The Jade Java-class based ontology implementations. Generally speaking, everything written in the Jade user manuals will still work in Bond.
EEL 5937 What does Bond add to the underlying components Multiplane state machine organization Blueprint agent description language Mutability, agent surgery Strategies – metadata extended behaviors Collection of strategies (strategy data base)
EEL 5937 Blueprint. Describing the structure of a Bond agent.
EEL 5937 Blueprint Python based language. Describes the structure of the agent. Describes the state machine of the agent. Describes the strategies associated with the states. Describes the ontologies to be used. WARNING: It is a work in progress. New features will be added during the semester.
EEL 5937 Blueprint example createDefaultAgentUI() includeKnowledgeBase("Sample") # create a plane which goes round and round createPlane("RoundAndRound") s = bond.agent.strategy.strategydatabase. WaitAndTransitionStrategy(agent, 5000, SUCCESS) addFirstState(s, "Round1"); s = bond.agent.strategy.strategydatabase. WaitAndTransitionStrategy(agent, 5000, SUCCESS) addState(s, "Round2"); s = bond.agent.strategy.strategydatabase. WaitAndTransitionStrategy(agent, 5000, SUCCESS) addState(s, "Round3"); addTransition('Round1', 'Round2', SUCCESS) addTransition('Round2', 'Round3', SUCCESS) addTransition('Round3', 'Round1', SUCCESS)
EEL 5937 Result. -- the agent presented here.
EEL 5937 Ontologies in Bond.
EEL 5937 Ontology hierarchies in Bond. The Bond core ontology contains descriptions of the basic entities involved in building an agent –Contains classes for agent description, beliefs, desires, intentions, actions –Simple ontologies for time and space Domain specific ontologies contain the classes involved in the description of a specific domain –E.g. computational grid ontology –You will need to develop your own ontologies for your projects. Agent specific ontologies – contain the initial knowledgebase of an agent –Typically, they do not define new classes, but contain instances for the initial values.
EEL 5937 Specifying ontologies in Blueprint The BondCore ontology is loaded by default For the domain specific and agent specific ontologies, you need to specify them. The ontologies must be in the “kb” subdirectory. … includeKnowledgeBase(“GridComputing") includeKnowledgeBase(“Security") includeKnowledgeBase(“AgentSpecificOntology") …
EEL 5937 Strategies in Bond
EEL 5937 Behaviors Behaviors in Jade are the basic active units. Java classes with a couple of functions: void action() –Contains the main operation of the behavior –It is called repeatedly until the behavior terminates Boolean done() –It should return true, if the strategy has terminated Void onStart() –Initialization performed when the strategy is first executed. Int onEnd() –Executed when the strategy is terminated –The return value of this strategy will be used to perform the transition on the finite state machine.
EEL 5937 Strategy = Behavior + Metadata Behaviors are the hard-coded functionality. Basically, hand-written code. Strategies add meta-data to the behaviors: –Describe their functionality –Their resource requirements –Performance –Pre- and post-conditions –Runtime introspection The goals are: –Automatic assembly of agents –Automatic reconfiguration –Reasoning about agents. WARNING: This is work in progress. The meta- data attached to strategies will change in the course of the semester.
EEL 5937 Example strategy Wait and transition. Waits for the specified number of milliseconds, then performs the transition specified.
EEL 5937 package bond.agent.strategy.strategydatabase; import bond.agent.strategy.Strategy; import java.util.logging.Logger; import bond.agent.BondAgent; public class WaitAndTransitionStrategy extends Strategy { private static final Logger LOGGER = Logger.getLogger("bond.agent.strategy.strategydatabase"); private long theDelay; private int transition; private long startTime; public WaitAndTransitionStrategy(BondAgent theAgent, long theDelay, int transition) { super(theAgent); this.theDelay = theDelay; this.transition = transition; }
EEL 5937 public void onStart() { startTime = System.currentTimeMillis(); super.onStart(); } public boolean done() { long currentTime = System.currentTimeMillis(); if (currentTime - startTime >= theDelay) { return true; } return false; } public int onEnd() { startTime = 0L; return transition; }
EEL 5937 public void action() { if (startTime == 0L) { onStart(); } block(500); // block for 1/2 second }