$darkmode
cloe::controller::basic::BasicController Class Reference
Inheritance diagram for cloe::controller::basic::BasicController:
Collaboration diagram for cloe::controller::basic::BasicController:

Public Member Functions

 BasicController (const std::string &name, const BasicConfiguration &c)
 
void abort () override
 
void enroll (Registrar &r) override
 
void set_vehicle (std::shared_ptr< cloe::Vehicle > v) override
 
Duration process (const Sync &sync) override
 
- Public Member Functions inherited from cloe::Controller
virtual bool has_vehicle () const
 
virtual std::shared_ptr< Vehicleget_vehicle () const
 
virtual void set_vehicle (std::shared_ptr< Vehicle > v)
 
- 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 connect ()
 
virtual void disconnect ()
 
virtual void start (const Sync &)
 
virtual void pause (const Sync &)
 
virtual void resume (const Sync &)
 
virtual void stop (const Sync &)
 
virtual void reset ()
 
 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)
 

Protected Attributes

AdaptiveCruiseControl acc_
 
AutoEmergencyBraking aeb_
 
LaneKeepingAssistant lka_
 
std::string driver_request_
 
utility::ContactMap< Durationhmi_
 
- Protected Attributes inherited from cloe::Controller
std::shared_ptr< Vehicleveh_ {nullptr}
 
- Protected Attributes inherited from cloe::Model
bool connected_ {false}
 
bool operational_ {false}
 
- Protected Attributes inherited from cloe::Entity
std::string name_
 
std::string desc_
 

Friends

void to_json (Json &j, const BasicController &c)
 

Additional Inherited Members

- Protected Member Functions inherited from cloe::Entity
virtual Logger logger () const
 

Member Function Documentation

◆ abort()

void cloe::controller::basic::BasicController::abort ( )
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.

See also
cloe/core/abort.hpp

Reimplemented from cloe::Model.

◆ enroll()

void cloe::controller::basic::BasicController::enroll ( Registrar )
inlineoverridevirtual

Register any events, actions, or handlers with the registrar.

  • This may exhibit different behavior when called in a disconnected state, in order to provide the possibility for verification of triggers in offline mode.
  • It may throw an exception.

Reimplemented from cloe::Model.

Here is the call graph for this function:

◆ process()

Duration cloe::controller::basic::BasicController::process ( const Sync )
inlineoverridevirtual

Perform model processing given the simulation context.

In particular, the model may read and write information from and to data it has, in particular any vehicles.

  • Method is_operational() should return true.
  • It may throw an exception. Those derived from ModelError are more likely to be correctly handled, however. The simulation may handle it by a) removing or replacing the model, b) stopping the simulation, or c) ignoring the exception. In the last case, this method will be called again in the next simulation step. In any case, assume that the simulation will print a message to the logs or the console.
  • It should return the current simulation duration from the model's time domain, which is expected to be less or equal to sync.time().

Implements cloe::Model.

Here is the call graph for this function:

The documentation for this class was generated from the following file: