SRE stands for “SARL Runtime Environment”. The SRE is an implementation of an agent platform, which is able to run a SARL program. The official standard SRE supported by the SARL developers is the Janus platform.
Janus is an open-source multi-agent platform fully implemented in Java 21. Janus enables developers to quickly create web, enterprise and desktop agent-based applications.
Janus is an agent execution platform not an agent-oriented language.
It provides a comprehensive set of features to develop, run, display and monitor agent-based applications.
Janus-based applications can be distributed across a network. Janus could be used as an agent-oriented platform, an organizational platform, and/or a holonic platform. It also natively manages the concept of recursive agents and holons.
Official website: www.janusproject.io
If you cannot find an answer to your question in the FAQ, nor the reference documents, nor the existing SARL issues, you may ask the SARL developers on the SARL forum, or on the instant messaging forum.
Janus is now part of the SARL project. The release planning of SARL is detailed on the milestones page on Github.
Several run-time errors from the Janus framework are explained here.
The Janus runtime platform is a Java application. Every operating system which has a Java Virtual Machin, especially the Java Development Kit (JDK), with at least with the 21 standard may be used to run Janus.
Janus requires the JDK 21 or higher (and strictly lower than 27) to run and compile. Note that if you plan to create Android applications, you may configure your JDK to produce 1.6 class files from 21 Java code, depending of the current supported standard on Android platforms.
Three methods are available for launching one or more agents in the Janus platform:
There is two methods for starting an application that will run SARL agents:
For the first case, the qualified name of the agent type to be launched must be provided. This case is supported by the SARL Agent launch configuration.
For the second case, the main()
function of the application should be launched in
order to start it. This case is supported by the SARL Application launch configuration.
Both launch configurations adds the SARL Run-time Environment into the run-time classpath. The selected SRE depends on the configuration of your Eclipse SARL product.
Both “Java Application” and “SARL Application” are launch configurations for starting
a Java application, i.e. invoking the main()
function for starting up.
The difference between them is that the “SARL Application” launch configuration is automatically adding in the application classpath the SARL Run-time Environment that is configured into your Eclipse SARL project. The “Java Application” does not.
Consequently, if you need to run agents and if you start your application with a “Java Application” launch configuration, you must add manually the SRE libraries in the classpath.
This error occurs when there is no SARL Runtime Environment (SRE) installed on your Eclipse environment, OR when the installed SRE is not compatible with the installed version of the SARL tools, which are embedded in Eclipse.
For solving this problem, you must download the latest
Janus platform, and install it in your Eclipse
(Menu Window> Preferences> SARL> Installed SREs
).
This error occurs when the SARL Runtime Environment (SRE) has a version lower than the version of the SARL tools, which are embedded in the Eclipse IDE. This difference of version may cause problems during the execution of your agents, since the capacities’ definitions may not be the same.
For solving this problem, you must download the version of the SARL Runtime Environment (SRE) that is implementing the version of the SARL specification that you’re using on Eclipse IDE. For the Janus platform, the versions of the latest stable and development releases are displayed on this page. For determining if the Janus platform implements the correct version of the SARL specification, please read the explanation on how Janus version numbers are built.
When the Janus platform cannot find the class file for the start-up agent, it
displays the error message "Agent class not found"
.
For resolving this problem, you should check if:
Agent
.For showing the arguments given to Janus, you could launch Janus with the command line option:
--cli
. This option stops Janus after displaying the command line arguments,
including the --cli
option.
When installing Janus as an SRE in the Eclipse interface, the plugin loads the Jar file of the SRE with the default API. The Jar archiver uses the default file encoding of the operating system. On Linux and MacOS 10, it is almost UTF-8. On Windows, it is Latin1. And on MacOS (before 10), it is Mac-Roman.
The Janus Jar file is generated on a Linux operating system (UTF-8). When the Java virtual machine tries to uncompress and use the content of the Jar, it may complain about an invalid charset format.
For solving this issue, you could launch your Eclipse with the command line option
-Dfile.encoding=UTF-8
, which is forcing the Eclipse product to consider the
file as encoded with the UTF-8 charset.
Note that this option is defined into the Eclipse SARL product since version 0.4.
Both “Java Application” and “SARL Application” are launch configurations for starting
a Java application, i.e. invoking the main()
function for starting up.
The difference between them is that the “SARL Application” launch configuration is automatically adding in the application classpath the SARL Run-time Environment that is configured into your Eclipse SARL project. The “Java Application” does not.
Consequently, if you need to run agents and if you start your application with a “Java Application” launch configuration, you must add manually the SRE libraries in the classpath.
No.
There is no warranty on the receiving order of the events. This is a particular implementation choice of the runtime environment. For example, the Janus runtime environment executes the event handlers in parallel. The real order of execution depends on how the Java executor is running the handlers on the threads.
When the event e
of type E
is received by an agent the following algorithm is applied:
if "on Initialize" is currently running then
add e to a buffer of events.
else if "on Destroy" is currently running then
ignore the event.
else
fire(e)
fi
The function fire(e)
retrieves all the on E
and runs them in parallel, and
there is a synchronization point after the running of all the on E
if E
is
Initialize
or Destroy
(for forcing synchronous execution of on Initialize
and on Destroy
). At the end of the on Initialize
(after synchronization point),
all the buffered events are fired.
Observe that if the event is fired from within the on Initialize
, the same algorithm
is applied whatever the receiving agent.
Regarding spawn()
, the function runs in two parts:
spawn()
is
not locked. Then, the created thread runs all the initialization process,
including the synchronous execution of on Initialize
(see previous question).
Consequently, the on Initialize
of the spawn agent will not block the spawn caller.No.
Janus was designed to discover other kernels automatically. By default, the different instances of the Janus platform are connected together without any particular configuration. The sole constraint is that the kernels must be on the same local network.
The sources for Janus are available inside the SARL project repository on Github.
Janus Developers use Github to manage bug tracking and project workflow. The issues are listed on Github.
You should submit your issue on this page.
Copyright © 2014-2024 SARL.io, the Original Authors and Main Authors.
Documentation text and medias are licensed under the Creative Common CC-BY-SA-4.0; you may not use this file except in compliance with CC-BY-SA-4.0. You may obtain a copy of CC-BY-4.0.
Examples of SARL code are licensed under the Apache License, Version 2.0; you may not use this file except in compliance with the Apache License. You may obtain a copy of the Apache License.
You are free to reproduce the content of this page on copyleft websites such as Wikipedia.
Generated with the translator docs.generator 0.14.0.