.. index:: pair: page; Event Loop Schema .. _doxid-event_loop_schema: Event Loop Schema ================= The Event Loop implements asynchronous interaction between simulations in NRP-core. It can be used in NRP-core experiments as an alternative to the default :ref:`FTILoop `. Additional information can be found in this :ref:`page `. In order to use it in an experiment the "SimulationLoop" parameter must be set to "EventLoop" in the experiment configuration file. Below is a list of all the parameters needed to configure the :ref:`EventLoop `. .. _doxid-event_loop_schema_1event_loop_schema_parameters: Parameters ~~~~~~~~~~ ===================== ==================================================================================================================================================================== ======= ========== ======== ===== ========================== Name Description Type Default Required Array Values ===================== ==================================================================================================================================================================== ======= ========== ======== ===== ========================== ExecutionMode enum "AllNodes" "AllNodes", "OutputDriven" Timeout Event loop timeout (in seconds). 0 means no timeout integer 0 Timestep Time in seconds the event loop advances in each loop number 0.01 TimestepWarnThreshold Threshold (in seconds) above which a warning message is printed at runtime everytime the Event Loop can't run at the frequency specified in the "Timestep" parameter number 0.001 ===================== ==================================================================================================================================================================== ======= ========== ======== ===== ========================== .. _doxid-event_loop_schema_1event_loop_schema_example: Example ~~~~~~~ .. ref-code-block:: cpp { "ExecutionMode": "OutputDriven", "Timeout": 10, "Timestep": 0.02, "TimestepWarnThreshold": 0.002 } .. _doxid-event_loop_schema_1event_loop_schema_schema: Schema ~~~~~~ .. ref-code-block:: cpp { "$schema": "http://json-schema.org/draft-07/schema#", "title": "EventLoop", "description": "Event Loop configuration parameters", "$id": "#EventLoop", "type": "object", "properties" : { "ExecutionMode": { "type": "string", "enum": ["AllNodes", "OutputDriven"], "default": "AllNodes", "description": "Execution Mode that will be used when running the Event Loop" }, "Timeout" : { "type" : "number", "default": 0, "description": "Event loop timeout (in seconds). 0 means no timeout" }, "Timestep" : { "type" : "number", "default": 0.01, "description": "Time length (in seconds) of each loop, i.e it is the inverse of the Event Loop frequency" }, "TimestepWarnThreshold": { "type" : "number", "default": 0.001, "description": "Threshold (in seconds) above which a warning message is printed at runtime everytime the Event Loop can't run at the frequency specified in the \"Timestep\" parameter" } } }