hbp_nrp_simserver.server package¶
This is package contains the Simulation server. It runs user-defined python scripts that use an nrp_client.NRPCore.
A simulation server can be managed by an instance of SimulationServerInstance and once initialized it sends,
on MQTT topics, information about its status (/status) and, on error, a message describing such error (/runtime_error).
The runtime state of the server is controlled via an instance of SimulationLifecycle that reacts to state changes initiated by the user via the REST API exposed by hbp_nrp_backend.server. Besides those, state changes initiated by the Simulation server are the ones that depend on the simulation being run, i.e. ‘completed’ and ‘failed’.
-
class
hbp_nrp_simserver.server.ServerProcessExitCodes(value)[source]¶ Bases:
enum.IntEnumExit error codes for simulation_server.py
-
INITIALIZATION_ERROR= 1¶
-
NO_ERROR= 0¶
-
RUNNING_ERROR= 3¶
-
SHUTDOWN_ERROR= 2¶
-
-
class
hbp_nrp_simserver.server.SimulationSettings(sim_id: str, sim_dir: str, exp_config_file: str, main_script_file: str)[source]¶ Bases:
objectsim_id: the ID of the simulation sim_dir: the directory containing the simulation files exp_config_file: the experiment configuration file name (e.g. experiment_configuration.json) main_script_file: the simulation’s main script file name (e.g. main_script.py)
-
exp_config_file: str¶
-
main_script_file: str¶
-
sim_dir: str¶
-
sim_id: str¶
-
-
hbp_nrp_simserver.server.TOPIC_ERROR(sim_id)¶
-
hbp_nrp_simserver.server.TOPIC_LIFECYCLE(sim_id)¶
-
hbp_nrp_simserver.server.TOPIC_STATUS(sim_id)¶
Submodules¶
- hbp_nrp_simserver.server.experiment_configuration module
- hbp_nrp_simserver.server.mqtt_notifier module
- hbp_nrp_simserver.server.nrp_core_wrapper module
- hbp_nrp_simserver.server.nrp_script_runner module
- hbp_nrp_simserver.server.simulation_server module
- hbp_nrp_simserver.server.simulation_server_instance module
- hbp_nrp_simserver.server.simulation_server_lifecycle module