OpenStudioCore:analysis
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Related Functions | List of all members
openstudio::analysis::SamplingAlgorithmOptions Class Reference

#include <SamplingAlgorithmOptions.hpp>

+ Inheritance diagram for openstudio::analysis::SamplingAlgorithmOptions:

Public Member Functions

Constructors and Destructors
 SamplingAlgorithmOptions ()
 Generates and sets a random seed. More...
 
 SamplingAlgorithmOptions (const boost::optional< SamplingAlgorithmSampleType > &sampleType, const boost::optional< SamplingAlgorithmRNGType > &rngType, const std::vector< Attribute > &options)
 Constructor provided for deserialization; not for general use. More...
 
virtual ~SamplingAlgorithmOptions ()
 
Getters
boost::optional
< SamplingAlgorithmSampleType
sampleType () const
 Returns the sampling type if it exists, evaluates to false otherwise. More...
 
boost::optional
< SamplingAlgorithmRNGType
rngType () const
 Returns the random number generator (RNG) type if it exists, evaluates to false otherwise. More...
 
int samples () const
 Returns the user-specified number of samples. More...
 
bool allVariables () const
 Returns whether or not the user-specified all_variables option is active, if set; the default value is false. More...
 
bool varianceBasedDecomp () const
 Returns whether or not the user-specified variance_based_decomp option is active, if set; the default value is false. More...
 
bool dropTolerance () const
 Returns whether or not the user-specified drop_tolerance option is active, if set; the default value is false. More...
 
boost::optional< int > seed () const
 Returns the explict pseudo-random number generator seed if it exists, evaluates to false otherwise. More...
 
bool fixedSeed () const
 Returns whether or not the user-specified fixed_seed option is active, if set; the default value is false. More...
 
Setters
void setSampleType (SamplingAlgorithmSampleType value)
 
void clearSampleType ()
 
void setRNGType (SamplingAlgorithmRNGType value)
 
void clearRNGType ()
 
bool setSamples (int value)
 The number of samples must be greater than zero. More...
 
void setAllVariables (bool value)
 Places the string "all_variables" in the .in file if true, otherwise nothing. More...
 
void setVarianceBasedDecomp (bool value)
 Places the string "variance_based_decomp" in the .in file if true, otherwise nothing. More...
 
void setDropTolerance (bool value)
 Places the string "drop_tolerance" in the .in file if true, otherwise nothing. More...
 
bool setSeed (int value)
 Seed value must be greater than zero. More...
 
void clearSeed ()
 Clears the seed. More...
 
void setFixedSeed (bool value)
 Places the string "fixed_seed" in the .in file if true, otherwise nothing. More...
 
- Public Member Functions inherited from openstudio::analysis::DakotaAlgorithmOptions
virtual ~DakotaAlgorithmOptions ()
 
- Public Member Functions inherited from openstudio::analysis::AlgorithmOptions
 AlgorithmOptions ()
 By default, maxIter and maxSims are set to boost::none (no restriction). More...
 
virtual ~AlgorithmOptions ()
 
AlgorithmOptions clone () const
 
boost::optional< int > maxIter () const
 
boost::optional< int > maxSims () const
 
std::vector< Attribute > options () const
 Getter provided for serialization; not for general use. More...
 
void setMaxIter (int maxIter)
 
void setMaxSims (int maxSims)
 
void clearMaxIter ()
 
void clearMaxSims ()
 
template<typename T >
cast () const
 Cast to type T. More...
 
template<typename T >
boost::optional< T > optionalCast () const
 Cast to boost::optional<T>. More...
 

Related Functions

(Note that these are not member functions.)

typedef boost::optional
< SamplingAlgorithmOptions
OptionalSamplingAlgorithmOptions
 
typedef std::vector
< SamplingAlgorithmOptions
SamplingAlgorithmOptionsVector
 

Additional Inherited Members

- Protected Member Functions inherited from openstudio::analysis::AlgorithmOptions
void setAlgorithm (const Algorithm &algorithm)
 
QVariant toVariant () const
 

Detailed Description

SamplingAlgorithmOptions is a DakotaAlgorithmOptions class that defines options specific to SamplingAlgorithm.

Constructor & Destructor Documentation

openstudio::analysis::SamplingAlgorithmOptions::SamplingAlgorithmOptions ( )

Generates and sets a random seed.

The default is to have the seed fixed so that the analysis can be restarted in case of a failure.

openstudio::analysis::SamplingAlgorithmOptions::SamplingAlgorithmOptions ( const boost::optional< SamplingAlgorithmSampleType > &  sampleType,
const boost::optional< SamplingAlgorithmRNGType > &  rngType,
const std::vector< Attribute > &  options 
)

Constructor provided for deserialization; not for general use.

virtual openstudio::analysis::SamplingAlgorithmOptions::~SamplingAlgorithmOptions ( )
inlinevirtual

Member Function Documentation

bool openstudio::analysis::SamplingAlgorithmOptions::allVariables ( ) const

Returns whether or not the user-specified all_variables option is active, if set; the default value is false.

void openstudio::analysis::SamplingAlgorithmOptions::clearRNGType ( )
void openstudio::analysis::SamplingAlgorithmOptions::clearSampleType ( )
void openstudio::analysis::SamplingAlgorithmOptions::clearSeed ( )

Clears the seed.

Use with caution–clearing the seed value will essentially negate the Dakota restart functionality, as the samples generated after restart will not match the original samples.

bool openstudio::analysis::SamplingAlgorithmOptions::dropTolerance ( ) const

Returns whether or not the user-specified drop_tolerance option is active, if set; the default value is false.

bool openstudio::analysis::SamplingAlgorithmOptions::fixedSeed ( ) const

Returns whether or not the user-specified fixed_seed option is active, if set; the default value is false.

boost::optional<SamplingAlgorithmRNGType> openstudio::analysis::SamplingAlgorithmOptions::rngType ( ) const

Returns the random number generator (RNG) type if it exists, evaluates to false otherwise.

DAKOTA defaults to Mersenne twister (mt19937).

int openstudio::analysis::SamplingAlgorithmOptions::samples ( ) const

Returns the user-specified number of samples.

boost::optional<SamplingAlgorithmSampleType> openstudio::analysis::SamplingAlgorithmOptions::sampleType ( ) const

Returns the sampling type if it exists, evaluates to false otherwise.

DAKOTA will automatically use latin hypercube sampling (LHS) if unspecified.

boost::optional<int> openstudio::analysis::SamplingAlgorithmOptions::seed ( ) const

Returns the explict pseudo-random number generator seed if it exists, evaluates to false otherwise.

void openstudio::analysis::SamplingAlgorithmOptions::setAllVariables ( bool  value)

Places the string "all_variables" in the .in file if true, otherwise nothing.

void openstudio::analysis::SamplingAlgorithmOptions::setDropTolerance ( bool  value)

Places the string "drop_tolerance" in the .in file if true, otherwise nothing.

void openstudio::analysis::SamplingAlgorithmOptions::setFixedSeed ( bool  value)

Places the string "fixed_seed" in the .in file if true, otherwise nothing.

void openstudio::analysis::SamplingAlgorithmOptions::setRNGType ( SamplingAlgorithmRNGType  value)
bool openstudio::analysis::SamplingAlgorithmOptions::setSamples ( int  value)

The number of samples must be greater than zero.

void openstudio::analysis::SamplingAlgorithmOptions::setSampleType ( SamplingAlgorithmSampleType  value)
bool openstudio::analysis::SamplingAlgorithmOptions::setSeed ( int  value)

Seed value must be greater than zero.

void openstudio::analysis::SamplingAlgorithmOptions::setVarianceBasedDecomp ( bool  value)

Places the string "variance_based_decomp" in the .in file if true, otherwise nothing.

This is a computationally intensive option; it requires the evaluation of n*(m+2) samples, where n is the number of samples specified and m is the number of variables.

bool openstudio::analysis::SamplingAlgorithmOptions::varianceBasedDecomp ( ) const

Returns whether or not the user-specified variance_based_decomp option is active, if set; the default value is false.

Friends And Related Function Documentation