List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
utl::ConfigParameter Class Reference

Helper class for configuration of parameters. More...

#include <Configuration/ConfigParameter.h>

Public Types

enum  FunctionType { eFixed, ePDF, eCDF, eValueList }
 Type of function to be used. More...
 
enum  Parametrization {
  eFormula, eFormulaWithVariable, eMap, eTabulatedFunction,
  eVector, eVectorPair
}
 
typedef double Type
 

Public Member Functions

 ConfigParameter (utl::RandomEngine &eng, const utl::Branch &configData)
 Construction giving an engine and a branch from where to load configuration data. More...
 
Type operator() () const
 
 ~ConfigParameter ()
 Explicit declaratio+defintion so as to have, when defined, also fully defined the pointed-to type of the nested std::auto_ptr. More...
 

Static Public Attributes

static const char *const kFunctionTypeTags [] = { "Fixed", "PDF", "CDF", "ValueList" }
 Tags for the types of functions. More...
 
static const char *const kInterpolationTags [] = { "Linear", "Discrete", "Step" }
 Tags for the types of interpolation. More...
 
static const char *const kParametrizationTags []
 Tags for the types of parametrization. More...
 

Private Attributes

bool fDelta = false
 
utl::RandomEnginefEngine
 
Type fLastValue
 
std::unique_ptr
< utl::VRandomSampler
fSampler
 

Detailed Description

Helper class for configuration of parameters.

Wraps random number generation, or other means of determining the value of the wrapped parameter, it also handles the access to configuration.

Author
Rodolfo Federico Gamarra
Date
19 Sep 2009

Definition at line 28 of file ConfigParameter.h.

Member Typedef Documentation

Alias for type of the paremeter.

XXX May it be proper to have this class templatized on the parameter type? In the end, we have a tight coupling with the underlying randomization procedures which work with double. If later that's desired, the arg should be defaulted to double and that's it.

Definition at line 36 of file ConfigParameter.h.

Member Enumeration Documentation

Type of function to be used.

Enumerator
eFixed 
ePDF 
eCDF 
eValueList 

Definition at line 51 of file ConfigParameter.h.

Type of parametrization for the configured type of function.

It's based on the constructors of the referenced types.

Note that, for completeness, an enum is provided to match each constructor, but the case for map is not implemented due to the lack of a utl::Branch::GetData function with that parameter type.

See Also
utl::RandomSamplerFromCDF
utl::RandomSamplerFromPDF
utl::Branch
Enumerator
eFormula 
eFormulaWithVariable 
eMap 
eTabulatedFunction 
eVector 
eVectorPair 

Definition at line 74 of file ConfigParameter.h.

Constructor & Destructor Documentation

utl::ConfigParameter::ConfigParameter ( utl::RandomEngine eng,
const utl::Branch configData 
)
utl::ConfigParameter::~ConfigParameter ( )

Explicit declaratio+defintion so as to have, when defined, also fully defined the pointed-to type of the nested std::auto_ptr.

Definition at line 226 of file ConfigParameter.cc.

Member Function Documentation

double utl::ConfigParameter::operator() ( ) const

Compute a configuration value. The value may be randomize, constant or taken from list: ie value actual value returned may change betweeen invocations, tough this function is const.

Definition at line 234 of file ConfigParameter.cc.

References fDelta, fEngine, fLastValue, fSampler, and utl::RandomEngine::GetEngine().

Member Data Documentation

bool utl::ConfigParameter::fDelta = false
private

Definition at line 93 of file ConfigParameter.h.

Referenced by ConfigParameter(), and operator()().

utl::RandomEngine& utl::ConfigParameter::fEngine
private

Definition at line 90 of file ConfigParameter.h.

Referenced by operator()().

Type utl::ConfigParameter::fLastValue
mutableprivate

Definition at line 92 of file ConfigParameter.h.

Referenced by ConfigParameter(), and operator()().

std::unique_ptr<utl::VRandomSampler> utl::ConfigParameter::fSampler
private

Definition at line 91 of file ConfigParameter.h.

Referenced by ConfigParameter(), and operator()().

const char *const utl::ConfigParameter::kFunctionTypeTags = { "Fixed", "PDF", "CDF", "ValueList" }
static

Tags for the types of functions.

Definition at line 59 of file ConfigParameter.h.

const char *const utl::ConfigParameter::kInterpolationTags = { "Linear", "Discrete", "Step" }
static

Tags for the types of interpolation.

Definition at line 87 of file ConfigParameter.h.

const char *const utl::ConfigParameter::kParametrizationTags
static
Initial value:
=
{ "Formula", "FormulaWithVariable", "Map", "TabulatedFunction", "Vector", "VectorPair" }

Tags for the types of parametrization.

Definition at line 84 of file ConfigParameter.h.


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

, generated on Tue Sep 26 2023.