The JAS-mine platform‎ > ‎Documentation‎ > ‎Focus‎ > ‎

Model-Collector-Observer

The Swarm protocol for agent-based platforms architecture recommends splitting the simulation into an internal Model and an external Observer. These two aspects of the artificial world should remain markedly separate.

The purpose of the Observer is inspecting the model’s objects. Through the Observer the state of simulation can be monitored and graphically represented in real time, while the simulation is running. However, for the purpose of analysis and validation, the Observer alone may not be adequate, because it implies the need to define in advance the aggregations on which to analyze the simulation outcome. A variation in perspective requires re-running the experiment.

According to a different approach, the simulation is aimed exclusively at producing numerical outputs which can be analyzed in depth ex-post using ad-hoc statistical-econometric tools.

JAS-mine combines these two different approaches extending the Model-Observer paradigm so as to include an intermediate structure that calculates statistical values and persists simulation modeling outputs in the database in the most transparent way, minimizing the impact on model implementation. In the JAS-mine architecture agents are organized and managed by components called managers. There are three types of managers: Model, Collector and Observer.
  • The Model deals mainly with specification issues, creating objects, relations between objects, and defining the order of events that take place in the simulation.
  • The Collector collects the data and compute the statistics both for use by the simulation objects and for post-mortem analysis of the model outcome, after the simulation has completed.
  • The Observer allows the user to inspect the simulation in real time and monitor some pre-defined outcome variables as the simulation unfolds.
This three-layer methodological protocol allows for extensive re-use of code and facilitates model building, debugging and communication.

JAS-mine allows multiple Models (and multiple Collectors and Observers) to run simultaneously, since they share the same scheduler (known as a singleton). This allows for the creation of complex structures where agents of different Models can interact. Each Model is implemented in a separate Java class that creates the objects and plans the schedule of events for that Model. Model classes require the implementation of the SimulationManager interface, which implies the specification of a buildObjects() method to build objects and agents, and a buildSchedule() method for planning the simulation events. Analogously, Collector classes must implement the CollectorManager interface, and Observer classes must implement the ObserverManager interface.