Fork me on GitHub

Changes in 0.12.0

Release date: 2021-05-27.

1. Major Changes

Number of major changes: 4.

1.1. Enable static and instance features in the parameters’ default values

SARL allows you to specify a default value for a formal parameter of a function or a constructor. When a default value is specified, it means that the caller of the action can skip passing a value for the corresponding argument. And, when the function is called, the default value is given to the skipped argument.

Up to the version 0.11 of SARL, the expressions that constitute the default values must reference static or constant expressions, and these features must not have border effect.

Since the version 0.12 of SARL, the first restriction is no more applied. Consequently, the default value expression could reference either static and instance features (1, 2). The constraint on the feature’s border effects is still valid.

For example, the following code is valid in SARL:

agent A {

	var aField : int

	def aFunction(p : int = aField) {
	}

}

It means that the value of the p parameter is the value of the aField field when the aFunction function is invoked.

1.2. Add “abstract” into the modifiers for events

The abstract modifier is added into the list of the accepted modifiers for a SARL event (details). For example, the following code defines an abstract event with name A:

abstract event A

An abstract event is an event that cannot be instantiated, but it can be derived. When an abstract event is derived, the subtype usually provides constructors that are compatible with the super type’s constructor.

1.3. Agent Error Handling

In SARL, as for the Akka actor framework, there is an important distinction between failures and validation errors:

In order to make the agent able to react to failures, the SARL API defines a specific event that is representing any failure or validation error that the agent could handle if it is interested by: Failure. Each time an agent needs to be notified about a fault (into its agent tasks for example), an occurrence of this event type is fired in the internal context of the agent.

Several failure events are pre-defined in the SARL API:

Also, the AgentKilled event has been updated in order to provide the cause of the agent’s killing.

Finally, the SARL API provides tools for propagating failures in the hierarchy of agents, to the parents and to the children.

1.4. Agent Observation and Probing

The multi-agent system is composed of multiple elements, including agents, behaviors, contexts and spaces, but not limited to. Organizational models in multi-agent systems usually position agents as actors-observers within environments shared by multiple agents and organizational structures at different levels of granularity. Then, the agents may have the capacity to observe the environment and the other agents, without directly interacting with them. The observing agent is able to extract information from another agent or from a society of agents, that could be opaque according to a possible holonic architecture of the system.

Observation means that data or information could be extracted from the observed object without filtering from this latter. The observer is not intrusive from the agent point of view. In other words, the observed agent has no knowledge about the fact it is observed or not. In this case, it cannot adapt its behavior on its observation status.

An observation mecanism was defined into the Janus SRE. Since the version 0.12 of SARL, this observation mecanism is moved into the SARL SDK and transformed as an API that is independent to the SRE (1, 2, 3). In the same set of commits, the naming service for the multiagent system components has been moved from the Janus SRE to the SARL DSK.

Because an agent is defined as an autonomous entity, the agent is supposed to be able to specify if a part of itself is observable or not, i.e. to specify the access rights to its fields. The concepts of “observable” and “not observable” field are introduced in SARL 0.12 (1, 2).

This observability flag could be defined statically by annotating the observable field, or one of its enclosing type, with the @Observable annotation. The second method is to implement a dedicated agent skill implementing the capacity FieldAccessValidationCapacity that enables the agent to manage the access rights to its fields dynamically.

2. Other Changes

2.1. SARL Programming Language

2.1.1. SARL Language

a) Detection of pure functions
b) Detection of immutable objects
c) Automatic object conversions
d) Annotations of code

2.1.2. SARL Validator

2.1.3. Java Model Inferrer

a) Polymorphic event dispatching
b) Value casting
c) Automatic annotations
d) Bug fixes

2.1.4. SARL Core Library

2.1.5. SARL Formatter

2.1.6. SARL Batch Compiler

2.2. SARL Development Toolkit (SDK)

2.2.1. Agent Context

2.2.2. Agent Behaviors

2.2.3. Agent Skills

2.2.4. DefaultContextInteractions Capacity

2.2.5. Lifecycle Capacity

2.2.6. InnerContextAccess Capacity

2.2.7. ExternalContextAccess Capacity

2.2.8. Naming API

2.2.9. Coding Style with the SARL SDK

2.2.10. New Modules

2.3. SARL User Interface

2.3.1. UI Components

2.3.3. Eclipse Product

c) Launch Configurations
b) Commands
c) Preferences
d) Other Changes

2.4. Examples of SARL projects

2.4.1. Example code

2.4.2. JDK support

2.4.3. JavaFX support

2.4.4. Windows OS support

2.5. Janus Run-time Environment

2.5.1. Bug fixes

2.5.2. Entity Creation

2.5.3. Context Service

2.5.4. Executor Service

2.5.5. Lifecycle Service

2.5.6. Naming and Probing Services

2.5.7. Logging Service

2.5.8. Space Implementation

2.5.9. Internal API

2.5.10 Network Service for Janus SRE

The service-based architecture of the Janus SRE enables to provide specific services for running SARL agents. The version 0.12 of SARL introduces a service for the communication over a computer network of different instances of the Janus SRE.

By default, Janus does not provide a support for exchanging events over a computer network. If you would like to have benefit of this feature, you should use the extension module, named “Janus Network”, that is introduced in SARL 0.12 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34). The implementation of this module is based on the Hazelcast library in order to build the clusters of Janus nodes.

Thanks to its implementation, the network service has the following major properties:

2.6. Maven Tools

2.6.1. Bootique Plugins

2.6.2. Documentation Generation Plugin

2.7. Command-Line Tools

2.7.1. sarlc

2.7.2. sarldoc

2.8. SARL Documentation

2.9. Tools for SARL Contributors

2.9.1. Changes in the SARL Compiler Libraries

a) General Changes
b) Pure Functions
c) Preparation for Java 11
d) Code Mining
e) Logging
f) Other Changes

2.9.2. Build Tools

3. Changes in the Previous Versions