VPTissue Reference Manual
SimPT_Parex::ParameterExploration Class Reference

Class describing a parameter exploration and its simulation tasks. More...

#include <ParameterExploration.h>

Inheritance diagram for SimPT_Parex::ParameterExploration:
Inheritance graph
Collaboration diagram for SimPT_Parex::ParameterExploration:
Collaboration graph

Public Member Functions

 ParameterExploration (const std::string &name, const boost::property_tree::ptree &original, const boost::property_tree::ptree &preferences)
 Constructor. More...
 
 ParameterExploration (const boost::property_tree::ptree &pt)
 Constructor. More...
 
 ParameterExploration (const ParameterExploration &other)
 Copy constructor.
 
virtual ~ParameterExploration ()
 Destructor.
 
virtual ParameterExplorationClone () const
 Clone function.
 
virtual SimTaskCreateTask (unsigned int index) const
 Creates a task with the parameters on the given index. More...
 
virtual unsigned int GetNumberOfTasks () const
 Returns the number of tasks the exploration currently contains.
 
std::string GetOriginalValue (const std::string &parameter) const
 Returns the original value of the parameter. More...
 
virtual std::vector< std::string > GetParameters () const
 Returns all the parameters in the exploration.
 
virtual std::vector< std::string > GetPossibleParameters () const
 Returns all the possible parameters for the exploration.
 
const ISweepGetSweep (const std::string &parameter) const
 Returns the sweep associated with the given parameter. More...
 
const std::list< std::pair< std::string, ISweep * > > & GetSweeps () const
 Returns all the sweeps.
 
virtual std::vector< std::string > GetValues (unsigned int index) const
 Return the values of a certain task. More...
 
ParameterExplorationoperator= (const ParameterExploration &other)
 Assignment operator.
 
void RemoveSweep (const std::string &parameter)
 Removes the sweep (if any) for the given parameter.
 
void SetSweep (const std::string &parameter, ISweep *sweep)
 Set a sweep for the given parameter. More...
 
virtual boost::property_tree::ptree ToPtree () const
 Convert the exploration to a ptree. More...
 
- Public Member Functions inherited from SimPT_Parex::Exploration
 Exploration (const std::string &name, const boost::property_tree::ptree &preferences)
 Constructor. More...
 
 Exploration (const boost::property_tree::ptree &pt)
 Constructor. More...
 
 Exploration (const Exploration &other)
 Copy constructor.
 
virtual ~Exploration ()
 Destructor.
 
const std::string & GetName () const
 Returns the name of the exploration.
 
const boost::property_tree::ptree & GetPreferences () const
 Returns the preferences of the exploration.
 
Explorationoperator= (const Exploration &other)
 Assignment operator.
 
void SetName (const std::string &name)
 Changes the name of the exploration. More...
 

Additional Inherited Members

- Protected Attributes inherited from SimPT_Parex::Exploration
std::string m_name
 
boost::property_tree::ptree m_preferences
 

Detailed Description

Class describing a parameter exploration and its simulation tasks.

Definition at line 33 of file ParameterExploration.h.

Constructor & Destructor Documentation

SimPT_Parex::ParameterExploration::ParameterExploration ( const std::string &  name,
const boost::property_tree::ptree &  original,
const boost::property_tree::ptree &  preferences 
)

Constructor.

Parameters
nameThe name of the exploration.
originalThe ptree of the base simulation of the exploration.
preferencesThe (workspace) preferences of the exploration.

Referenced by Clone().

Here is the caller graph for this function:

SimPT_Parex::ParameterExploration::ParameterExploration ( const boost::property_tree::ptree &  pt)

Constructor.

Constructs a new exploration with the given pt. See ToPtree() for more information about the format of an exploration tree.

Member Function Documentation

SimTask * SimPT_Parex::ParameterExploration::CreateTask ( unsigned int  index) const
virtual

Creates a task with the parameters on the given index.

This index is based on the Cartesian product of the exploration parameters.

Implements SimPT_Parex::Exploration.

Definition at line 125 of file ParameterExploration.cpp.

References GetNumberOfTasks(), GetValues(), and SimPT_Sim::Util::PTreeUtils::PutIndexedChild().

Here is the call graph for this function:

string SimPT_Parex::ParameterExploration::GetOriginalValue ( const std::string &  parameter) const

Returns the original value of the parameter.

The user must first verify that the parameter is associated with this sweep type by calling GetSweepType.

Returns
The value of the parameter in the original simulation ptree.
Exceptions
ptree_bad_pathWhen the parameter doesn't exist.

Definition at line 153 of file ParameterExploration.cpp.

References SimPT_Sim::Util::PTreeUtils::GetIndexedChild().

Here is the call graph for this function:

const ISweep * SimPT_Parex::ParameterExploration::GetSweep ( const std::string &  parameter) const

Returns the sweep associated with the given parameter.

Returns
The associated sweep, nullptr if there is no a sweep for this parameter.

Definition at line 158 of file ParameterExploration.cpp.

vector< string > SimPT_Parex::ParameterExploration::GetValues ( unsigned int  index) const
virtual

Return the values of a certain task.

The index of a value associated with a parameter in the vector is the same as the index of this parameter.

Parameters
indexThe task index.

Implements SimPT_Parex::Exploration.

Definition at line 97 of file ParameterExploration.cpp.

References GetNumberOfTasks(), SimPT_Parex::ISweep::GetNumberOfValues(), and SimPT_Parex::ISweep::GetValue().

Referenced by CreateTask().

Here is the call graph for this function:

Here is the caller graph for this function:

void SimPT_Parex::ParameterExploration::SetSweep ( const std::string &  parameter,
ISweep sweep 
)

Set a sweep for the given parameter.

The ownership of the sweep will be transferred to the exploration.

Definition at line 169 of file ParameterExploration.cpp.

References SimPT_Parex::ISweep::GetNumberOfValues(), and RemoveSweep().

Here is the call graph for this function:

boost::property_tree::ptree SimPT_Parex::ParameterExploration::ToPtree ( ) const
virtual

Convert the exploration to a ptree.

The format of an exploration ptree is as follows: <name>m_name</name> <preferences>m_preferences</preferences> (== the format of the workspace preferences) <original>m_original</original> (== the format of a normal tissue file) <sweeps> <sweep> (for each sweep in m_sweeps) <parameter>parameter</parameter> sweep [see Sweep.h for more information about the format] </sweep> [...] </sweeps>

Reimplemented from SimPT_Parex::Exploration.

Definition at line 188 of file ParameterExploration.cpp.

References SimPT_Parex::Exploration::ToPtree().

Here is the call graph for this function:


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