General Questions about Jade
What is Jade?
JADE (Java Agent DEvelopment Framework) is a software framework to develop distributed agent-based applications in compliance with the FIPA specifications for interoperable intelligent multi-agent systems. An application based on JADE is composed of a set of components called agents implementing the pieces of functionality required by the application. JADE primarily provides the Agent and Behaviour (a task to be executed by an agent) abstractions, transparent distribution of agents accross a wide range of devices, peer-to-peer communication between agents and a publish-subscribe discovery mechanisms that allows agents finding each other. Furthermore JADE provides a number of additional features such as agent mobility, ontologies and content language support, fault tolerance and web services integration and a rich suite of graphical tools that facilitate the administration of a JADE based application.
Which is the best materials for a beginner?
For people new to JADE and interested in understanding how to develop JADE-based applications we strongly suggest to start from the JADE Administration Tutorial and the JADE Programming Tutorial. Additionally, take a look at all the documentation available on-line and select the most useful to your needs, there are also several links to material for beginners written by other colleagues. Finally the book Developing Multi-Agent Systems with JADE edited by J. Wiley provides a complete explanation of JADE main features
Why do some classes and methods are missing in the Javadoc included in the JADE distribution and available online?
The Javadoc included in the JADE distribution and available online are the official JADE API. For these API the JADE team is committed to guarantee backward compatibility accross JADE versions. People interested in viewing the complete set of JADE API should regenerate the Javadoc by means of the doc ANT target.
What is JADE-LEAP and what are its relationships with JADE?
JADE-LEAP is a modified version of the JADE platform that can run not only on PCs and servers, but also on resource constrained devices such as mobile phones provided that they are Java enabled (MIDP 1.0 is the minimal requirement). It is important to note that JADE-LEAP provides the same APIs with respect to JADE so that an agent developed to run on JADE can run on JADE-LEAP with NO modifications at all. The differences between JADE and JADE-LEAP are limited to the low level communication mechanims invisible to applications and users. The JADE-LEAP platform can be directly downloaded in binary form from the download area of the JADE web site. People interested in recompiling it should get the normal JADE distribution and merge JADE sources with additional sources included in the LEAP add-on as explained in the LEAP User Guide. LEAP is the name of the European IST project that developed the LEAP add-on. The Consortium of the LEAP Project was formed by Motorola, Siemens AG, Telecom Italia, Broadcom, University of Parma and ADAC.
What is an agent?
JADE is absolutely neutral in respect to a definition of an agent. The interested reader should refer to more appropriate scientific sources. JADE conceptualizes an agent as an independent and autonomous process that has an identity, possibly persistent, and that requires communication (e.g. collaboration or competition) with other agents in order to fulfill its tasks. This communication is implemented through asynchronous message passing and by using an Agent Communication Language with a well-defined and commonly agreed semantics. From the implementation point of view a JADE agent is an instance of the jade.core.Agent class and each agent embeds a Thread of execution.
What is FIPA?
The Foundation for Intelligent Physical Agents (FIPA) is a not-for-profit association registered in Geneva, Switzerland. Its purpose is the promotion of the success of emerging agent-based applications, services and equipment. This goal is pursued by making available in a timely manner, internationally agreed specifications that maximize interoperability across agent-based applications, services and equipment. This is realized through the open international collaboration of member organizations, which are companies and universities active in the agent field. FIPAs specifications are public available. They are not a technology for a specific application, but generic technologies for different application areas, and not just independent technologies but a set of basic technologies that can be integrated by developers to make complex systems with a high degree of interoperability. JADE implements all those basic FIPA specifications that provide the normative framework within which FIPA agents can exist, operate, and communicate.
Does JADE really comply with FIPA?
So far, FIPA has not yet specified any official procedure to test compliance of implementations. However, JADE has successfully participated both at the 1st FIPA interoperability test in Seoul on Jan. 99 and at the 2nd FIPA interoperability test in London on April 2001. Furthermore, the JADE team actively participates in the FIPA process and the team also counts one member in the FIPA Architecture Board.
What is agent communication?
Communication is necessary in order to allow collaboration, negotiation, cooperation, etc between independent entities. For this purpose, it requires a well-defined, agreed and commonly understood semantics. Therefore, there cannot be any interoperability without standards. Agent communication is based on message passing, where agents communicate by formulating and sending individual messages to each other. The FIPA ACL specifies a standard message language by setting out the encoding, semantics and pragmatics of the messages. The standard does not set out a specific mechanism for the internal transportation of messages. Instead, since different agents might run on different platforms and use different networking technologies, FIPA just specifies how transporting and encoding the messages between different remote platforms. The syntax of the ACL is very close to the KQML communication language.
Which software architecture is JADE based on?
The software architecture is based on the coexistence of several Java Virtual Machines (VM) and communication relies on Java RMI (Remote Method Invocation) between different VMs, event signaling within a single VM, and IIOP between different agent platforms. Each VM is a basic container of agents that provides a complete runtime environment for agent execution and allows several agents to concurrently execute on the same host.
How the agent platform can be controlled?
The agent platform provides a Graphical User Interface (GUI) for the remote management, monitoring and controlling of the status of agents, allowing, for example, to stop and restart agents. The GUI allows also to create and start the execution of an agent on a remote host, provided that an agent container is already running. The GUI itself has been implemented as an agent, called RMA (Remote Monitoring Agent). All the communication between agents and this GUI and all the communication between this GUI and the AMS is done through ACL via an ad-hoc extension of the Fipa-agent-management ontology.
Are JADE agents intelligent?
JADE alone does not endow agents with specific capabilities beyond those needed for communication and interaction. However, the behavior abstraction of our agent model allows simple integration of external software into one of the agent tasks. The provided library includes a behavior that allows the usage of JESS as the agent-reasoning engine. An implementation practice that we have found useful is the usage of JESS to control the activation and deactivation of the JADE Behaviors by implementing, as a consequence, a mixed reactive-deliberative agent architecture (where JESS plays the deliberative role and the JADE behaviors play the reactive role).
Which programming languages can be used?
Jade has been completely implemented in Java. Its capabilities can only be fully exploited by using the Java programming language. However, a special agent, called JessAgent, is provided that allows programmers to use just the JESS language without writing any line of Java code. JESS is an expert system shell that supports rule-based code with the same style of CLIPS. A user wishing to use JessAgent must before download JESS.
What are the system requirements to run JADE?
The minimal system requirement is the JDK 1.2 Runtime or later.
What features does JADE offer?
JADE offers the following list of features to the agent programmer:
- FIPA-compliant Agent Platform, which includes the AMS (Agent Management System), the DF (Directory Facilitator), and the ACC (Agent Communication Channel), all automatically activated at the agent platform startup;
- distributed agent platform. The agent platform can be split on several hosts (provided that there is no firewall between them). Only one Java application, and therefore only one Java Virtual Machine, is executed on each host. Agents are implemented as one Java thread and Java events are used for effective and lightweight communication between agents on the same host. Parallel tasks can be still executed by one agent, and JADE schedules these tasks in an efficient way;
- a number of FIPA-compliant DFs (Directory Facilitator) can be launched and federated;
- programming interface to simplify registration of agent services with one, or more, domains (i.e. DF);
- transport mechanism and interface to send/receive messages to/from other agents;
- FIPA-compliant MTPs (Message Transport Protocol) to connect different agent platforms;
- lightweight transport of ACL messages inside the same agent platform, as messages are transferred encoded as Java objects, rather than strings, in order to avoid marshaling and unmarshaling procedures. When sender or receiver do not belong to the same platform, the message is automatically converted to /from the FIPA compliant string format. In this way, this conversion is hidden to the agent programmers that only need to deal with the same class of Java object;
- library of FIPA interaction protocols ready to be used;
- automatic registration of agents with the AMS;
- FIPA-compliant naming service: at startup agents obtain their GUID (Globally Unique Identifier) from the platform;
- graphical user interface to remotely manage the life-cycle of agents and agent containers.
- graphical tools for debugging the multi-agent system, like the dummy agent to send/receive ACL messages and the sniffer agent to monitor the ongoing communication between several agents.
What are my rights and my duties with the JADE license?
Open source does not just mean access to the source code (OReilly). JADE is an Open Source Software since Feb. 2000 (version 1.3) and it is released under the LGPL license. The LGPL license keeps all contributors to the same level relative to each other and it respects and protects both the users and the authors. In the following you can have a fast and rough idea of rights and duties of this license but, please, refer to the official LICENSE file for more details and legally precise information. In particular LGPL assures right to:
- make and distribute copies of JADE;
- have access to the softwares source code;
- make improvements to the program;
- incorporate JADE into a proprietary program;
- continue the JADE experience even if we stopped it !! (which will not happen, because we will not stop JADE so easily).
The LGPL mandates also some duties, and in particular:
- to not keep modifications private;
- not change the license of JADE and its modifications.
Does JADE include graphical tools?
The JADE distribution includesa set of graphical tools to support the debugging and platform administration phase:
- Remote Monitoring Agent (RMA), a tool to monitor and administer the status of all the components of the distributed platform, including agents and containers. The life-cycle of agents can also be controlled by the RMA as well as the connection with remote platforms and the installation of Message Transport Protocols. The RMA is therefore a kind of console of the system and it provides buttons to launch all the other graphical tools.
- Sniffer Agent, a tool to sniff message exchange between agents. This tool is useful to debug a conversation between agents. It allows also to save the conversation to a file and load from a file.
- Introspector Agent, a tool to debug a specific agent. This tool allows to introspect the message queues (incoming and outgoing messages) and the agent tasks (the behavior according to the JADE abstraction). The tool allows also to control the execution of the agent, in particular stopping and executing slowly or step-by-step.
- Dummy Agent, a tool to compose custom messages to send and display the received messages. Messages can also be saved to a file and loaded from a file. The tool allows to simulate by hand the communicative behavior of an agent.
- Directory Facilitator (DF), the graphical console of the FIPA DF, the yellow page component of the system. This console allows to register/deregister/modify/search for agents and services, it allows also to federate the DF with other DF’s and to propagate searches to the federated DFs.
- DFFederatorAgent. This tool is only available in the misc add-on and it supports the administrator in creating a network of federated DFs.
A shell that allows skilled programmers to create more and more tools (such as logging exchanged messages and platform events into a DataBase for later statistical analysis) is also available.
About performance and scalability of JADE.
This paper presents the measurements of scalability and performance of the messaging transport system of JADE. The source code source code of the benchmark is also available in the add-ons section in order to reproduce all the experiments. It measures the average round-trip time for a message exchange between a couple of agents under different load conditions (i.e. number of simultaneously active agents) and for different platform configurations (i.e. intra- and inter- platform, intra- and inter- container). As a term of comparison, results were compared with a non-JADE implementation based on agents as simple active objects communicating through pure RMI. JADE messaging performance are much superior compared with those provided by RMI (see Figure) when both sender and receiver agents live in the same container. JADE provides performance comparable with pure RMI when sender and receiver live in different containers where the penalty is well balanced by the benefits of a shorter development time and ease of use (see Figure). Finally, communication between different platforms via the IIOP-MTP provides performance comparable with the JADE inter-container case (seeFigure), therefore enabling an efficient integration of Multi-MAS. Globally, the results show that JADE is viable for heavy-loaded applications, that it scales linearly with the load conditions, and that efficient MAS deployment can be obtained and performance can be optimized by properly distributing agents and containers at deployment time or also by using intra-platform agent mobility at run-time. Of course, performance has been improved through subsequent releases of JADE and the following information are useful for users: JADE 2.5 optimized the performance of pattern matching (i.e. the class MessageTemplate), a synchronization bug was also fixed that occasionally created a live deadlock; a bug in JADE 2.6 was introduced that made it not suitable for scalability, this bug has been fixed in JADE 2.61. Therefore, JADE 2.5 or JADE 2.61 at this date (October 2002) appear to be the most effective releases for stress-testing. Bad Java programming practices might degrade consistently the performance of JADE agents: as well known, it is a good programming practice to move loop-invariant initializations and definitions to outside the loops. The method action() of a Behavior is often inside a loop, as for instance in the obvious case of a CyclicBehaviour. Therefore, all data structure initialization and assignment should be moved outside the method
action()
for getting better performance. For instance, this codeclass myBehaviour extends CyclicBehaviour { ACLMessage msg; ACLMessage msg2; myBehaviour(Agent myAgent) { super(myAgent); msg2 = new ACLMessage(ACLMessage.INFORM); msg2.setSender(myAgent.getAID()); AID receiver = new AID('myReceiver', AID.ISLOCALNAME); msg2.addReceiver(receiver); msg2.setProtocol('myprotocol'); msg2.setContent('hello world'); } public void action() { msg = receive(); if (msg != null) { send(msg2); } } }
Gives better performance than this code:
class myBehaviour extends CyclicBehaviour { public void action() { ACLMessage msg = receive(); if (msg != null) { ACLMessage msg2 = new ACLMessage(ACLMessage.INFORM); AID receiver = new AID('myReceiver', AID.ISLOCALNAME); msg2.setSender(myAgent.getAID()); msg2.addReceiver(receiver); msg2.setProtocol('myprotocol'); msg2.setContent('hello world'); send(msg2); } } }
Where all initialization and creation of objects have been moved from the
action()
method into the constructor of the class. Good programming practice, optimization of the compiled code (-O flag of java compiler), and usage of the best versions of JADE in some cases allowed to decrease the values of measured performances from 122 seconds down to 8 seconds!
More technical questions
JADE Primer (by Jean Vaucher and Ambroise Ncho, Dep. dinformatique, Universit de Montral, July 2003).
How do JADE agents send a message?
From the point of view of the programmer, it is just a single method call (send()
). However, the internals of JADE select the most appropriate transport protocol for each different situation:
- If the receiver agent lives on the same agent container, the Java object representing the ACL message is passed to the receiver by using an event object, without any message translation.
- If the receiver agent lives on the same JADE platform but within a different container, the ACL message is sent by using Java Remote Method Invocation. Java RMI allows transparent object marshaling and unmarshaling, avoiding tedious message conversions. Apart from performance, the agent receives a Java object, just like intra-container messaging.
- If the receiver lives on a different agent platform, the IIOP protocol and OMG IDL interface are used, according to the FIPA standard. This involves translating ACL message object into a character string and then performing a remote invocation using IIOP as middleware protocol. On receiver side, an IIOP unmarshaling will occur, yielding a Java String object, which will be parsed into an ACLMessage object. Eventually, the Java object will be dispatched to the receiver agent (via Java events or RMI calls).
Problems when unzipping JADE files.
Some users have already complained because they tried to download the JADE software several times to their NT system and every time it appeared to download the ZIP files just fine. However, when they used the WINZIP program to extract the files, all they got were file and directory names, where the files were empty (0 bytes). We use the jar program to create the distribution files and apparently it has some incompatibilities with some versions of winzip. Usually the problem disappears if you use also jar to unzip your files The command is very simple: jar xvf "name of the zip file"
Problems with the SL Parser.
The JADE implementation of the SL-0 Parser strictly complies with the FIPA specifications of the SL grammar. Here are the two most common problems that users encounter when using this parser:
-
- – The parser does not accept expressions like this
(FatherOf Peter Mary)
-
- because the first production rule of the grammar requires a t-uple of ContentExpression
Content = "(" ContentExpression+ ")".
ContentExpression = IdentifyingExpression | ActionExpression | Proposition.
-
- – the parser does not accept expressions like this
((Car :type FIAT :color red))
-
- because ParameterNames (like
:type
-
- and
:color
-
- ) cannot be used inside Propositions but only inside FunctionalTerm.
Proposition = Wff.
Wff = AtomicFormula | [...]
AtomicFormula = PropositionSymbol | "(" BinaryTermOp Term Term ")" | "(" PredicateSymbol Term+ ")" | "true" | "false".
FunctionalTerm = [...] | "(" FunctionSymbol Parameter* ")".
Parameter = ParameterName ParameterValue .
ParameterName = ":" String .
I cant run the examples or I get a ClassNotFound Exception.
In order to reduce the size of the distribution files, the examples are distributed in source code and not yet compiled. The ant build file is also distributed in the jade root directory that allows to compile all the examples (ant examples). If you get a ClassNotFound exception, the most common problem is that you have not properly set the CLASSPATH. It must include all the .jar library files that are in the jade/lib directory (i.e. jade.jar; jadeTools.jar; iiop.jar; Base64.jar) plus the directory where the examples have been compiled (i.e. jade/classes).
How to get context sensitive help about JADE with Eclipse.
Unzip the directory jade/src from jade-src-3.0b1.zip or from the latest snapshot. The directory should look like:
jade/src --| jade | FIPA | starlight
Create a .jar file from the content of this directory, named JADE_SRC.jar (the command line is "jar cf JADE_SRC.jar jade FIPA starlight"
). If unfamiliar with jar command, create a JADE_SRC.zip file, always from the directory contents. The file should contain a directory structure like this:
JADE_SRC --| jade | FIPA | starlight
Any extra entry is unimportant. Now were done with the source packaging, lets tell Eclipse how to use it In Eclipse, open the project which uses the JADE libraries. In Project > Properties, choose Java build path > libraries (all the libraries used by the project should appear). For every JADE library (Base64.jar, jade.jar, iiop.jar, jadeTools.jar) repeat these steps: 1. Click on + on the left to display javadoc location and source attachment. 2. Double click source attachment (a dialog opens, to modify the source attachment path). 3. Enter the JADE_SRC path (either .zip or .jar); choosing External file you can browse your HD to find it . Once done for all JADE libraries, Eclipse will show the tooltips taking them directly from the source code; moreover, you will be able to browse the JADE source as the project code (obviously in read-only mode). It will be available also for debugging, but depending on the JADE compilation some debug functions like Inspect may not work (this happens if there are no debug info in the .class files). thanks to Ignazio Palmisano, 26th August 2003
Running JADE over .NET where to start from?
Actually it is possible to implement aplications with Jade 3.0b1 and .NET. Infact, the pJava version of JADE-LEAP uses the 1.1.x version of Java that is compatible with Visual J# and thus allows LEAP to be used as a portability mechanism to bridge between the .NET world and the JADE agent world. Since 18th April 2005 (just after JADE 3.3), a new target was added by Federico Pieri (ERXA) to the JADE-LEAP build file that enables creating JADELEAP for a .NET environment. The LEAP User Guide explains also how to do that.
What does the warning MessageManager queue size > 10000000 mean?
The JADE runtime has an internal queue (called OutBox) of messages to be delivered. When an agent sends a message (method send()) the message is inserted in the OutBox. A pool of threads is responsible for extracting messages from the OutBox and actually delivering them to receivers. That size of the OutBox of course depends on the number of messages waiting to be delivered and on the size of each message. When this size exceeds a given threshold (default is 10 MB) a warning is printed. This is not particularly dangerous, but of course it is a clear indication that either agents are generating really A LOT of traffic or they are sending really BIG messages. It is possible to increase the above threshold by means of the jade_core_messaging_MessageManager_maxqueuesize option whose value must be specified in bytes (e.g. 10000000 means 10 MB).