hbp_nrp_backend.simulation_control.backend_simulation_lifecycle module

This module contains the implementation of the backend simulation lifecycle

class hbp_nrp_backend.simulation_control.backend_simulation_lifecycle.BackendSimulationLifecycle(simulation: hbp_nrp_backend.simulation_control.simulation.Simulation, initial_state: str = 'created')[source]

Bases: hbp_nrp_commons.simulation_lifecycle.SimulationLifecycle

This class implements the backend simulation lifecycle

DEFAULT_MQTT_CLIENT_ID = 'nrp_backend'
property experiment_path

Gets the experiment_path

Returns

The experiment_path

fail(state_change)[source]

Fails the simulation

Parameters

state_change – The state change which resulted in failing the simulation

initialize(_state_change) → None[source]

Initializes the simulation

Parameters

_state_change – The state change that caused the simulation to be initialized

pause(_state_change)[source]

Pauses the simulation

Parameters

_state_change – The state change that paused the simulation

propagated_destinations = ['created', 'paused', 'started', 'completed']
reset(_state_change)[source]

Resets the simulation

Parameters

_state_change – The state change that led to resetting the simulation

property sim_dir

Gets the simulation root folder

Returns

The _sim_dir

property simulation
Returns

the simulation controlled by this lifecycle

start(_state_change)[source]

Starts the simulation

Parameters

_state_change – The state change that led to starting the simulation

stop(_state_change)[source]

Stops the simulation: - uploads logs to storage - cleans the simulation directory up