Event LoopΒΆ
The Event Loop implements asynchronous interaction between simulations in NRP-core. It processes incoming events from external processes and sends out others in response. The events accepted or sent by the Event Loop are always data messages in any of the supported communication protocols (eg. ROS messages). In contrast with the FTILoop, the Event Loop allows to connect simulations or other processes asynchronously through this event processing mechanism.
In order to process and send out events, the Event Loop uses a graph structure, the Computational Graph, which nodes are computational units which receive, process and send events. The edges in the graph represent connections between these nodes through which events can be exchanged. Edges are directed, meaning that a given connection allows to send events in only one direction.
The sole function of the Event Loop is to run a Computational Graph at a fixed frequency. The nodes in the graph are executed in a specific order which ensures that each of them performs their computations on the latest available data. By instantiating and connecting nodes, users can specify which events the Event Loop should react to, how they should be processed and which events should be sent out in response.
The next pages describe in more detail the elements and function of the Event Loop and the Computational Graph and how they can be used in NRP-core experiments:
Computational Graph : this page offers a description, with implementation details, of all elements and components involved in the Computational Graph.
Instantiating a Computational Graph in Python : this page describes how to define Computational Graphs in Python.
Event Loop configuration in experiments : this page describes how to configure NRP-core experiments to use the Event Loop and the Computational Graph.
Several example experiments using the Event Loop and the Computational Graph are available in the examples/event_loop_examples
folder.
Related Pages: