Some examples are distributed with the JADE software, that show how to use the main features of the framework and some suggested programming languages.
All the examples are distributed both in binary and source form. The ‘examples’ target of the ant file ‘build.xml’ in the JADE root directory allows re-compiling them.
To do that just type ‘ant examples’.
NOTE: The build.xml file is included in the Jade sources distribution.
In order to run the examples, set the CLASSPATH environment variable to contain the files jade.jar, jadeExamples.jar and commons-codec/commons-codec-1.3.jar.
All example agent classes belong to subpackages of the ‘examples’ package, refer to the various example agents with a fully qualified package name; for example, class ComplexBehaviourAgent in ‘behaviours’ subdirectory of ‘examples’ directory must be started via the following command line:
java jade.Boot -gui agent1:examples.behaviours.ComplexBehaviourAgent
The following is the list of all the example programs distributed in the ‘src/examples’ directory.
Basic features.
- Hello World: Shows a minimal agent printing “Hello World!” and then terminating.
- Behaviours: Includes examples showing the usage of simple and composite behaviours.
- Messaging: Includes examples showing how to make JADE agents communicate.
- Yellow Pages: Includes examples showing how to use the Yellow Pages service provided by the DF agent.
- Topic-based communication : Includes examples showing how to use the topic-based message delivery mechanism introduced with release 3.5.
- Book Trading, Shows a very simple multi agent system for trading books online.
Advanced features.
- Protocols, Includes examples showing the usage of the support provided by JADE for interaction protocols.
- Ontology, this example shows how to use the support for application specific ontologies.
- In Process, this example shows the usage of the jade.wrapper package to start a JADE runtime and control a number of agents from an external application.
- Base 64, this example shows how to encode serialized Java objects into the content of an ACLMessage; it also shows how to force the platform to use bit-efficient and/or XML ACLCodec.
- Mobile, this is an example of a mobile agent.
Using JADE with other technologies.
- JSP, this is an example of integration of JADE and JSP kindly provided by Daniel Le Berre. Look at the tutorial in the documentation.
- Jess, is a sample agent that allows the programmer to avoid writing any line of Java code and implement everything in CLIPS by using JESS.
- JadeJessProtege, this package includes examples for a closer integration of JADE with JESS, optionally also with protege.
Simple applications.
- ThanksAgent, this example shows an agent that creates some other agents and has a simple conversation with them
- Party, this is an example of a simple multi-agent application where an host sets a party and invite a number of guests
- The Agentcities PingAgent, this directory contains a simple Ping Agent.