JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus [email protected] Spring...

29
JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus [email protected] Spring 2002

Transcript of JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus [email protected] Spring...

Page 1: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

JADE - A FIPA-Compliant Java Agent Development Framework

Andrei Dancus

[email protected]

Spring 2002

Page 2: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Specifications

• The JADE Platform

• Jade In Action - Demo

OutlineOutline

Page 3: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Abstract Architecture specifications deal with the abstract entities that are required to build agent services and an agent environment

• Specifications

• Abstract Architecture - focus on interoperability

• Domains and Policies - enforce constraints on the behavior of agents within agent environments

- encoding- non-local access- QoS (encryption, non-repudiation)- number of agents- system resources

(source: [1])

Page 4: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

Directory entry for ABCAgent-name: ABCLocator:Transport-type Transport-specific-address Transport-specific-propertyHTTP http://www.whiz.net/abc (none)SMTP [email protected] (none)Agent-attributes: Attrib-1: yes

Attrib-2: yellow Language: French, German, English Preferred negotiation: contract-net

(source: [1])

Page 5: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Agent Communication specifications deal with Agent Communication • Specifications

• ACL Message Structure - specifies the elements of the FIPA-ACL messagethe elements are:

- performative- sender, receiver, reply-to

- content- language, encoding, ontology- protocol, conversation-id, reply-with, in-reply-to, reply-by

(source: [1])

Page 6: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Interaction Protocols (IPs) specifications deal with pre-agreed message exchange protocols for ACL messages. A FIPA ACL-compliant agent need not implement any of the standard IPs, nor is it restricted from using other IP names. However, if one of the standard IP names is used, the agent must behave consistently with the IP specification given here.

• Specifications• Interaction Protocol Library• Request Interaction Protocol• Query Interaction Protocol• Contract Net Interaction Protocol• Iterated Contract Net Interaction Protocol• English Auction Interaction Protocol• Dutch Auction Interaction Protocol• Brokering Interaction Protocol• Recruiting Interaction Protocol• Propose Interaction Protocol

Interaction Protocols (1/3)

Interaction Protocols (1/3)

(source: [1])

Page 7: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

Interaction Protocols(2/3)

Interaction Protocols(2/3)

(source: [1])

Page 8: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

(source: [1])

Andrei Dancus

Interaction Protocols(3/3)

Interaction Protocols(3/3)

(source: [1])

Page 9: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Communicative Act (CA) specifications deal with different utterances for ACL

messages. • Specifications

• Communicative Act LibraryFIPA Communicative Acts:

Accept Proposal Agree Cancel Call for Proposal

Confirm Disconfirm Failure InformInform If Inform Ref Not Understood PropagatePropose Proxy Query If Query RefRefuse Reject Proposal Request Request

WhenRequest Whenever Subscribe

(source: [1])

Page 10: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Content Language (CL) specifications deal with different representations of the content of ACL messages.

• Specifications• Content Language Specification• FIPA-SL (Semantic Language) Content Language

- “a general purpose representation formalism that may be suitable for use in a number of different agent domains”

• FIPA-CCL (Constraint Choice Language) Content Language - intended to enable agent communication for applications that involve exchanges about multiple interrelated choices.

- based on the representation of choice problems as Constraint Satisfaction Problems (CSPs) • FIPA-KIF (Knowledge Interchange Format) Content Language

- goal - to specify KIF as a language for use in the interchange of knowledge among disparate computer systems (created by different programmers, at different times, in different languages...)

• FIPA-RDF (Resource Description Framework) Content Language - RDF framework is based on an entity-relationship model; proposes XML as encoding syntax - FIPA-RDF deals with how objects, propositions and functions can be expressed in RDF

(source: [1])

Page 11: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

Content = "(" ContentExpression+ ")".ContentExpression = IdentifyingExpression

| ActionExpression | Proposition.

Proposition = Wff.Wff = AtomicFormula

| "(" UnaryLogicalOp Wff ")"| "(" BinaryLogicalOp Wff Wff ")"| "(" Quantifier Variable Wff ")"| "(" ModalOp Agent Wff ")"| "(" ActionOp ActionExpression ")"| "(" ActionOp ActionExpression Wff ")".

Quantifier = "forall” | "exists”ModalOp = "B” | "U” | "PG” | "I".ActionOp = "feasible” | "done".…IdentifyingExpression = "(" ReferentialOperator Term Wff ")".ReferentialOperator = "iota” | "any” | "all".… ActionExpression = "(" "action" Agent Term ")"

……

Reduced Expressivity Subsets of FIPA SL

• SL0 - the minimal subset of FIPA-SL - actions and simple binary propositions

• SL1 - SL0+simple propositional logic

• SL2 - allows FOPL and modal logic - restriction - must be decidable - well-known effective algorithms exist that can derive whether or not an FIPA SL2 Wff is a logical consequence of a set of Wffs

not in SL0

not in SL1

not in SL0, SL1, SL2

not in SL2

FIPA SLFIPA SL

Page 12: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Agent Management specifications deal with the control and management of agents within and across agent platforms.

• Specifications• Agent Management• Agent Support for Mobility

(source: [1])

Page 13: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• Directory Facilitator (DF)• provides a yellow pages directory service to agents• an AP can have more than one DF• Operations that DF must support: register, deregister, modify, search

• Agent Management System (AMS) - management of the AP• only one AMS per AP • maintains and controls agent life-cycle • authorization for agents to access MTS• operations that AMS must support: register, deregister, modify, search,

get-description• can instruct the AP to: suspend, terminate, create, execute agent,

resume agent execution, resource management

Agent ManagementAgent Management

(source: [1])

Page 14: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

Agent Life CycleAgent Life Cycle

(source: [1])

Page 15: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA does not mandate a single form of agent mobility but supports a core set of actions that allow flexible and extensible forms of mobility protocols to be supported. Two example protocol abstractions:

Simple Mobility Protocol• mobility supported by the AP

• simple agent development

Full Mobility Protocol• agent has enhanced control of the mobility operations

• more secure (?)

(source: [1])

Page 16: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

Agent profiles• different agents have different demands/dependencies

• meta-information of an mobile agent (:profile parameter):• :system

Expresses requirements of the mobile agent system which the mobile agent uses (if any), such as Aglets, Mole, AgentTcl or Voyager

• :language

Expresses requirements of the language in which the mobile agent is written,

such as Java source code, i386 native code or April byte-code • :os

- requirements of the operating system for which the mobile agent was

intended (if any), such as a Solaris SPARC box or a Linux i386 box • Extra dependency information can be stated in the :dependencies parameter of each

profile description

Agent Support for Mobility (cont.)

Agent Support for Mobility (cont.)

Page 17: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Agent Message Transport specifications deal with the transport and representation of messages across different network transport protocols, including wireline and wireless environments

• Specifications• Agent Message Transport Service• Messaging Interoperability Service

(source: [1])

Page 18: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA ACL Message Representation specifications deal

with different representation forms for ACL messages. • Specifications: ACL Message Representation in

• Bit-Efficient • String• XML

• FIPA Envelope Representation specifications deal with different representation forms for ACL message

envelopes. • Specifications Agent Message Transport Envelope Representation in

• Bit-Efficient • XML

• FIPA Agent Message Transport Protocol (MTP) specifications deal with different network transport protocols for delivering ACL messages.

• Specifications Agent Message Transport Protocol for

• IIOP• HTTP• WAP

(source: [1])

Page 19: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

• FIPA Application specifications are example application areas in which FIPA agents can be deployed. They represent ontology and service descriptions specifications for a particular domain.

• Specifications• Nomadic Application Support• Agent Software Integration• Personal Travel Assistance• Audio-Visual Entertainment and Broadcasting• Network Management and Provisioning• Message Buffering Service

(source: [1])

Page 20: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

JADEJADE

• A Java-based agent development framework

• A combination of two products:

• A FIPA-Compliant Agent Platform

• A package to develop Java agents

• Includes the following agents

• AMS (Agent Management System)

• DF (Directory Facilitator)

• Sniffer

• RMA

• Includes features like:

• library of FIPA interaction protocols

• automatic registration of agents with AMS

• FIPA-compliant naming service

• FIPA-compliant IIOP to connect to different AP-s

• GUI to manage several agents and AP-s

(FIPA-compliant AP)

Page 21: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

JADE ArchitectureJADE Architecture

• Each agent lives inside a container

• A container

• is a JVM

• provides a complete runtime environment for agent execution

• allows several agents to run concurrently

• controls the life-cycle of agents (create, suspend, resume, kill)

• deals with communication (dispatches and routes messages)

• Light-weight container provided for agent execution within a web browser

• Special Container - the front-end (FE) container

• it runs the management agents

• it represents the whole platform to the outside world

• The GUI itself is implemented as an agent - Remote Management Agent (RMA)

Page 22: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

(source: [2])

Page 23: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

Communication SubsystemCommunication Subsystem

• The FE container includes an RMI registry used by other agent containers to join the AP

• The FE container maintains • an Agent Container Table

• an Agent Global Descriptor Table (updated every time a containercreates/destroys an agent)

• Each container maintains a cache of other containers’ object references• references are added to cache as messages are sent• Global Descriptor Table lookup for every message is avoided

• Agent containers transparently choose the most efficient available messaging mechanism, according to receiver agent location:

• same container: no remote invocations (clone() is called on ACL message object)

• same AP, different container, cache hit: a single RMI call; ACL message object is serialized/de-serialized by RMI runtime

• same AP, different container, cache miss: two RMI calls1. Update cache from Global Agent Descriptor Table2. Send the message

• different AP (JADE): one IIOP call to remote AP plus the cost of one of the previous cases

• different AP (non-JADE): same as previous

Page 24: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

(source: [2])

Page 25: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

Agent Execution ModelAgent Execution Model

• Behavior - abstraction used to model the tasks that an agent is able to perform (for instance, multiple simultaneous conversations)

• Agents instantiate behaviors according to their needs and capabilities

• JADE uses the thread-per-agent concurrency model instead of a thread-per-behavior model in order to keep the number of threads small

• Agents extend from the base Agent class which implements a scheduler

• The scheduler carries out a round-robin non-preemptive policy among all behaviors available in the ready queue

• The execution of a Behaviour derived classes ends when the task itself relinquishes control

• Behaviors can be added/removed using Agent’s methods (addBehaviour(Behaviour), removeBehavior(Behavior))

• Developers can use existing behaviors provided by JADE or define their own classes, which need to extend Behavior and implement the abstract methods action() and done()

Page 26: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

(source: [2])

Page 27: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

newer model

(source: [3])

newer model

(source: [3])

Page 28: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

JADE DemoJADE Demo

Page 29: JADE - A FIPA-Compliant Java Agent Development Framework Andrei Dancus andrei@cs.wpi.edu Spring 2002.

Andrei Dancus

ReferencesReferences

[1] FIPA Specifications - available at http://www.fipa.org/specifications

all documents below are available at http://sharon.cselt.it/projects/jade/

[2] F.Bellllifemine at al., JADE - A FIPA-compliant agent framework in

Proceedings of PAAM99, London, April 1999, pg.97-108

[3] Jade Programmer's Guide for JADE2.5, Feb.4th, 2002

[4] Jade Administrator's Guide for JADE2.5, Jan.22nd, 2002

[5] M.Laukkanen (Sonera Ltd.), Evaluation of JADE 1.2