If the developer prefers to type in commands within a shell, he/she can use a set of
primitives to execute the simulation.
To load an agent from a file, load(File_name, Agent_name) can be used.
initialize(List_of_initial_messages) is used to initialize the agents'
mail-boxes.
global_parameters(Iter, Min_time_unit, Out, Verbose) sets the global simulation
parameters. Iter is the
number of iterations the simulator will perform, expressed in the unit Min_time_unit.
Out is the name of the file where all exchanged messages will be collected, and
Verbose is a flag setting whether the messages have to be visualized on
the monitor or not, during the simulation run.
net_parameters(From_ag, To_ag, Failure_rate,
Min_latency, Max_latency,
Unit) allows to define, for any couple of
interacting agents, the failure rate and the minimum and maximum latency
of the communication channel.
Failure_rate sets how many messages, on 100.000.000, are lost due to communication
problems.
Min_latency and Max_latency are the minimum and maximum values, expressed in
Unit, of the delay over the communication channel.
If, for a couple of communicating agents, net_parameters is not defined,
the channel between them is assumed to be without delay and completely reliable.
start_simulation starts the execution of the prototype built during
the loading stage, respecting the parameters described above.
The time-driven simulation starts, with a round-robin scheduler which activates in turn all
the agents in the system, allowing them to call their cycle predicate.
Finally, after the simulation execution has stopped,
the primitive get_statistics can be used to collect information on it.
It allows setting the start time, the end time and the length of intervals in which
the simulation period is divided, as well as the ``weights'' (representing
number of bytes, importance, ...) assigned to the monitored messages.
The file where statistics are collected contains, for any simulation interval,
the number of messages received in that interval and the sum of their weights.
The total number of exchanged message, the maximum and average number of messages
per interval, the maximum and average weight per interval, and the weight standard
deviation are also provided.
This information proves useful to evaluate the communication channels occupation,
which is of fundamental importance in those applications where the communication
bandwidth is limited.