|
|
|
|
|
## Configure the simulation
|
|
|
|
|
|
The simulator uses a **Properties** concept to be configurable.
|
|
|
|
|
|
All the data in the simulator that is meant to be changeable by the user is separated in its own class.
|
|
|
For example the [Vehicle](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/simulation/-/blob/master/vehicle/src/main/java/de/rwth/montisim/simulation/vehicle/Vehicle.java) class, which represents an instanced vehicle in the simulation, refers to a [VehicleProperties](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/simulation/-/blob/master/vehicle/src/main/java/de/rwth/montisim/simulation/vehicle/VehicleProperties.java) class to store all the configurable entries.
|
|
|
|
|
|
## Uniqueness
|
|
|
|
|
|
The properties data is not duplicated, so in the `Vehicle` example any data that is associated to the vehicle but is also configurable is located in the `VehicleProperties` class and not the `Vehicle` class itself.
|
|
|
|
|
|
## Structure
|
|
|
|
|
|
The properties of different simulation object (and simulation modules) is structured in the same way that the instanced simulation objects are structured.
|
|
|
This forms a tree that with at its root the [SimulationConfig](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/simulation/-/blob/master/simulator/src/main/java/de/rwth/montisim/simulation/simulator/SimulationConfig.java) class.
|
|
|
|
|
|
This structure can be seen in the [Structure Overview graphic](/dev-docs/Structure-Overview). The *properties* classes are highlighted in orange. As can be seen they follow the same structure as the internal simulator objects.
|
|
|
|
|
|
## Used to create simulations
|
|
|
|
|
|
Every element of the property tree (the `...Properties` classes or `SimulationConfig`) contains a function to instantiate the corresponding simulation object.
|
|
|
This is then called recursively on the children of every property class to create the entire simulation.
|
|
|
|
|
|
## Direct mapping to JSON
|
|
|
|
|
|
The advantage of this separation is that the entire properties structure can be directly loaded from JSON using the [Json system](/dev-docs/commons/Json-Serializer).
|
|
|
By creating a JSON file that exactly reflects this structure, entire simulation scenarios can be specified. (As explained in [Simulation Configuration](/user-docs/json-scenario-reference/Simulation-Configuration) and the following pages.) |