Class RunPlan

Class Documentation

class RunPlan

Individual run config

Public Functions

explicit RunPlan(const ModelDescription &environment)

Constructor this will need to set the random seed to a default value, +1 of previous EnsembleRun would make sense

Todo:

Where will default steps and random seed come from?

Parameters

environmentEnvironmentDescription to limit properties by

RunPlan &operator=(const RunPlan &other)
void setRandomSimulationSeed(const unsigned int &random_seed)

Set the random seed passed to this run of the simulation

Parameters

random_seed – Seed for random generation during execution

void setSteps(const unsigned int &steps)

Set the number of steps for this instance of the simulation A steps value of 0 requires the ModelDescription to have atleast 1 exit condition

Parameters

steps – The number of steps to execute, 0 is unlimited but requires an exit condition

void setOutputSubdirectory(const std::string &subdir)

Set the sub directory within the output directory for outputs of this run If left empty, output will not goto subdirectories

Parameters

steps – The number of steps to execute, 0 is unlimited but requires an exit condition

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

Set the environment property override for this run of the model

Parameters
  • name – Environment property name

  • value – Environment property value (override)

Template Parameters

T – Type of the environment property

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

Set the environment property override for this run of the model 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 EnvironmentManager::size_type &index, const T &value)

Set the environment property override for this run of the model This version should be used for setting individual elements of array properties

Parameters
  • name – Environment property name

  • index – Length of the array to be returned

  • value – Environment property value (override)

Template Parameters

T – Type of the environment property

Throws
  • InvalidEnvProperty – If a property of the name does not exist

  • InvalidEnvPropertyType – If a property with the name has a type different to T

  • std::out_of_range – If index is not in range of the length of the property array

unsigned int getRandomSimulationSeed() const

Returns the random seed used for this simulation run

unsigned int getSteps() const

Returns the number of steps to be executed for this simulation run 0 means unlimited, and is only available if the model description has an exit condition

std::string getOutputSubdirectory() const

Returns the currently configured output subdirectory directory Empty string means output for this run will not be placed into a subdirectory

template<typename T>
T getProperty(const std::string &name) const

Gets the currently configured environment property value

Parameters

name – name used for accessing the property

Template Parameters

T – Type of the value to be returned

Throws
template<typename T, EnvironmentManager::size_type N>
std::array<T, N> getProperty(const std::string &name) const

Gets the currently configured environment property array value

Parameters

name – name used for accessing the property

Template Parameters
  • T – Type of the value to be returned

  • N – Length of the array to be returned

Throws
template<typename T>
T getProperty(const std::string &name, const EnvironmentManager::size_type &index) const

Gets an element of the currently configured environment property array

Parameters
  • name – name used for accessing the property

  • index – element from the environment property array to return

Template Parameters

T – Type of the value to be returned

Throws
  • InvalidEnvProperty – If a property of the name does not exist

  • InvalidEnvPropertyType – If a property with the name has a type different to T

  • std::out_of_range – If index is not in range of the length of the property array

RunPlanVec operator+(const RunPlan &rhs) const

Operator methods for combining vectors

RunPlanVec operator+(const RunPlanVec &rhs) const
RunPlanVec operator*(const unsigned int &rhs) const