namespace generator class GenParam

Generation parameter class.

Public Classes

enum ParType
parameter type enumerator
enum DistType
Distribution type enumerator

Public Methods

GenParam(void)
Default constructor.
~GenParam(void)
Destructor.
std::ostream& dump(std::ostream& out) const
Dump the parameter tpe and value.
static DistType getDistID(const std::string& name)
get the named distribution ID.
static const char* getDistName(DistType id)
get name distribution id.
const char* getString(void) const
Get parameter string value.
double getNumeric(void) const
Get numeric parameter value.
bool isConst(void) const
Test whether parameter is constant.
bool isStep(void) const
Test if parameter is step distribution.
bool atStart(void) const
Test if at start of step.
double sampleParameter(void)
Generate parameter according to random distribution.
void setDistribution(const std::string& value)
Set the distribution type.
void setParameter(double value)
Assign parameter a numeric value.
void setParameter(const std::string& value)
Assign parameter a string value.

Documentation

The GenParam class holds a generation parameter. The parameters may have string or numeric values, and may take random values. Random parameters are reset by calls to sampleParameter() according to one of the following distributions:

Name Distribution
step(<min>,<max>,<inc>) Step from <min> to <max> by <inc>
xstep(<min>,<max>,<fact>) Step from <min> to <max> by factors of <fact>
flat(<min>,<max>) Flat distribution in range <min> - <max>
gauss(<mean>,<sigma>) Gaussian distribution with mean <mean> and sigma <sigma>
power(N,<min>,<max>) in range <min> - <max>
exp(b,<min>,<max>) in range <min> - <max>

enum ParType
parameter type enumerator

enum DistType
Distribution type enumerator

GenParam(void)
Default constructor.

~GenParam(void)
Destroy a parameter object

std::ostream& dump(std::ostream& out) const
Dump the parameter type and current value. In the case of random distributions, the distribution type and parameters are also given.
Returns:
Reference to the output stream.
Parameters:
out - Standard output stream to receive dump text.

static DistType getDistID(const std::string& name)
Get the distribution id from the name.
Returns:
ID of named distribution name.
Parameters:
name - Distribution name to look up.

static const char* getDistName(DistType id)
Get the name of the specified distribution ID.
Returns:
Constant pointer to ditribution name string.
Parameters:
id - Distrbution id.

const char* getString(void) const
Get a string value of the class parameter.
Returns:
Constant pointer to parameter value string.

double getNumeric(void) const
Get a numeric value of the parameter. The value of string parameters is converted to a numeric value.
Returns:
Numeric value of the parameter.

bool isConst(void) const
Test whether Parameter has a constant value.
Returns:
true if parameter is constant (not a distribution).

bool isStep(void) const
Test whether Parameter steps over specified values.
Returns:
true if parameter is a atep distribution.

bool atStart(void) const
Test whether stepping parameter is at the start (indicates overflow occurred in last step).
Returns:
true if a start of step.

double sampleParameter(void)
Generate a new value for a randomly generated parameter. If the parameter is string or numeric constant type, the current value of the parameter is returned.
Returns:
Random parameter value.

void setDistribution(const std::string& value)
Specify a distribution for the random parameter. The distribution is specified in the form "type(p1[[, p2], p3])".
Parameters:
value - Distribution definition string.

void setParameter(double value)
Assign the parameter a numeric value and set the parameter type to kConst.
Parameters:
value - Value to assign to parameter.

void setParameter(const std::string& value)
Assign the parameter a string value and set the parameter type to kString.
Parameters:
value - String value to assign to parameter.


This class has no child classes.
Author:
John Zweizig
Version:
1.1; Last modified April 22, 2003

alphabetic index hierarchy of classes


generated by doc++