Skip to main content

Co-Simulation

Co-Simulation refers to multiple simulators working in conjunction to simulate something. Co-Simulation in Sedaro is achieved via the definition of ExternalState Blocks within a Scenario model. ExternalState Blocks are related to one or more Agent Blocks in the Scenario model and they define the external co-simulation interfaces. Interfaces can be uni- or bi-directional and support two different modes: Per-Round and Spontaneous.

Modes

In Per-Round co-simulation, the external simulator is expected to produce and/or consume state at each "round" or simulation Engine time-step. In Spontaneous co-simulation, the external simulator may produce and/or consume state at any time. This method of co-simulation is recommended for real-time simulations and is important for use-cases such as commanding a system or part of a system to a new state (i.e., human/software-in-the-loop).

Spontaneous state is timestamped and interpreted such that it impacts the simulation during the round at or immediately following the timestamp. Spontaneous state production is also unique in that it is not required to ever provide a value and can remain optionally unused during a simulation. In this case, the simulation will continue to consume the initial value for the state until a new value is provided.

Each co-simulation interface is independent meaning some may be Per Round while others are Spontaneous. This also means that individual co-simulators can consume/produce state simultaneously over different interfaces.

Blocking vs Non-Blocking

Per-Round

If simulation state depends on produced external state, the simulation will block (or wait) until this state is provided via the following PATCH endpoint. Once provided, the simulation will continue until it is blocked again. Anything that is not dependent on the external state will continue to run during the blocking period.

Spontaneous

Spontaneous external state will never block the simulation but will take effect upon arrival.