Class SyncRealTime#

Inheritance Relationships#

Base Type#

Class Documentation#

class SyncRealTime : public Karana::Models::KModel<SyncRealTime>#

Limits sim speed to a multiple of real time.

Public Functions

SyncRealTime(std::string_view name, const kc::ks_ptr<kd::ModelManager> &mm, double rt_speed = 1.0)#

SyncRealTime constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.

Parameters:
  • name – The name of the model.

  • mm – The ModelManager to register this model with.

  • rt_speed – The multiple of real time to limit to.

~SyncRealTime()#

Destructor for SyncRealTime.

void preHop(const km::Ktime &t, const km::Vec &x)#

Record the start-hop time.

Parameters:
  • t – Current time.

  • x – Current state. Not used.

void postHop(const km::Ktime &t, const km::Vec &x)#

Sleep as needed to sync to real time.

Parameters:
  • t – Current time.

  • x – Current state. Not used.

Public Static Functions

static kc::ks_ptr<SyncRealTime> create(std::string_view name, const kc::ks_ptr<kd::ModelManager> &mm, double rt_speed)#

Constructor.

Parameters:
  • name – The name of the model.

  • mm – The ModelManager to register this model with.

  • rt_speed – The multiple of real time to limit to.

Returns:

A ks_ptr to the newly created instance of the SyncRealTime model.