1 introduction of java agent development environment (jade) presented by po-cheng huang
Post on 28-Dec-2015
221 Views
Preview:
TRANSCRIPT
2
Outline
Introduction Foundation for Intelligent Physical Agents (FIPA) Java Agent Development Environment (JADE)
Running JADE Platform Install JDK 1.5 Install JADE Platform Run JADE Platform Run Agent on JADE Platform
3
Foundation for Intelligent Physical Agents (FIPA)
IEEE Computer Society standards organization A body for developing and setting computer
software standards for heterogeneous and interacting agents and agent-based systems.
Agent management Agent communication language (ACL) Integration agent and other computer software http://www.fipa.org/
A software agent A piece of software that acts for a user or other
program in a relationship of agency
5
JADE platform
JADE is a middleware that facilitates the development of Multi Agent Peer-to-Peer applications.
Full Java Runs on all JVM from J2EE to J2ME MIDP1.0 Downloadable from http://jade.tilab.com
9
Directory Facilitator
Provides a Yellow Pages service by means of which an agent can find other agents providing the services he requires in order to achieve his goals.
11
Agent Management System
Provides the naming serviceEnsures that each agent in the platform has
a unique nameRepresents the authority in the platform
To create/kill agents on remote containers by requesting that to the AMS
12
Message Transport System
Agent Communication Channel (ACC) Agent to Agent Agent Platform to Agent Platform
14
Install JDK 1.5
http://java.sun.com/ Download J2SE Development Kit (JDK) 1.5
The Java Runtime Environment (JRE) Command-line development tools, such as
compilers and debuggers, that are necessary or useful for developing applets and applications
19
JADE Package
• JADE-doc•Document
•JADE-src•Source Code
•JADE-bin•Binary Code
•JADE-example•Example Code
21
Install JADE Platform
Write batch file run_jade.bat
Include related library Base64.jar http.jar iiop.jar jade.jar jadeTools.jar
22
Batch file to start JADE platform
Set Library Pathset JADE=C:\jade\lib\base64.jar;C:\jade\lib\
http.jar;C:\jade\lib\iiop.jar;C:\jade\lib\jade.jar;C:\jade\lib\jadeTools.jar;./;
Execute Command java -classpath %JADE% jade.Boot -gui
Use Java to start jade platform Interface
25
Batch File to Connect the Remote JADE Platform
Set Library Pathset JADE=C:\jade\lib\base64.jar;C:\jade\lib\
http.jar;C:\jade\lib\iiop.jar;C:\jade\lib\jade.jar;C:\jade\lib\jadeTools.jar;./;
Set Connection Command java -classpath %JADE% jade.Boot -gui -
container -host 140.116.xxx.xxx
Add new containe Destination IP
Implement Agent with Eclipse (3)
30
-gui –container –host localhost Seller2 : BookSerllerAgent
Agent Name
Class Name
Agent Communication Language
sender of the message list of receivers communicative intention (or “performative”) content content language ontology some fields
34
39
BookSellerAgent
BookSellerAgent extends Agent import jade.core.Agent; Initial process
Setup() addBehaviour(new InitBeha())
Agent Behaviour import jade.core.behaviours.*;
InitBeha extends Behaviour class
class Behaviour
This abstract class provides an abstract base class for modelling agent tasks, and it sets the basis for behaviour scheduling as it allows for state transitions (i.e. starting, blocking and restarting a Java behaviour object).
42
class Behaviour (Cont.)
class SimpleBehaviour This abstract class models simple atomic behaviours. Its
reset() method does nothing by default, but it can be overridden by user defined subclasses.
class OneShotBehaviour This abstract class models atomic behaviours that must be executed only
once and cannot be blocked. So, its done() method always returns true.
class CyclicBehaviour This abstract class models atomic behaviours that must be executed
forever. So its done() method always returns false.
44
class Behaviour (Cont.)
class WakerBehaviourThis abstract class implements a one-shot
task that must be executed only once just after a given timeout is elapsed.
class TickerBehaviourThis abstract class implements a cyclic task
that must be executed periodically.
47
class Behaviour (Cont.)
class CompositeBehaviour This abstract class models behaviours that are made up by
composing a number of other behaviours (children). So the actual operations performed by executing this behaviour are not defined in the behaviour itself, but inside its children while the composite behaviour takes only care of children scheduling according to a given policy.
class SequentialBehaviour This class is a CompositeBehaviour that executes its sub-behaviours
sequentially and terminates when all sub-behaviours are done. Use this class when a complex task can be expressed as a sequence of atomic steps (e.g. do some computation, then receive a message, then do some other computation).
48
class Behaviour (Cont.)
class ParallelBehaviour This class is a CompositeBehaviour that executes its sub-behaviours
concurrently and terminates when a particular condition on its sub-behaviours is met. Proper constants to be indicated in the constructor of this class are provided to create a ParallelBehaviour that ends when all its sub-behaviours are done, when any one among its sub-behaviour terminates or when a user defined number N of its sub-behaviours have finished. Use this class when a complex task can be expressed as a collection of parallel alternative operations, with some kind of termination condition on the spawned subtasks.
49
class Behaviour (Cont.)
class FSMBehaviour This class is a CompositeBehaviour that executes its children according
to a Finite State Machine defined by the user. More in details each child represents the activity to be performed within a state of the FSM and the user can define the transitions between the states of the FSM. When the child corresponding to state Si completes, its termination value (as returned by the onEnd() method) is used to select the transition to fire and a new state Sj is reached. At next round the child corresponding to Sj will be executed. Some of the children of an FSMBehaviour can be registered as final states. The FSMBehaviour terminates after the completion of one of these children.
50
top related