Class RunPlanVector

Inheritance Relationships

Base Type

  • private std::vector< RunPlan >

Class Documentation

class RunPlanVector : private std::vector<RunPlan>

Vector of RunPlan Contains additional methods for generating collections of RunPlans and combining RunPlanVectors

Public Functions

explicit RunPlanVector(const ModelDescription &model, unsigned int initial_length)

Constructor, requires the model description to validate environment properties match up

void setRandomSimulationSeed(uint64_t initial_seed, unsigned int step = 0)

Set the random simulation seed of each RunPlan currently within this vector

Note

A step of 0, will give the exact same seed to all RunPlans

Parameters
  • initial_seed – The random seed applied to the first item

  • step – The value added to the previous seed to calculate the next seed

void setSteps(unsigned int steps)

Set the steps of each RunPlan currently within this vector

Note

If 0 is provided, the model must have an exit condition

Parameters

steps – The number of steps to be executed

void setOutputSubdirectory(const std::string &subdir)

Set the the sub directory within the output directory for outputs of runplans in this vector

Note

Defaults to empty string, where no subdirectory is used

Parameters

subdir – The name of the subdirectory

template<typename T>
void setProperty(const std::string &name, const T value)

Set named environment property to a specific value

Parameters
  • name – The name of the environment property to set

  • value – The value of the environment property to set

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T, flamegpu::size_type N>
void setProperty(const std::string &name, const std::array<T, N> &value)

Set named environment property array to a specific value This version should be used for array properties

Parameters
  • name – Environment property name

  • value – Environment property value (override)

Template Parameters
  • T – Type of the environment property

  • N – Length of the array to be returned

Throws
template<typename T>
void setProperty(const std::string &name, const flamegpu::size_type index, const T value)

Array property element equivalent of setProperty()

Parameters
  • name – The name of the environment property array to affect

  • index – The index of the environment property array to set

  • value – The value of the environment property array to set

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T>
void setPropertyLerpRange(const std::string &name, const T min, const T max)

Sweep named environment property over an inclusive uniform distribution value = min * (1.0 - a) + max * a, where a = index/(size()-1) Integer types will be rounded to the nearest integer

Parameters
  • name – The name of the environment property to set

  • min – The value to set the first environment property

  • max – The value to set the last environment property

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T>
void setPropertyLerpRange(const std::string &name, const flamegpu::size_type index, const T min, const T max)

Array property element equivalent of setPropertyLerpRange() Sweep element of named environment property array over an inclusive uniform distribution value = min * (1.0 - a) + max * a, where a = index/(size()-1) Integer types will be rounded to the nearest integer

See also

setPropertyUniformDistribution(const std::string &name, T min, T max)

Parameters
  • name – The name of the environment property to set

  • index – The index of the element within the environment property array to set

  • min – The value to set the first environment property array element

  • max – The value to set the last environment property array element

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
void setRandomPropertySeed(uint64_t seed)

Seed the internal random generator used for random property distributions This will only affect subsequent calls to setPropertyRandom()

Parameters

seed – The random seed to be used

uint64_t getRandomPropertySeed()

Get the seed used for the internal random generator used for random property distributions This will only valid for calls to setPropertyRandom() since the last call toSetRandomPropertySeed

Returns

the seed used for random properties since the last call to setPropertyRandom

template<typename T>
void setPropertyUniformRandom(const std::string &name, const T min, const T max)

Sweep named environment property over a uniform random distribution Integer types have a range [min, max] Floating point types have a range [min, max)

Convenience random implementations

Parameters
  • name – The name of the environment property to set

  • min – The value of the range to set the first environment property

  • max – The value of the range to set the last environment property

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T>
void setPropertyUniformRandom(const std::string &name, const flamegpu::size_type index, const T min, const T max)

Array property element equivalent of setPropertyUniformRandom() Sweep named environment property over a uniform random distribution Integer types have a range [min, max] Floating point types have a range [min, max)

Parameters
  • name – The name of the environment property to set

  • index – The index of the array element to set

  • min – The value of the range to set the first environment property

  • max – The value of the range to set the last environment property

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T>
void setPropertyNormalRandom(const std::string &name, const T mean, const T stddev)

Sweep named environment property over a normal random distribution Only floating point types are supported

Parameters
  • name – The name of the environment property to set

  • mean – Mean of the distribution (its expected value). Which coincides with the location of its peak.

  • stddev – Standard deviation: The square root of variance, representing the dispersion of values from the distribution mean.

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T>
void setPropertyNormalRandom(const std::string &name, flamegpu::size_type index, T mean, T stddev)

Array property element equivalent of setPropertyNormalRandom() Sweep named environment property over a normal random distribution Only floating point types are supported

Parameters
  • name – The name of the environment property to set

  • index – The index of the array element to set

  • mean – Mean of the distribution (its expected value). Which coincides with the location of its peak.

  • stddev – Standard deviation: The square root of variance, representing the dispersion of values from the distribution mean.

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T>
void setPropertyLogNormalRandom(const std::string &name, T mean, T stddev)

Sweep named environment property over a log normal random distribution Only floating point types are supported

Parameters
  • name – The name of the environment property to set

  • mean – Mean of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.

  • stddev – Standard deviation of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T>
void setPropertyLogNormalRandom(const std::string &name, flamegpu::size_type index, T mean, T stddev)

Array property element equivalent of setPropertyLogNormalRandom() Sweep named environment property over a log normal random distribution Only floating point types are supported

Parameters
  • name – The name of the environment property to set

  • index – The index of the array element to set

  • mean – Mean of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.

  • stddev – Standard deviation of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.

Template Parameters

T – The type of the environment property, this must match the ModelDescription

Throws
template<typename T, typename rand_dist>
void setPropertyRandom(const std::string &name, rand_dist &distribution)

Use a random distribution to generate parameters for the named environment property

Parameters
  • name – The name of the environment property to set

  • distribution – The random distribution to use for generating random property values

Template Parameters
  • T – The type of the environment property, this must match the ModelDescription

  • rand_dist – An object satisfying the requirements of RandomNumberDistribution e.g. std::uniform_real_distribution

Throws
template<typename T, typename rand_dist>
void setPropertyRandom(const std::string &name, flamegpu::size_type index, rand_dist &distribution)

Array property element equivalent of setPropertyRandom() Use a random distribution to generate parameters for the specified element of the named environment property array

Parameters
  • name – The name of the environment property to set

  • index – The index of the element within the environment property array to set

  • distribution – The random distribution to use for generating random property values

Template Parameters
  • T – The type of the environment property array, this must match the ModelDescription

  • rand_dist – An object satisfying the requirements of RandomNumberDistribution e.g. std::uniform_real_distribution

Throws
RunPlanVector operator+(const RunPlan &rhs) const

Operator methods for combining vectors

RunPlanVector operator+(const RunPlanVector &rhs) const
RunPlanVector &operator+=(const RunPlan &rhs)
RunPlanVector &operator+=(const RunPlanVector &rhs)
RunPlanVector &operator*=(unsigned int rhs)
RunPlanVector operator*(unsigned int rhs) const
bool operator==(const RunPlanVector &rhs) const
bool operator!=(const RunPlanVector &rhs) const
template<>
inline void setPropertyUniformRandom(const std::string &name, const float min, const float max)

Special cases std::random doesn’t support char, emulate behaviour char != signed char (or unsigned char)

template<>
inline void setPropertyUniformRandom(const std::string &name, const flamegpu::size_type index, const float min, const float max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const double min, const double max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const flamegpu::size_type index, const double min, const double max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const char min, const char max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const flamegpu::size_type index, const char min, const char max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const unsigned char min, const unsigned char max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const flamegpu::size_type index, const unsigned char min, const unsigned char max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const signed char min, const signed char max)
template<>
inline void setPropertyUniformRandom(const std::string &name, const flamegpu::size_type index, const signed char min, const signed char max)