Chapter 1. Introduction

Jadex is an agent-oriented reasoning engine for writing rational agents with XML and the Java programming language. Thereby, Jadex represents a conservative approach towards agent-orientation for several reasons. One main aspect is that no new programming language is introduced. Instead, Jadex agents can be programmed in the state-of-the art object-oriented integrated development environments (IDEs) such as eclipse and Intellij IDEA. The other important aspect concerns the middleware independence of Jadex. As Jadex is loosely coupled with its underlying middleware, Jadex can be used in very different scenarios on top of agent platforms as well as enterprise systems such as J2EE.

Similar to the paradigm shift towards object-orientation agents represent a new conceptual level of abstraction extending well-known and accepted object-oriented practices. Agent-oriented programs add the explicit concept of autonomous actors to the world of passive objects. In this respect agents represent active components with individual resoning capabilities. This means that agents can exhibit reactive behavior (responding to external events) as well as pro-active behavior (motivated by the agents own goals).

1.1. Requirements and Installation

If you want to run the Jadex examples to get a quick overview of the system, you may download one of the read-to-run installer bundles available from the project homepage, or run the system directly from the web.

If you intend to develop agent software with Jadex it is necessary to set up Jadex on your system Only few steps are necessary. It is recommended to do these steps by hand to see how the required components fit together.

Software.  The following describes the 3rd party software required to run Jadex.

  • Java.  Jadex has been developed for use with the Java 2 Standard Edition (J2SE), Version 1.4 or any later version. If not already done, download and install a recent Java Development Kit (JDK).

  • Third-Party Libraries.  The Jadex distribution includes a number of third-party libraries. For an accurate list please consult the Appendix E, Legal Notice.

Installation.  If you have not already done so, download the Jadex distribution .zip and unpack it to a directory of your choice. Afterwards, add at least the libraries described below to your class path. The following assumes for simplicity, that you are running Jadex from the console. If you prefer, you can also use your favourite IDE to enter classpath settings and run configurations.

  • jadex_rt.jar The Jadex runtime jar includes the kernel of the Jadex reasoning engine.

  • jadex_standalone.jar The Jadex stanalone jar contains the recommended basic agent middleware for Jadex. It represents a fast and efficient agent environment with a minimal memory footprint.

  • jadex_tools.jar The Jadex tools jar contains all available Jadex tools, namely the Jadex Control Center (JCC) which allows administration of agents and represents the central access point to all other runtime tools: The introspector for viewing the internal state of an agent and also for debugging it via stepwise execution, the tracer for creating visual execution traces that can be used to determine if an agent behaves as intended, the Message Center for fast and easy messsage composition, and the Jadexdoc tool that allows to generate API docs for agents in the spirit of Javadoc.

  • jibx-run.jar and xpp3.jar These jars belong to the JiBX XML databinding framework, which is used to read agent and capability XML files.

Besides these standard libraries, which are needed for the execution of agents, some extra libraries are included for certain features. The control center uses the JavaHelp system, which requires the jhall.jar. The Jadex tracer tool requires additionally the also contained GraphLayout.jar. The introspector detail view output can be visually improved (html instead of plain text) by also using a velocity.jar (not included, see http://jakarta.apache.org/velocity).

1.2. Getting Started

This chapter describes how to run the examples provided with the Jadex distribution. Following the instructions below you can test if your Jadex installation works correctly.

1.2.1. Compile an Example

When you have downloaded and unpacked the full distribution, you already have available the sources for the examples. If you do not have the sources or you do not want to compile them now, you can skip this section and instead use the precompiled jadex_examples.jar.

In the Jadex src directory there is an examples directory, which contains subdirectories with different example agents or multi-agent applications built with Jadex. Open a shell or console window, change to the src directory and compile the Java source files of the HelloWorld agent by entering

javac jadex/examples/helloworld/*.java

If it doesn't work, check if you have at least jadex_rt.jar in your classpath when compiling.

1.2.2. Start an Example Agent

Jadex comes with the Jadex Control Center (JCC) useful for loading and starting Jadex agents. You can start a standalone platform together with the Control Center with the following command:

java jadex.adapter.standalone.Platform

If the platform does not start or the Control Center user interface does not show up, check if you have all necessary libraries, at least jadex_rt.jar, jadex_standalone.jar, jadex_tools.jar, jibx-run.jar, xpp3.jar, and jhall.jar in the classpath.

Once the Control Center has started, you can select agents by using the browse button (named “...”) and locating some agent ADF from the examples directory. Besides file selection via a selection dialog you can also add new content root folders and jars to the tree model explorer (using the “+” button). When you want to use the precompiled examples, add the jadex_examples.jar from the lib directory. To load a model from the tree, it sufficient to click on a model contained in the folder. If a model was successfully loaded the starter dialog on the right-hand side shows details about the model and allows to enter an agent instance name and additional arguments. To start the HelloWorld agent browse to the src/jadex/examples/helloworld folder and select the HelloWorld.agent.xml. After loading the agent model, the details panel shows descriptions of the currently loaded agent model.

When you have loaded an agent definition file, all required values to start the agent will be filled in, so you just have to hit the “Start” button to create the agent. In the case of success, the HelloWorld agent will print out a welcome message to the console. When the example agent cannot be loaded or started, check if you have started the Standalone platform from the Jadex src directory, and that you have the current directory (“.”) in the classpath. (This is necessary for the example classes and XMLs to be found. Alternatively you can add the jadex/src directory to the classpath or the tree.)

We recommend to try out the other examples to get an impression of Jadex. You can use either the ExampleStarter agent (in the src/jadex/examples/starter directory) to easily start the agent applications or you can use the provided manager agents in each application. The manager agents start all agents needed for a special application in correct order. Explanations of the examples can be found in the corresponding readme.txt files and at docs/examples/index.html. For further information on starting agents see the [Jadex Tool Guide].