296 Chapter 8 Evaluation
(go-statement) to the point when the agent is restarted at the destination
server. Because of the lack of a global time in a distributed system, we cannot
simply compare time stamps originating from different computer systems.
Therefore, we always consider at least two migrations: the ﬁrst one to the
destination server and the second one back to the origin—we call this a
ping-pong migration. Therefore, printed times are never those for a single
migration but always for a complete round tr ip, which usually consists of only
two computers, but in some cases includes as many as seven computers. As
a consequence, the measured migration times not only consist of the pure
network transmission time but also the time for serializing the agent at the
sender agency and deserializing it at the receiver agency for each migration.
We also consider the time necessary to link the agent’s code, which involves
verifying and preparing class code. The process of serializing an agent takes,
according to our measurements less than 2 milliseconds (ms). The process of
deserializing the agent’s state and the linking agent’s code takes on average
between 1 and 5 ms, and is linear with respect to state size and class size.
Each agent migration is repeated between 200 and 1000 times; we only
report mean values and the 95% signiﬁcance interval. The longest 5% of the
values were dropped, because we want to disregard times lengthened by
the Java garbage-collector task.
To illustrate our results we always used line
graphs, although insomeexperiments boxcharts would havebeenthe correct
diagramming technique, because intermediate values cannot be interpo-
lated. However, in our opinion, line graphs make our results more obvious to
8.2.2 Programming Agents for the Measurements
The common behavior of the agents used in the experiments is deﬁned in
class BaseAgent in package examples.agent, which states that an agent
executes the itinerary given in a conﬁguration ﬁle and then migrates back to
its home agency.
In general there is a single agent class for each measurement. This class
extends class BaseAgent and deﬁnes special functions as necessary in the
concrete measurement, (e.g., sending data items back to the agent’s home
1. The Java garbage collector is started whenever there is not enough memory to create new objects.
Freeing memory takes between 300 and 900 ms in our experiments.