.. index:: pair: class; client::NrpCore .. _doxid-classclient_1_1_nrp_core: class client::NrpCore ===================== .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block class NrpCore { public: // fields :target:`proto_modules`; :target:`proto_message_classes`; // methods None :ref:`__init__`( self self, address address, experiment_folder experiment_folder = "", config_file config_file = "simulation_config.json", args args = "", log_output log_output = True, server_timeout server_timeout = 10 ); None :ref:`__del__`(self self); def :target:`current_state`(self self); def :ref:`initialize`(self self); def :ref:`run_loop`( self self, num_iterations num_iterations, run_async run_async = False ); def :ref:`run_until_timeout`(self self, run_async run_async = False); def :ref:`stop`(self self); def :ref:`reset`(self self); def :ref:`shutdown`(self self); None :ref:`set_proto_datapack`( self self, str datapack_name, str engine_name, payload payload ); None :ref:`set_json_datapack`( self self, str datapack_name, str engine_name, dict payload ); }; .. _details-classclient_1_1_nrp_core: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; __init__ .. _doxid-classclient_1_1_nrp_core_1a0d9573386ec0c8bf984f44f0cd8d7b95: .. ref-code-block:: cpp :class: doxyrest-title-code-block None __init__( self self, address address, experiment_folder experiment_folder = "", config_file config_file = "simulation_config.json", args args = "", log_output log_output = True, server_timeout server_timeout = 10 ) .. code-block:: cpp Spawns an NRPCoreSim process in server mode and connects to it :param str address: the address that will be used by NRPCoreSim server :param str experiment_folder: path to the folder containing all files needed to execute the experiment. By default, is an empty string, which is interpreted as the current folder. :param str config_file: path to the experiment configuration file. It can be an absolute path or relative to `experiment_folder`. By default, "simulation_config.json" :param str args: additional NRPCoreSim command line parameters :param bool log_output: if True, console output from NRPCoreSim process is hidden and logged into a file named .console_output.log in the experiment folder. Default is True. :param int server_timeout: time in seconds for waiting for connection with the NRPCoreSim grpc server. 10 seconds by default. :param str docker_daemon_address: IP address of the docker daemon used to launch the experiment in a docker container (more detail below). 'unix:///var/run/docker.sock' by default. :param str image_name: name of the docker image which will be used to run the experiment (more detail below). Empty by default. :param list get_archives: list of archives (files or folders) that should be retrieved from the docker container when shutting down the simulation (e.g. folder containing logged simulation data) .. index:: pair: function; __del__ .. _doxid-classclient_1_1_nrp_core_1ac65027984997ca1f4d4ceca8d3a7d7ec: .. ref-code-block:: cpp :class: doxyrest-title-code-block None __del__(self self) .. code-block:: cpp Deletes the NRP Core objects and kills the server .. index:: pair: function; initialize .. _doxid-classclient_1_1_nrp_core_1abc683d9f01251ab75ea0cdca4333ad90: .. ref-code-block:: cpp :class: doxyrest-title-code-block def initialize(self self) .. code-block:: cpp Calls the initialize() RPC of the NRP Core Server .. index:: pair: function; run_loop .. _doxid-classclient_1_1_nrp_core_1af1c0e94c5e28574fb4542950b03334b5: .. ref-code-block:: cpp :class: doxyrest-title-code-block def run_loop( self self, num_iterations num_iterations, run_async run_async = False ) .. code-block:: cpp Calls the runLoop() RPC of the NRP Core Server .. index:: pair: function; run_until_timeout .. _doxid-classclient_1_1_nrp_core_1a5e2ae279cb38b9c99c0848c5e5056427: .. ref-code-block:: cpp :class: doxyrest-title-code-block def run_until_timeout(self self, run_async run_async = False) .. code-block:: cpp Calls the runUntilTimeout() RPC of the NRP Core Server .. index:: pair: function; stop .. _doxid-classclient_1_1_nrp_core_1a2270f1a632db530c7b959067eccaf908: .. ref-code-block:: cpp :class: doxyrest-title-code-block def stop(self self) .. code-block:: cpp Calls the stopLoop() RPC of the NRP Core Server .. index:: pair: function; reset .. _doxid-classclient_1_1_nrp_core_1a53b0ca779b39f42ccf8979184ba237ab: .. ref-code-block:: cpp :class: doxyrest-title-code-block def reset(self self) .. code-block:: cpp Calls the reset() RPC of the NRP Core Server .. index:: pair: function; shutdown .. _doxid-classclient_1_1_nrp_core_1ad6242cde28c938c089ccdf909d318bc1: .. ref-code-block:: cpp :class: doxyrest-title-code-block def shutdown(self self) .. code-block:: cpp Calls the shutdown() RPC of the NRP Core Server .. index:: pair: function; set_proto_datapack .. _doxid-classclient_1_1_nrp_core_1a185443985e16cf93750967eb97703b95: .. ref-code-block:: cpp :class: doxyrest-title-code-block None set_proto_datapack( self self, str datapack_name, str engine_name, payload payload ) .. code-block:: cpp Prepares a DataPack that will be sent to NRP Core (and later to an engine) on the next call to run_loop(). :param str datapack_name: Name of the DataPack :param str engine_name: Name of the engine to which the DataPack will be passed :param protobuf.Any payload: Payload of the DataPack, a protobuf message .. index:: pair: function; set_json_datapack .. _doxid-classclient_1_1_nrp_core_1a2acfeb7321172ff122644263cf32d9d6: .. ref-code-block:: cpp :class: doxyrest-title-code-block None set_json_datapack( self self, str datapack_name, str engine_name, dict payload ) .. code-block:: cpp Prepares a DataPack that will be sent to NRP Core (and later to an engine) on the next call to run_loop(). :param str datapack_name: Name of the DataPack :param str engine_name: Name of the engine to which the DataPack will be passed :param protobuf.Any payload: Payload of the DataPack, a protobuf message