#include <ClientRandomValue.h>
Public Types | |
| enum | DistributionType { CONSTANT , UNIFORM , GAUSSIAN , TRIANGULAR , LOW_BIAS , HIGH_BIAS } |
Public Member Functions | |
| void | setRange (Real low, Real high, DistributionType type=UNIFORM) |
| define the range of random values, and the distribution of values | |
| Real | getValue (void) const |
| return a value from the random distribution | |
| Real | getMinimumValue (void) const |
| Real | getMaximumValue (void) const |
| DistributionType | getDistributionType (void) const |
Static Public Attributes | |
| static const char * | DistributionTypeNames [] |
Protected Attributes | |
| DistributionType | m_type |
| the kind of random distribution | |
| Real | m_low |
| Real | m_high |
| the range of random values | |
| friend | CColorAlphaDialog |
| friend | DebugWindowDialog |
A GameClientRandomVariable represents a distribution of random values from which discrete values can be retrieved.
Definition at line 53 of file ClientRandomValue.h.
CONSTANT represents a single, constant, value. UNIFORM represents a uniform distribution of random values. GAUSSIAN represents a normally distributed set of random values. TRIANGULAR represents a distribution of random values in the shape of a triangle, with the peak probability midway between low and high. LOW_BIAS represents a distribution of random values with maximum probability at low, and zero probability at high. HIGH_BIAS represents a distribution of random values with zero probability at low, and maximum probability at high.
| Enumerator | |
|---|---|
| CONSTANT | |
| UNIFORM | |
| GAUSSIAN | |
| TRIANGULAR | |
| LOW_BIAS | |
| HIGH_BIAS | |
Definition at line 69 of file ClientRandomValue.h.
|
inline |
Definition at line 82 of file ClientRandomValue.h.
|
inline |
Definition at line 81 of file ClientRandomValue.h.
|
inline |
Definition at line 80 of file ClientRandomValue.h.
| Real GameClientRandomVariable::getValue | ( | void | ) | const |
return a value from the random distribution
Return a value from the random distribution
Definition at line 377 of file RandomValue.cpp.
| void GameClientRandomVariable::setRange | ( | Real | low, |
| Real | high, | ||
| DistributionType | type = UNIFORM ) |
define the range of random values, and the distribution of values
define the range of random values, and the distribution of values
Definition at line 366 of file RandomValue.cpp.
|
protected |
Definition at line 88 of file ClientRandomValue.h.
|
protected |
Definition at line 89 of file ClientRandomValue.h.
|
static |
Definition at line 358 of file ClientRandomValue.h.
|
protected |
the range of random values
Definition at line 85 of file ClientRandomValue.h.
|
protected |
Definition at line 85 of file ClientRandomValue.h.
|
protected |
the kind of random distribution
Definition at line 84 of file ClientRandomValue.h.