System Controller

Warning

The System Controller is experimental and might be changed or removed in future versions of the SIL Kit.

Note

The SIL Kit provides a utility called sil-kit-system-controller, that provides a command line interface to define the required participant names of a simulation. In most cases this utility can be used and no own implementation is needed.

Create a System Controller

The System Controller needs a valid participant instance to be created via CreateSystemController().

auto participant = SilKit::CreateParticipant(configuration, participantName, connectUri);
systemController = SilKit::Experimental::Participant::CreateSystemController(participant);

Set the required participants

In the SIL Kit, required participants are a set of user defined participants that are needed for the current simulation setup to function correctly. These participants are used to calculate the system state (see System States), which is used by coordinated participants (see Configuring Lifecycle) for their state transitions.

To define the required participants, SetWorkflowConfiguration() must be called with a WorkflowConfiguration containing the set of required participants names within the simulation.

Abort the simulation

With AbortSimulation(), all participants with a lifecycle will be aborted. This means that their lifecycle will terminate and call the abort handler (see Using Lifecycle).

API and Data Type Reference

System Controller API

class ISystemController

SystemController interface for configuration of the simulation flow and system-wide commands.

Public Functions

virtual ~ISystemController() = default
virtual void AbortSimulation() const = 0

Sends a SilKit::Services::Orchestration::SystemCommand::Kind::AbortSimulation to all participants.

The abort simulation command signals all participants to terminate their lifecycle, regardless of their current state.

The command is allowed at any time.

virtual void SetWorkflowConfiguration(const SilKit::Services::Orchestration::WorkflowConfiguration &workflowConfiguration) = 0

Configures details of the simulation workflow regarding lifecycle and participant coordination.

Only the required participant defined in the SilKit::Services::Orchestration::WorkflowConfiguration are taken into account to define the system state. Further, the simulation time propagation also relies on the required participants. The SilKit::Services::Orchestration::WorkflowConfiguration is distributed to other participants, so it must only be set once by a single member of the simulation.

Parameters

workflowConfiguration – The desired configuration, currently containing a list of required participants