(e.g. changing variable values). The messages are
consumed according to their priority first and then in
FIFO order.
Communication constructs specify how informa-
tion can be exchanged between agents. These con-
structs specify that communication takes place either
by (1) exchanging messages through communication
channels or (2) accessing global variables. If channel-
based communication is used, channels have to be
specified between agents including the types of mes-
sages to be exchanged in them. If on the other hand
variable-based communication is used, agents have
to protect concurrent access to global variables by
semaphores.
3.1.2 Instance-oriented and Type-oriented
Modeling
At the language level presented so far, each agent
models a set of agent instances (1 instance by default).
This style of modeling could be named instance-
oriented modeling because agent definitions may only
be used in the context where they are defined.
Reusing agent definitions is only possible by us-
ing type-oriented modeling. Here the modeler spec-
ifies agents as agent types and places them in pack-
ages from where they may be used in different agent
contexts. The usage of an agent type represents an
instantiation of the type in the context. Communica-
tion can be described in a context-independent way
by using gates. They serve as communication end
points where channels can be connected to at instan-
tiation time. Agent instances may be given a name
and an initial number of instances to be created. Ad-
ditional instances may be created dynamically by pro-
cess agents.
3.1.3 Object-oriented Modeling
Object-oriented modeling is only supported for pro-
cess agents with single inheritance relations between
them. Variables, procedures, and state machines can
be inherited from a base process agent through spe-
cialization. In specialized agents, transitions may be
added or they may overload existing ones. Also base
agents may specify abstract transitions that have to be
made concrete in specializations.
3.2 UML and C++
SDL-RT contains a subset of UML that is used for
object-oriented modeling of data structures and sys-
tem deployment. A subset of UML class diagrams
can be used for modeling data structures. The subset
includes classes (with attributes and operations), asso-
ciations (as aggregation or composition and with uni
or bidirectional relation), and class generalizations.
C++ is used for declaring data types and for spec-
ifying transition actions in state machines. Data types
have to be declared for variables, procedure param-
eters, and message parameters. Here any valid C++
type declaration may be used. Actions are also speci-
fied with C++. This allows an efficient execution and
opens the possibility to easily interface with existing
C or C++ libraries.
4 APPLICATION EXAMPLE
Earthquakes produce different types of seismic
waves: (1) P-waves and S-waves (called body waves);
(2) Rayleigh waves and Love waves (called surface
waves). P-waves (primary waves) travel faster than S-
waves (secondary waves)
1
. They are less destructive
than the S-waves and surface waves that follow them.
Earthquake early warning is based on the detection
of the harmless P-waves that precede the slower and
destructive S-waves and surface waves.
Our application example consists in the devel-
opment of an earthquake early warning application
(Alarming Protocol) (Fischer et al., 2009). The
Alarming Protocol (AP) runs on top of SOSEWIN
2
(Fleming et al., 2009), which is a decentralized WSN-
based earthquake early warning system. The AP is
a hierarchical alarming system, where the network is
composed of node clusters. The organization of the
network into clusters and the designation of corre-
sponding cluster heads is done at installation time, but
can change dynamically following the changes in the
topology.
The functional aspects of the Alarming Protocol
are described in SDL-RT (Figure 2).
4.1 The Alarming Protocol
As Figure 2 shows, the Alarming Protocol (AP) is
modeled as a set of asynchronous communicating
protocol entities:
• Signal Analyzing Entity (SAE).
The SAE analyzes the incoming streams of data
and informs the SE in case of a detected event.
• Sensing Entity (SE).
The SE reacts on the results received from the
SAE by informing its associated Leading Entity
1
P-waves travel at 5-8 km/s, and S-waves at 3-7 km/s.
2
Self-Organizing Seismic Early Warning Information
Network.
MODELING REAL-TIME APPLICATIONS FOR WIRELESS SENSOR NETWORKS USING STANDARDIZED
TECHNIQUES
163