$darkmode
Public Member Functions | |
| NopSimulator (const std::string &name, const NopSimulatorConfiguration &c) | |
| void | connect () override |
| void | reset () override |
| void | abort () override |
| void | enroll (Registrar &r) override |
| size_t | num_vehicles () const override |
| std::shared_ptr< Vehicle > | get_vehicle (size_t i) const override |
| std::shared_ptr< Vehicle > | get_vehicle (const std::string &key) const override |
| Duration | process (const Sync &sync) override |
Public Member Functions inherited from cloe::Model | |
| virtual | ~Model () noexcept=default |
| virtual Duration | resolution () const |
| virtual bool | is_connected () const |
| virtual bool | is_operational () const |
| virtual void | disconnect () |
| virtual void | start (const Sync &) |
| virtual void | pause (const Sync &) |
| virtual void | resume (const Sync &) |
| virtual void | stop (const Sync &) |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
Public Member Functions inherited from cloe::Entity | |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
| const std::string & | name () const |
| void | set_name (std::string name) |
| const std::string & | description () const |
| void | set_description (std::string desc) |
Friends | |
| void | to_json (Json &j, const NopSimulator &b) |
Additional Inherited Members | |
Protected Member Functions inherited from cloe::Entity | |
| virtual Logger | logger () const |
Protected Attributes inherited from cloe::Model | |
| bool | connected_ {false} |
| bool | operational_ {false} |
Protected Attributes inherited from cloe::Entity | |
| std::string | name_ |
| std::string | desc_ |
|
inlineoverridevirtual |
Signal an abort to model processing.
This method is called asynchronously. It is highly recommended to make use of a std::atomic_bool for purposes of making the abortion request known to other parts of the model. This method is called when the user requests the simulation to be aborted, e.g., by sending the SIGINT signal.
An abort will be followed by a stop if the simulation was started.
The default implementation will throw an error. This will be caught and possibly ignored. Otherwise, the simulation will be killed.
Reimplemented from cloe::Model.
|
inlineoverridevirtual |
Initiate a connection to the model, including any initialization.
After a successful connection, the following methods shall be callable:
When implementing this method, e.g. via override or final, make sure to call this method:
void MySuperModel::connect() final { // Your connection code Model::connect(); }
Reimplemented from cloe::Model.
|
inlineoverridevirtual |
Register any events, actions, or handlers with the registrar.
Reimplemented from cloe::Model.
|
inlineoverridevirtual |
Return a pointer to a Vehicle.
Implements cloe::Simulator.
|
inlineoverridevirtual |
Return a pointer to a Vehicle.
Implements cloe::Simulator.
|
inlineoverridevirtual |
Return the number of vehicles that the simulator binding has access to.
Implements cloe::Simulator.
Send vehicle actuations to the simulator and retrieve the new world state.
Implements cloe::Simulator.
|
inlineoverridevirtual |
Reset the model state.
This is called when Cloe is asked to reset the whole simulation to time 0. This can be the case when the simulator or a controller asks us to recover from a temporary problem without repeating the whole simulation setup.
The default implementation will raise an error. So if your model is not able to re-initialize, the simulation will be aborted.
Reimplemented from cloe::Model.