User Tools

Site Tools


This is an old revision of the document!

startSectionEdit: $data "plugin_wrap_start" is NOT an array! One of your plugins needs an update.
startSectionEdit: $data "plugin_wrap_end" is NOT an array! One of your plugins needs an update.

Simple API for JADE-based Simulations (SAJaS)

Multi-agent systems (MAS) are widely acknowledged as an appropriate modelling paradigm for distributed and decentralized systems, where a (potentially large) number of agents interact in non-trivial ways. Such interactions are often modelled defining high-level interaction protocols. Open MAS typically benefit from a number of infrastructural components that enable agents to discover their peers at run-time.
On the other hand, multi-agent-based simulations (MABS) focus on applying MAS to model complex social systems, typically involving a large agent population.
Several MAS development frameworks exist, but they are often not appropriate for MABS; and several MABS frameworks exist, albeit sharing little with the former. While open agent-based applications benefit from adopting development and interaction standards, such as those proposed by FIPA, MABS frameworks typically do not support them.

The Simple API for JADE-based Simulations (SAJaS) is a proposal to bridge the gap between MAS simulation and development. SAJaS enhances MABS frameworks with JADE-based features. While empowering MABS modellers with modelling concepts offered by JADE, SAJaS also promotes a quicker development of simulation models for JADE programmers. In fact, the same implementation can, with minor changes, be used as a large scale simulation or as a distributed JADE system.
SAJaS provides, for certain kinds of applications, increased simulation performance, as compared to JADE.

A MAS Simulation to Development (MASSim2Dev) tool is SAJaS companion, and allows automatic conversion of a SAJaS-based simulation into a JADE MAS, and vice-versa.

Software download

SAJaS is made available under LGPL v3.


In order to use SAJaS, you need the SAJaS library. Additionally, you will also need JADE (at least the jade.jar library) and one of Repast 3 or Repast Simphony. For Repast 3, it is enough to include its jar files in your project's build path. Repast Simphony typically comes with its own Eclipse integration, thus you can simply build your Repast Simphony Project in there and add the JADE and SAJaS libraries to the project's build path.

JADE, Repast 3 and Repast Simphony are available in their respective websites.

SAJaS is available at SourceForge:

SAJaS v0.92b, 2016-Mar-11
Includes the SAJaS library, source code and API documentation

Version dependencies

The current version of SAJaS (v0.9b2) is integrated and has been tested with JADE 4.3.3.

SAJaS comes with API interfaces to Repast 3 and Repast Simphony 2.3.1.


The same JADE-based implementation can be used to run the MAS in JADE or its equivalent simulation in SAJaS. Minor changes are required, related with redirecting class imports from JADE to SAJaS or vice-versa.

The MASSim2Dev tool performs the needed changes automatically.

How to

Developers familiar with JADE should have no problem on making use of SAJaS. In order to run a JADE-based simulation using SAJaS, a very limited amount of knowledge of Repast is needed. The benchmark scenario shown below should enable any developer to start using SAJaS. Of course that in order to take full advantage of the simulation tools provided by Repast a deeper knowledge of this framework is required.

As for Repast users, SAJaS makes it possible to develop your multi-agent based simulation using the rich set of MAS facilities featured in JADE. In order to take advantage of such facilities, some knowledge of JADE programming is required.

Benchmark scenario

A benchmark scenario provides a comparison between running the same MAS in JADE, SAJaS+Repast3 and SAJaS+RepastS. The scenario is described in the paper “SAJaS: Enabling JADE-based Simulations” (see the publications section). A quick snapshot of performance comparison included in that paper is displayed here for convenience. In the figure, n is a parameter that determines the number of agents in the system.

Below you can download the source code for a similar scenario, which is provided for the three frameworks. Note that the actual JADE-based source code is essentially the same, apart from the classes that are being imported (either JADE's or their SAJaS equivalent). The source code for SAJaS+Repast3 is provided in two versions: the second one exploits Repast3 visualization tools, both in terms of agent interaction and data collection.

The classes that are used to run the different MAS/simulation infrastructures are, and, respectively.

Extending Repast Launchers

SAJaS includes two base classes for launching Repast's simulation infrastructure and run a JADE-based MAS on it: Repast3Launcher and RepastSLauncher, for Repast 3 and Repast Simphony, respectively.

Repast 3

In case of Repast 3, you need to extend Repast3Launcher and implement the following methods:

  • public String[] getInitParam() – Repast 3 specific, inherited via Repast3Launcher's superclass SimModelImpl
  • public String getName() – Repast 3 specific, inherited via Repast3Launcher's superclass SimModelImpl; used by SAJaS as an ID for the JADE platform
  • protected void launchJADE() – SAJaS specific, used to launch the JADE platform (with SAJaS own classes)

If you want to exploit further Repast3-specific tools, you can do as follows.

For adding property descriptors (which are used for changing the way custom parameters are shown in the GUI), you must extend the setup method. When doing so, it is crucial that you start by calling super.setup(). Your method should look as follows:

	public void setup() {
		super.setup();  // crucial!

		// property descriptors
		// ...

For using data collection/visualization and agent spaces/displays, which typically involve making use of the scheduler, you must extend the begin method. When doing so, it is crucial that you start by calling super.begin(). Your method should look as follows:

	public void begin() {
		super.begin();  // crucial!

		// display surfaces, spaces, displays, plots, ...
		// ...

An example of this use is included in the source code for the benchmark scenario above.

Repast Simphony

In case of Repast Simphony, you need to extend RepastSLauncher and implement the following methods:

  • public String getName() – SAJaS specific, used as an ID for the JADE platform
  • protected void launchJADE() – SAJaS specific, used to launch the JADE platform (with SAJaS own classes)

If you want to exploit further Repast Simphony-specific tools, you can extend the build method. When doing so, it is crucial that you call Your method should look as follows:

	public Context build(Context<Object> context) {
		// ...
		...;   // crucial!
		// ...

Current limitations

SAJaS takes a near-full advantage of JADE's features. The following are a couple of exceptions regarding the current version of SAJaS:

  • Handling time: The FIPA ACL message structure specification includes an optional reply-by parameter, which may be used to halt waiting for the next sequential message in an interaction protocol when the indicated time has elapsed. Given the simulation bias of SAJaS, it is not clear yet to which time this should refer to. Translating such timestamps to simulation ticks is probably the way to go, but enough simulation ticks should be allowed for responding agents to process the message and respond accordingly, which requires having a mechanism that interfaces properly with simulation scheduling.
    For the same reason, two specific JADE behaviours that rely on system time should also be avoided: WakerBehaviour, which specifies a task to be executed after a specific amount of time has elapsed, and TickerBehaviour, which specifies a periodic task to be executed in regular time intervals.
  • Blocking approaches: JADE includes a few blocking approaches for agent interaction, namely based on the blockingReceive and doFipaRequestClient methods in the Agent class. These methods block agent execution until a matching message is received or a complete protocol is concluded. Given the single-threaded approach of SAJaS, or more precisely of the simulation frameworks (such as Repast) it may be aligned with, blocking approaches do not work.
    Another typical usage of blocking approaches in JADE concerns (de)registering and searching the DF (JADE's yellow page service), for which a number of blocking methods are available in the DFService class. Given their quite common usage, these methods are still available in SAJaS, where they have been reimplemented so that they do not block, while achieving the desired functionality.


Henrique Lopes Cardoso (2015). “SAJaS: Enabling JADE-Based Simulations”, Transactions on Computational Collective Intelligence XX, N.T. Nguyen et al. (Eds.), LNCS 9420, pp. 158-178, Springer. DOI: 10.1007/978-3-319-27543-7_8.

João P. C. Lopes, Henrique Lopes Cardoso (2015). “From Simulation to Development in MAS: A JADE-based Approach”, in Proceedings of the 7th International Conference on Agents and Artificial Intelligence (ICAART 2015), Vol. 1, pp. 75-86, ISBN: 978-989-758-073-4, Lisbon, Portugal, 10-12 January 2015.

João Pedro Camacho Lopes (2014). From simulation to development in MAS: A JADE-based Approach, MSc Thesis, MIEIC (FEUP), LIACC, July 2014.


This page has been created and is maintained by Henrique Lopes Cardoso. Any feedback or questions are highly appreciated.

Henrique Lopes Cardoso 2016/03/04 11:00

sajas.1457709553.txt.gz · Last modified: 2016/03/11 15:19 by hlc