Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
GameClientRandomVariable Class Reference

#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
 

Detailed Description

A GameClientRandomVariable represents a distribution of random values from which discrete values can be retrieved.

Definition at line 53 of file ClientRandomValue.h.

Member Enumeration Documentation

◆ DistributionType

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.

Member Function Documentation

◆ getDistributionType()

DistributionType GameClientRandomVariable::getDistributionType ( void ) const
inline

Definition at line 82 of file ClientRandomValue.h.

◆ getMaximumValue()

Real GameClientRandomVariable::getMaximumValue ( void ) const
inline

Definition at line 81 of file ClientRandomValue.h.

◆ getMinimumValue()

Real GameClientRandomVariable::getMinimumValue ( void ) const
inline

Definition at line 80 of file ClientRandomValue.h.

◆ getValue()

Real GameClientRandomVariable::getValue ( void ) const

return a value from the random distribution

Return a value from the random distribution

Todo
fill in support for nonuniform GameClientRandomVariables.

Definition at line 377 of file RandomValue.cpp.

◆ setRange()

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.

Member Data Documentation

◆ CColorAlphaDialog

friend GameClientRandomVariable::CColorAlphaDialog
protected

Definition at line 88 of file ClientRandomValue.h.

◆ DebugWindowDialog

friend GameClientRandomVariable::DebugWindowDialog
protected

Definition at line 89 of file ClientRandomValue.h.

◆ DistributionTypeNames

const char * GameClientRandomVariable::DistributionTypeNames
static
Initial value:
=
{
"CONSTANT", "UNIFORM", "GAUSSIAN", "TRIANGULAR", "LOW_BIAS", "HIGH_BIAS"
}

Definition at line 358 of file ClientRandomValue.h.

◆ m_high

Real GameClientRandomVariable::m_high
protected

the range of random values

Definition at line 85 of file ClientRandomValue.h.

◆ m_low

Real GameClientRandomVariable::m_low
protected

Definition at line 85 of file ClientRandomValue.h.

◆ m_type

DistributionType GameClientRandomVariable::m_type
protected

the kind of random distribution

Definition at line 84 of file ClientRandomValue.h.


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