|
bitsim
Model, simulate, estimate and control robots in C++
|
How the participants of a distributed simulation reach each other: everything one publishes, every other receives. More...
#include <transport.h>


Public Member Functions | |
| virtual | ~Transport ()=default |
| virtual void | publish (const std::string &bytes)=0 |
| Send bytes to every other participant. | |
| virtual std::optional< std::string > | receive (std::chrono::milliseconds timeout)=0 |
| The next message from another participant, waiting at most timeout. | |
How the participants of a distributed simulation reach each other: everything one publishes, every other receives.
The messages are bytes; the synchroniser sends StateMessage::encode(). A transport may lose messages, MQTT does when nobody listens yet, and it may give a participant its own messages back, MQTT does that too; Synchroniser copes with both. Implementations: InProcessBus, for participants that are threads of one process, MQTT_Transport, for processes on one or several machines, and LossyTransport, which adds delay and losses to another transport for testing.
|
virtualdefault |
|
pure virtual |
Send bytes to every other participant.
Implemented in bitsim::distributed::InProcessBus::Endpoint, bitsim::distributed::LossyTransport, bitsim::distributed::MQTT_Transport, distributed_independent_learners::InProcessBus::Endpoint, and distributed_robot_navigation::InProcessBus::Endpoint.
|
pure virtual |
The next message from another participant, waiting at most timeout.
Implemented in bitsim::distributed::InProcessBus::Endpoint, bitsim::distributed::LossyTransport, bitsim::distributed::MQTT_Transport, distributed_independent_learners::InProcessBus::Endpoint, and distributed_robot_navigation::InProcessBus::Endpoint.