Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
JADE:
Java Agent Development Framework
What is it? How can I use it?
Based on “Online documentation of Jade”
http://jade.tilab.com/
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Overview
Agent Communication Language
Jade Features
–
The agent Platform
–
The Agent Class
–
Agent communication Language Messages (ACL)
–
Agent Behaviours
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
3
Communications
–
Speech Acts
•
Assertive: true or false
•
Compromise: future actions speaker
•
Dictatorial: future actions listener
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
4
Communications
–
FIPA CAL (Communicative Act Library)
•
Information
•
Doing Actions
•
Negotiation
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
5
Communications
–
FIPA CAL (Communicative Act Library)
•
Information
–
Who offers information
»
Inform
»
confirm
»
disconfirm
»
not understood
–
Who require information
»
query
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
6
Communications
–
FIPA CAL (Communicative Act Library)
•
Doing Actions
–
Who request
»
request
»
request when
»
request whenever
»
cancel
–
Who perform
»
agree
»
Refuse
»
failure
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
7
Communications
–
FIPA CAL (Communicative Act Library)
•
Negotiation
–
Who need
»
cfp (call for proposals)
»
accept-proposal
»
reject-proposal
–
Who cooperate
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
8
Communications
–
FIPA CAL (Communicative Act Library)
•
Intermediate
–
Who need
»
propagate
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
9
Communications
–
FIPA ACL (Agent Communication Language)
•
Message Structure
–
Performative
–
Sender
–
Receiver
–
Content
–
Language
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
10
Communications
–
FIPA IPL
(Interaction Protocol Library)
•
AUML
(Protocol Diagram)
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
11
Communications
–
FIPA IPL
(Interaction Protocol Library)
•
AUML
(Protocol Diagram)
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
12
Communications
–
FIPA IPL
(Interaction Protocol Library)
•
AUML
(Protocol Diagram)
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
13
Communications
–
FIPA IPL
(Interaction Protocol Library)
•
AUML
(Protocol Diagram)
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
14
Communications
–
FIPA IPL
(Interaction Protocol Library)
•
AUML
(Protocol Diagram)
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
15
Communications
–
FIPA IPL
(Interaction Protocol Library)
•
AUML
(Protocol Diagram)
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
MAS Architecture
16
Communications
–
FIPA IPL
(Interaction Protocol Library)
•
AUML
(Protocol Diagram)
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Introduction
What is JADE?
•
JADE is a middleware for the development and
run-time execution of peer-to-peer applications which are
based on the agents paradigm.
–
FIPA-compliant agent platform
–
API : Package to develop Java Agents
–
It is important to read about FIPA standards
1,at
least:
–
Agent Management specifications
–
Agent Communication Language
–
ACL Message Structure
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Introduction
JADE Packages
–
jade.core
implements the kernel of the system:
Agent class, jade.core.behaviours
–
jade.lang.acl
sub-package is provided to process
Agent Communication Language according to FIPA
–
jade.content
package contains a set of classes to
support user-defined ontologies and
content-languages.
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Introduction
JADE Packages
–
jade.domain
package contains all classes that
represent the Agent Management entities defined
by the FIPA standard (
AMS and DF
) and others like
Sniffer and Introspector.
–
jade.gui
package contains a set of generic classes
useful to create GUIs to the agent Plaftform.
–
jade.mtp
package contains a Java interface for the
Message Transport Protocol
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Introduction
JADE Packages
–
jade.proto
is the package that contains classes to
model standard interaction protocols their own.
–
jade.wrapper
package provides wrappers of the
JADE higher-level functionalities that allows the
usage of JADE as a library, where external Java
applications launch JADE agents and agent
containers
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Introduction
JADE Tools:
–
Remote Management Agent (RMA)
–
Dummy Agent
–
Sniffer Agent
–
Introspector Agent
–
DF Agent
–
Log Agent
–
SocketProxyAgent
21Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Agent Platform
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Agent Platform distributed
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Agent Class
–
The computational model of an agent is multitask.
–
Each functionality/service provided by an agent
should be implemented as one or more
behaviours.
–
A scheduler, internal to the base Agent class and
hidden to the programmer, automatically
manages the scheduling of behaviours.
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Agent Life cycle
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Starting the agent execution
–
the agent constructor is executed
–
the agent is given an identifier
–
AgentName@<hostname>:<port number of the JADE RMI
registry>/JADE
–
it is registered with the AMS
–
it is put in the ACTIVE state,
–
the setup() method is executed
•
necessary add behaviours
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Stopping agent execution
–
doDelete().
–
takeDown()
•
can be overridden by the programmers
•
after the takeDown()method is completed, the agent
will be de-registered and its thread destroyed.
•
The intended purpose of this method is to perform
application specific cleanup
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Inter agent communications
–
Asynchronous message passing
–
ACLMessage Class
–
Templates Interaccions Protocols at jade.proto
–
send()
–
receive() or blockingReceive()
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
Agents with a graphical user interface (GUI)
–
Raises some problems.
–
When JADE is used:
•
the
thread-per-agent concurrency model
of JADE
agents must work together with the
Swing
concurrency
model
.
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
The agent tasks. Implementing Agent behaviours
–
Behaviour subclasses
–
addBehaviour(Behaviour)
–
removeBehaviour(Behaviour)
–
action()
–
done()
–
block()
30Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Creating multi-agent systems
The agent tasks. Implementing Agent behaviours
Escuela de Ingeniería de Sistemas y Computación - Universidad del Valle Profesora: Paola J. Rodríguez
Installing Jade
Steps:
–
Dowload from “Campus Virtual”
–
unzip into /home/<user>
•
See
Jade
and
META-INF
new directories
–
Open: /home/<user>/.bashrc file
–
Add at the end of the file:
•
export
CLASSPATH=/home/paolajr/jade/lib/jade.jar:/home/paolajr/jade/li
b/jadeTools.jar:/home/paolajr/jade/lib/http.jar:/home/paolajr/jad
e/lib/iiop.jar:/home/paolajr/jade/lib/commons-codec/commons-codec-1.3.jar:/home/paolajr/jade/classes
•
export JAVA_HOME=/usr/lib/jvm/java-6-sun/ -this is