Class SimulationStarter
This class is the entry point of the simulation
Use the static factory method
Mars.Components.Starter.SimulationStarter.Start(Mars.Components.Starter.CommandArgumentContainer,Mars.Interfaces.Model.SimulationConfig)
to create a new simulation application and to interact with it.
Inheritance
IDisposable
SimulationStarter
Assembly: Mars.Components.dll
Syntax
public class SimulationStarter : IDisposable
Methods
Build(ModelDescription, SimulationConfig)
Prepares a simulation infrastructure to start the preparation and simulation
interaction, controlled by the returning
ISimulation interface.
The build expects the
ModelDescription with all entity types to simulate and the
SimulationConfig initialization data and global configurations
e.g. the amount of steps and steps size.
The returning
ISimulation interface represents the endpoint to control
the whole simulation execution.
Declaration
public static ISimulation Build(ModelDescription description, SimulationConfig config)
Parameters
Type |
Name |
Description |
ModelDescription |
description |
Static type description with all entity types to simulate. |
SimulationConfig |
config |
The global and type specific inputConfiguration object with all input data references for the
types.
|
Returns
Type |
Description |
ISimulation |
The root ISimulation endpoint to prepare, start and control the simulation execution. |
Build(ModelDescription, String[])
Declaration
public static ISimulation Build(ModelDescription description, params string[] args)
Parameters
Type |
Name |
Description |
ModelDescription |
description |
Static type description with all entity types to simulate. |
System.String[] |
args |
The argument list for the simulation execution. |
Returns
BuildApplication(ModelDescription, SimulationConfig)
Constructs the whole simulation application together and pass the optional
ModelDescription and
SimulationConfig to the components. When nothing was passed the extra
PrepareSimulation step have to performed.
Declaration
public static ISimulationContainer BuildApplication(ModelDescription description = null, SimulationConfig config = null)
Parameters
Type |
Name |
Description |
ModelDescription |
description |
The static model description or null |
SimulationConfig |
config |
The init startup inputConfiguration for the execution. |
Returns
BuildApplication(ModelDescription, String[])
Declaration
public static ISimulationContainer BuildApplication(ModelDescription description, string[] args)
Parameters
Type |
Name |
Description |
ModelDescription |
description |
The static model description or null |
System.String[] |
args |
All command line arguments. |
Returns
Type |
Description |
ISimulationContainer |
Returns a new application container able to resolve each component and service in the system.
|
Dispose()
Release all acquired resources of the simulation and closes all
in/output connections of this simulation application.
Declaration
Run()
Starts the simulation execution
Declaration
public SimulationWorkflowState Run()
Returns
Start(ModelDescription, SimulationConfig)
Declaration
public static SimulationStarter Start(ModelDescription description, SimulationConfig config)
Parameters
Type |
Name |
Description |
ModelDescription |
description |
The model describing all layer and agent types. |
SimulationConfig |
config |
The deserialized simulation config with configured simulation steps, inputs and outputs |
Returns
Exceptions
Start(ModelDescription, String[])
Stars a simulation with the specified simulation inputConfiguration arguments
args
for the
registered
model
description
. This creates a
SimulationStarter handle which
has created the internal simulation application and can be started directly. In order to interact
with the simulation please use the
BuildApplication(ModelDescription, SimulationConfig)
function instead and resolve the
ISimulation component.
Declaration
public static SimulationStarter Start(ModelDescription description, params string[] args)
Parameters
Type |
Name |
Description |
ModelDescription |
description |
The model describing all layer and agent types. |
System.String[] |
args |
Arguments for the simulation config in order to use the simulation starter with the command line
interface.
|
Returns
Exceptions