2.9 AAPL Programming Model and Language 69
Plans are related to AAPL activities and transitions close to conditional trig-
gering of plans. Tables 2.1 and 2.2 at the end of this section summarize the
available language statements. Their effects on a multi-agent system is shown
in Figure 2.10. Beside the AAPL programming language there is a short nota-
tion, which has the same operational semantic, but offers a more compact
AAPL representation, which ease the understanding of more complex agent
behaviours.
The following Example2.1 poses an agent class definition with a simple
agent that has the goal to collect sensor values (ADC), finally computes the
mean value (SENSOR) of all samples. If a threshold thr is reached, an event
tuple (SENSOREV) is generated.
Instantiation: Parametrizable new agents of a specific class AC can be created
at runtime by agents using the newAC(v1,v2,..) statement returning a node
unique agent identifier. An agent can create multiple living copies of itself with
a fork mechanism, creating child agents of the same class with inherited data
and control state but with different parameter initialization, done by using the
fork(v1,v2,..) statement, eventually specifying a subclass. Agents can be
destroyed by using the kill(id) statement. Additionally, sub-classes of an
agent super class can be selected by adding the sub-class identifier.
Each agent has private data - the body variables -, defined by the var and
var* statements. Variables from the latter definition will not be inherited or
migrated! Agent body variables, the current activity, and the transition table
represent the mobile data part of the agents beliefs database.
Statements inside an activity are processed sequentially and consist of data
assignments (x := ) operating on agent’s private data, control flow state-
ments (conditional branches and loops), and special agent control and
interaction statements, which can block agent processing until an event has
occurred.
Agent interaction and synchronization is provided by the previously intro-
duced tuple-space database server available on each node (related to
[CAB95]). An agent can store an n-dimensional data tuple (v1,v2,..) in the data-
base by using the out(v1,v2,..) statement (commonly the first value is
treated as a key). A data tuple can be removed or read from the database by
using the in(v1,p2?,v3,..) or rd(v1,p2?,v3,..)
statements with a pattern
template based on a set of formal (variable,?) and actual (constant) parame-
ters. These operations block the agent processing until a matching tuple was
found/stored in the database. These simple operations solve the mutual
exclusion problem in concurrent systems easily. Only agents processed on
the same network node can exchange data in this way. Simplified the expres-
sion of beliefs of agents is strongly based on AAPL tuple database model.
S. Bosse, Unified Distributed Sensor and Environmental Information Processing with Multi-Agent Systems
epubli, ISBN 9783746752228 (2018)