JADE Tutorial for beginners
Part 2 - USING JADE
Fabio Bellifemine, TILAB
Table of content
What is JADE
Main features of JADE
How to install and use JADE
Graphical tools to monitor and debug agent systems
Configuring JADE
CONFIDENTIAL All rights reserved
The Hague, 12/10/04
JADE is an agent platform that implements the basic services and infrastructure of a
distributed multi-agent application:
agent life-cycle and agent mobility
white & yellow-page services
peer-to-peer message transport & parsing
agent security
scheduling of multiple agent tasks
set of graphical tools to support monitoring, logging, and debugging
JADE allows faster time-to-market for new services by making key functionality
available across multiple applications
terminal2terminal and multi-party communication (N:M)
where needed, communication based on MSISDN-identity & mobile terminals
providing (as well as accessing) services
pro-active applications
Some relevant features:
is extremely light-weight, ported to J2ME-CLDC-MIDP 1.0
enables interoperability through FIPA compliance
is an Open Source project originated by TILAB and currently governed by an
International Board
is used by several R&D projects
The Hague, 12/10/04
CONFIDENTIAL All rights reserved
JADE
public class AgentThatSearchesAndUseAService
extends jade.core.Agent {
public void setup() {
DFAgentDescription dfd = new DFAgentDescription();
dfd.setType(SearchedService");
DFAgentDescription[] agents =
DFService.search(this,dfd);
ACLMessage msg = new
ACLMessage(ACLMessage.REQUEST);
msg.addReceiver(agents[0].getAID();
msg.setContent(execute service");
send(msg);
System.out.println(blockingReceive());
}
}
public class PeerThatSearchesAndUsesAService {
private void startJxta() {
netPeerGroup =
PeerGroupFactory.newNetPeerGroup();
discoSvc =
netPeerGroup.getDiscoveryService();
pipeSvc = netPeerGroup.getPipeService();
}
private void startClient() {
Enumeration enum1 =
discoSvc.getLocalAdvertisements(
DiscoveryService.ADV, SearchedService",
SERVICE);
Enumeration enum2 =
discoSvc.getRemoteAdvertisements(
null, DiscoveryService.ADV,
SearchedService", SERVICE, 1, null);
Enumeration enum = <enum1 + enum2>;
ModuleSpecAdvertisement mdsadv =
(ModuleSpecAdvertisement)enum.nextElement();
StructuredTextDocument doc =
(StructuredTextDocument)
mdsadv.getDocument(new
MimeMediaType("text/plain"));
PipeAdvertisement pipeadv =
mdsadv.getPipeAdvertisement();
Pipe sendPipe = pipeSvc.createOutputPipe(
pipeadv, 10000);
msg = pipeSvc.createMessage();
msg.setString(TAG, Request Service);
sendPipe.send(msg);
Pipe myPipe =
pipeScv.createInputPipe(pipeadv);
System.out.println(myPipe.waitForMessage());
}
public void main() {
startJxta();
startClient();
}
The Hague,
}
CONFIDENTIAL All rights reserved
Faster time to market: example of source code JADE and JXTA.
12/10/04
JADE Hides FIPA From Programmers!
No need to implement the Agent Platform
AMS, DF, and ACC executed at start-up
No need to implement agent-management ontology and
functionalities
An agent is registered with the AP within its constructor
The DFService class provides a simplified interface to access
the services of the DF (registration, searching, lease-renewal,
)
No need to implement Message Transport and Parsing
Automatically (and possibly efficiently) done by the framework
when sending/receiving messages
Interaction Protocols must only be extended via handle methods
AND it is standard FIPA
The Hague, 12/10/04
CONFIDENTIAL All rights reserved
It is given a name and an address
The architectural model
9 A JADE-based application is composed of a collection of active components called Agents
9 Each agent has a unique name
9 Each agent is a peer since he can communicate in a bidirectional way with all other agents
9 Each agent lives in a container (that provides its run time) and can migrate within the platform
9 One container plays the role of main (where AMS, DF live)
9 The main-container can be replicated via replication service
Agent B
Agent D
Agent A
Homogeneous layer
Platform
Java
Agent C
Main
Container
Container
Container
J2SE
J2EE
J2ME
Wireless and wireline
Internet
The Hague, 12/10/04
CONFIDENTIAL All rights reserved
Multi-agent
application
Java 2 Platform and JADE
footprint of the JADE-LEAP run-time on mobile phones:
10-30 Kbyte if compiled with the JVM (ROMizing)
40-100 Kbyte otherwise
tested over almost all Java mobile phones
integrated with Operator APN Radius Server to allow SIM-based
addressing and authorization
The Hague, 12/10/04
CONFIDENTIAL All rights reserved
JADE-LEAP
JADE
CONFIDENTIAL All rights reserved
Downloading JADE content of the files
The Hague, 12/10/04
Usage: java jade.Boot [options] [agent specifiers]
most used options:
-help
-container creates a container and joins it to an existing platform
-host <hostname> specifies the host of the platform to be joined
-port <port number> specifies the port number
-gui launches the remote monitoring agent
-nomtp / -mtp lists of MTPs (by default HTTP is launced)
-conf <file name> creates/loads a configuration file
-<key> <value>
agent specifiers:
list of agents to launch, separated by a space
<agentName>:<agentClass>(<agentParams>)
e.g. java jade.Boot gui nomtp port 1200 W1:x.y.W(20) W2:x.y.W(10)
Note: refers to the JADE Administrators Guide for the full list of options
The Hague, 12/10/04
CONFIDENTIAL All rights reserved
JADE command line arguments
The main graphical tools of JADE
supports the management, control, monitoring, and debugging of a
multi-agent platform
RMA (Remote Monitoring Agent)
Dummy Agent
Sniffer Agent
CONFIDENTIAL All rights reserved
Introspector Agent
Log Manager Agent
DF (Directory Facilitator) GUI
The Hague, 12/10/04
Remote Management Agent (RMA)
Start Sniffer
Agent
Start Introspector
Agent
Start Log Manager
Agent
CONFIDENTIAL All rights reserved
Provided functionalities:
monitor and control
the platform and all its
remote containers
remote management
of the life-cycle of
agents (creating,
suspending, resuming,
killing, migrating,
cloning)
compose and send a
custom message to an
agent
launch the other
graphical tools
monitor (just read
operations) other
FIPA-compliant
platforms
Start Dummy
Agent
java jade.Boot -gui
The Hague, 12/10/04
Dummy Agent
CONFIDENTIAL All rights reserved
Provided functionalities:
compose and send a
custom messages
load/save the queue
of messages from/to a
file
The Hague, 12/10/04
Sniffer Agent
CONFIDENTIAL All rights reserved
Functionalities:
- display the flow
of interactions
between selected
agents
- display the
content of each
exchanged
message
- save/load the
flow on/from a
file
The Hague, 12/10/04
Introspector Agent
Functionalities:
monitoring
agent internal
state
CONFIDENTIAL All rights reserved
received/sent/
pending msg
scheduled
behaviours
(active,
blocked) and
subbehaviours
agent state
debugging
execution
step-by-step
slowly
break points
The Hague, 12/10/04
Log Manager Agent
CONFIDENTIAL All rights reserved
Is the GUI to modify at
run-time the logging of
the platform.
It is based upon
java.util.logging and it
allows to:
- browse all Logger
objects on its
container (both
JADE-specific and
application-specific)
- modify the logging
level
- add new logging
handlers (e.g. files)
The Hague, 12/10/04
DFGUI
CONFIDENTIAL All rights reserved
GUI of the yellowpage service,
it allows to:
browse, register,
deregister,
modify, search
agent
descriptions
federate with
other DFs
execute federated
searchs
The Hague, 12/10/04
Integration with JESS (Java Expert System Shell)
It allows reasoning about messages in JESS
It allows a JESS program to control sending/receiving
messages and/or creating/destroying JADE behaviours
JADE and some Internet tools
integration with servlets, applets, JSP
Advanced features
distributed security, fault tolerance, support for replicated
agents and services, persistence
application-specific persistent delivery filters & JADE kernellevel services
JADE and .NET
JADE, Protg, XML, RDF and OWL
Note: the documentation includes a tutorial for almost each of these aspects
The Hague, 12/10/04
CONFIDENTIAL All rights reserved
FYI Some topics not fully covered by this
tutorial