Information Technology Reference
In-Depth Information
beginning of a simulation. Each agent will relay the received StartEvent
to all of its sensors and effectors susceptible for this kind of event.
Depending on the actual behavior implemented in the agents, they
will start living .
The variable now always holds the current simulation time and is
advanced to the point in time of the next event each time the simula-
tion loop is executed. After updating the variable currentEvents to
contain all simulator events which occur at the current point in time,
the events are processed in the following order: First, successfully
finished actions are executed. Secondly, the events are processed; both
the events which influence only the environment (type (1)) and those
which directly influence agents (type (2)). Finally, actions which start
at the current point in time are processed.
The constraints are checked when an environmental event occurs
and at the beginning of an action. As these are the two only points
when an action may either fail (due to a modified environment) or
interfere with another action, it is sucient to evaluate constraints at
these points in time.
9.3.2 Single-threaded time-stepped simulation engine
This section describes briefly the implementation of a second sim-
ulation engine which realizes a time-stepped execution. The time
increment per step may be chosen arbitrarily as long as it is sucient
small, i. e., at least small enough to schedule all simulator events.
As expected, Algorithm 3 is very much the same as Algorithm 2.
Actually, the main difference is that simulation time progresses just a
small amount Δ in each simulation cycle. The processing of actions
and events as well as checking of constraints is handled completely
the same way in both simulation engines.
Unlike the event-driven simulation engine, the time-stepped sim-
ulation engine may compute changes in the environment (e.g., by
environmental update functions) or the embedding (e. g., movement
of an agent) in each step. This may help to avoid typical artifacts of
Search WWH ::




Custom Search