Template Class LinearProfileGenerator#

Inheritance Relationships#

Base Type#

Class Documentation#

template<typename T>
class LinearProfileGenerator : public Karana::Models::ProfileGenerator<T>#

A simple linear profile generator.

This does linear interpolation between (t_i,value_i) and (t_f,value_f). Times provided outside the given range, less than t_i or greater than t_f, will yield value_i and value_f, respectively.

Template Parameters:

T – The type of object to generate a profile for.

Public Functions

inline LinearProfileGenerator(std::string_view name, const Karana::Math::Ktime &t_i, const T &value_i, const Karana::Math::Ktime &t_f, const T &value_f)#

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

Parameters:
  • t_i – Time associated with value_i

  • value_i – The starting value for linear interpolation

  • t_f – Time associated with value_f

  • value_f – The ending value for linear interpolation

  • name – The name of the LinearProfileGenerator.

inline virtual const T &getValue(const Karana::Math::Ktime &t) override#

Get the profile value for the provided time.

Parameters:

t – The current time

Returns:

The profile value at the provided time.

inline virtual bool isReady() const override#

Indicate whether this LinearProfileGenerator is ready for simulation.

Returns:

true if it is ready, false otherwise.

Public Members

Karana::Math::Ktime t_i#

Time associated with value_i.

T value_i#

The starting value for linear interpolation.

Karana::Math::Ktime t_f#

Time associated with value_f.

T value_f#

The ending value for linear interpolation.

Public Static Functions

static inline Karana::Core::ks_ptr<LinearProfileGenerator> create(std::string_view name, const Karana::Math::Ktime &t_i, const T &value_i, const Karana::Math::Ktime &t_f, const T &value_f)#

LinearProfileGenerator constructor.

Parameters:
  • name – The name of the LinearProfileGenerator.

  • t_i – Time associated with value_i

  • value_i – The starting value for linear interpolation

  • t_f – Time associated with value_f

  • value_f – The ending value for linear interpolation

Returns:

A pointer to the newly created instance of LinearProfileGenerator.