hbp_nrp_simserver.server.simulation_server_lifecycle module

This module contains the simulation server implementation of the simulation lifecycle

class hbp_nrp_simserver.server.simulation_server_lifecycle.SimulationServerLifecycle(sim_server: hbp_nrp_simserver.server.simulation_server.SimulationServer, except_hook: Optional[Callable] = None)[source]

Bases: hbp_nrp_commons.simulation_lifecycle.SimulationLifecycle

Implements the simulation server lifecycle of a simulation

DEFAULT_MQTT_CLIENT_ID = 'nrp_simulation_server'
property done_event

Gets the event that represents when the simulation is done

Returns

An event that will be set as soon as the lifecycle is done

fail(state_change)[source]

Reacts on failures in the simulation

Parameters

state_change – The state change according to the failure

initialize(_state_change)[source]

Initializes the simulation

Parameters

_state_change – The state change that caused the simulation to initialize

pause(_state_change)[source]

Pauses the simulation

Parameters

_state_change – The state change that caused the pause request

propagated_destinations = ['completed', 'failed']
reset(_state_change)[source]

Resets the simulation

Parameters

_state_change

Returns

shutdown(shutdown_event)[source]

Shuts down this instance of the simulation lifecycle

Parameters

shutdown_event – The event that caused the shutdown

start(_state_change)[source]

Starts the simulation

Parameters

_state_change – The state change that caused the simulation to start

stop(_state_change)[source]

Stops the simulation and releases required resources

Parameters

_state_change – The state change that caused the simulation to stop