# hbp_nrp_cleserver.server.SimulationServerLifecycle module¶

This module contains the simulation server implementation of the simulation lifecycle

class SimulationServerLifecycle(sim_id, cle, server, except_hook=None)[source]

Implements the simulation server lifecycle of a simulation

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

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