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::RandomEngine & | fEngine |
Type | fLastValue |
std::unique_ptr < utl::VRandomSampler > | fSampler |
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.
Definition at line 28 of file ConfigParameter.h.
typedef double utl::ConfigParameter::Type |
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.
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.
Enumerator | |
---|---|
eFormula | |
eFormulaWithVariable | |
eMap | |
eTabulatedFunction | |
eVector | |
eVectorPair |
Definition at line 74 of file ConfigParameter.h.
utl::ConfigParameter::ConfigParameter | ( | utl::RandomEngine & | eng, |
const utl::Branch & | configData | ||
) |
Construction giving an engine and a branch from where to load configuration data.
Definition at line 114 of file ConfigParameter.cc.
References RdGeoCeLDFFitter::b, utl::ConsecutiveEnumFactory< EnumType, last, tags, NoConversionPolicy, first >::Create(), eCDF, eFixed, eFormula, eFormulaWithVariable, eMap, ePDF, ERROR, eTabulatedFunction, eValueList, eVector, eVectorPair, fDelta, fLastValue, fSampler, utl::Branch::Get(), utl::Branch::GetChild(), utl::Branch::GetData(), and max.
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.
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().
|
private |
Definition at line 93 of file ConfigParameter.h.
Referenced by ConfigParameter(), and operator()().
|
private |
Definition at line 90 of file ConfigParameter.h.
Referenced by operator()().
|
mutableprivate |
Definition at line 92 of file ConfigParameter.h.
Referenced by ConfigParameter(), and operator()().
|
private |
Definition at line 91 of file ConfigParameter.h.
Referenced by ConfigParameter(), and operator()().
|
static |
Tags for the types of functions.
Definition at line 59 of file ConfigParameter.h.
|
static |
Tags for the types of interpolation.
Definition at line 87 of file ConfigParameter.h.
|
static |
Tags for the types of parametrization.
Definition at line 84 of file ConfigParameter.h.