Adding New Simulation Types

Avrora is not simply a single node simulator, nor just a simulator for sensor networks, but it supports multiple different types of simulations. It is natural then that it has an extension point that allows users to create a new simulation type. Adding a new simulation type is the natural way to add simulations that have, for example, connections between multiple microcontrollers, or have a built-in environment model. For more information on how to add a simulation type, see this page.

Avrora's simulator accepts the -simulation option that specifies the type of simulation to perform. That simulation type determines how many nodes are in the simulation and how they are connected to each other. For example, the single (which is the default) simulation type accepts only one node to simulate, but the sensor-network simulation type allows multiple nodes to be instantiated that can communicate with each other through a shared radio medium. A multiple-microcontroller hardware device such as a robot might have its own simulation type where the microcontroller instances are connected through physical pins.

The avrora.sim.Simulation class represents a simulation type, and users can extend this class and override its base functionality. The -simulation option can accept the fully qualified name of the user's class representing a new simulation type. The user's class can override the functionality for creating nodes and synchronizing them.