SARL (programming language)
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
The SARL programming language is a modular agent-oriented programming language. It aims at providing the fundamental abstractions for dealing with concurrency, distribution, interaction, decentralization, reactivity, autonomy and dynamic reconfiguration. These high-level features are now considered as the major requirements for an easy and practical implementation of modern complex software applications.
SARL is platform-independent and agent’s architecture-agnostic. SARL provides a set of agent-oriented first-class abstractions directly at the language level, but it was designed to ease the integration and the mapping of concepts provided by other metamodels. SARL itself exploits this extension mechanism for defining its own extensions (organizational, event-driven, etc.). SARL also natively supports the notion of holonic multiagent systems and recursive agent (also called Holon), but does not force the developer to use it.
Overview
The main perspective guiding the creation of SARL is the establishment of an open and easily extensible language. Such language should thus provide a reduced set of key concepts that focuses solely on the principles considered as essential to implement a multi-agent system. The metamodel of SARL is based on four main concepts: Agent, Capacity, Space and Skill. The core metamodel of SARL is presented in Figure 1 and the main concepts are colored in light blue. Each of these concepts will be detailed in the following sections as well as the corresponding piece of SARL code to illustrate their practical use.
Basically, a Multiagent System (MAS) in SARL is programmed as a collection of Agents interacting together in a collection of shared distributed Spaces. Each agent has a collection of Capacities describing what it is able to perform, its personal competences [20, 4]. Each Capacity may then be realized/implemented by various Skills. We can draw the parallel with the concepts of Interfaces and corresponding implementation classes in object-oriented languages. To implement specific architectures (like BDI, reasoning, reactive, hybrid, etc.) developers should develop their own capacities and corresponding skills providing the agents with new exploitable features.
Despite its open nature, SARL imposes some fundamental principles to be respected by the various Virtual Machines (VM) that wants to support it. First of all, the implementation of Space must be fully distributed and the execution layer must be abstracted from agents. SARL encourages a massively parallel execution of Agents and Behaviors. SARL is fully interoperable with Java to easily reuse all the contributions provided by the Java community, but also to facilitate the integration and evolution of legacy systems. One of the key principles governing SARL consists in not imposing a predefined way for Agents to interact within a Space. Similarly, the way to identify agents is dependent on the type of Space considered. This allows to define different types of interaction mechanisms and models on Spaces.
Strongly inspired by new languages like Scala and Clojure but also [[Ruby (programming language)|Ruby], we try to implement in SARL an intuitive syntax with a shallow learning curve. SARL has been developed on top of Xtext that enables to easily build your own domain-specific language. We thus directly benefits from a working parser and linker as well as a direct integration in Eclipse. The complete definition of the SARL’s grammar in Xtext format is available on [https://raw.github.com/sarl/sarl/master/lang/plugins/io.sarl.lang/src/io/sarl/ lang/SARL.xtext GitHub].
Concepts
Agent
An agent is an autonomous entity having a set of skills to realize the capacities it exhibits. An agent has a set of built-in capacities considered essential to respect the commonly accepted competences of agents, such autonomy, reactivity, proactivity and social capacities. Among these Built-In Capacities (BIC), is the Behaviors capacity that enables agents to incorporate a collection of behaviors that will determine its global conduct. An agent has also a default behavior directly described within its definition. A Behavior maps a collection of perceptions represented by Events to a sequence of Actions. The various behaviors of an agent communicates using an event-driven approach. An Event is the specification of some occurrence in a Space that may potentially trigger effects by a listener (e.g. agent, behavior, etc.).
Agent’s Lifecycle
SARL does not imposes a specific agent’s control loop. Indeed, when agents are spawned (by the host VM or other agent), the VM is in charge of creating the agent instance and installing the skills associated to the built-in capacities into the agent. Then, when the agent is ready to begin its execution, it fires the Initialize event. This event contains any parameters for the agent’s instance. Likewise, when the agent has decided to stop its own execution (using the killMe action from the Lifecycle Capacity), the VM will firAgent’s Lifecycle: SARL does not imposes a specific agent’s control loop. Indeed, when agents are spawned (by the host VM or other agent), the VM is in charge of creating the agent instance and installing the skills associated to the built-in capacities into the agent. Then, when the agent is ready to begin its execution, it fires the Initialize event. This event contains any parameters for the agent’s instance. Likewise, when the agent has decided to stop its own execution (using the killMe action from the Lifecycle Capacity), the VM will fire the Destroy event to enable the agent to release any resource it may still hold. It is important to notice that agents cannot kill other agents, not even those that they have spawned. The key characteristic of Agents is their autonomy and no other agent should be able to stop its execution without its consent. The designer is then free to implement any control or authority protocol for their own application scenario.e the Destroy event to enable the agent to release any resource it may still hold. It is important to notice that agents cannot kill other agents, not even those that they have spawned. The key characteristic of Agents is their autonomy and no other agent should be able to stop its execution without its consent. The designer is then free to implement any control or authority protocol for their own application scenario.
Capacity and Skill
An Action is a specification of a transformation of a part of the designed system or its environment. This transformation guarantees resulting properties if the system before the transformation satisfies a set of constraints. An action is defined in terms of pre- and post-conditions. A Capacity is the specification of a collection of actions. This specification makes no assumptions about its implementation. It could be used to specify what an agent can do, what a behavior requires for its execution. A Skill is a possible implementation of a capacity fulfilling all the constraints of this specification. An agent can dynamically evolve by learning/acquiring new Capacities, but it can also dynamically change the Skill associated to a given capacity [20, 4]. Acquiring new capacities also enables an agent to get access to new behaviors requiring these capacities. This provides agents with a self-adaptation mechanism that allow them to dynamically change their architecture according to their current needs and goals.
Context and Space
A Context defines the perimeter/boundary of a sub-system, and gathers a collection of Spaces. In each context, there is at least one particular Space called Default Space to which all agents in this context belong. This ensures the existence of a common shared Space to all agents in the same context. Each agent can then create specific public or private spaces to achieve its personal goals. Since their creation, agents are incorporated into a context called the Default Context. The notion of Context makes complete sense when agents are considered composed or holonic (see below).
A Space is the support of the interaction between agents respecting the rules defined in a Space Specification. A Space Specification defines the rules (in- cluding action and perception) for interacting within a given set of Spaces respecting this specification.
Recursive Agent or Holon
In SARL, we recognize that agents can be composed of other agents. Therefore, SARL agents are in fact holons that can compose each other to define hierarchical or recursive multiagent system, called holarchies. In order to achieve this, SARL agents are self-similar structures that compose each other via their Contexts. Each agent defines its own Context, called Inner Context and it is part of one or more External Contexts.
The Janus Run-time Environment
SARL language specifies a set of concepts and their relations. It defines on top of them a collection of Built-In Capacities for agents. However, the SARL project does not impose a particular execution infrastructure. We consider that many different implementations of these concepts can be provided, and it can help SARL develop faster.
Nevertheless, we provide one of these infrastructures in the Janus Project]. Janus is an open-source multi-agent platform fully implemented in Java 1.7. Janus version 2.0 was entirely rewritten to support SARL. Janus implements all required infrastructure to execute a MAS programmed using SARL and fulfills its requirements such as fully distributed, parallel execution of agent’s behaviors, automatic discovery of kernels, etc. Janus adopts best practices in current software development, such as Inversion of Control, and profits from new technologies like Distributed Data Structures (In-Memory Data Grid like Hazelcast). The main purpose of Janus provides a VM for SARL multiagent system, and therefore provides implementations for all Built-in Capacities.
References
- Rodriguez, S., Gaud, N., & Galland, S. (2014). SARL: a general-purpose agent-oriented programming language. In The 2014 IEEE/WIC/ACM International Conference on Intelligent Agent Technology. Warsaw, Poland: IEEE Computer Society Press.
- Galland, S., Balbo, F., Gaud, N., Rodriguez, S., Picard, G., & Boissier, O. (2015). Contextualize Agent Interactions by Combining Social and Physical Dimensions in the Environment. In Y. Demazeau & K. Decker (Eds.), 13th International Conference on Practical Applications of Agents and Multi-Agent Systems (PAAMS).
- Galland, S., Balbo, F., Gaud, N., Rodriguez, S., Picard, G., & Boissier, O. (2015). A multidimensional environment implementation for enhancing agent interaction. In R. Bordini & E. Elkind (Eds.), Autonomous Agents and Multiagent Systems (AAMAS15). Istanbul, Turkey.