Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Real Class Reference
[Data classes]

A guassian distributed floating-point value. More...

#include <Real.h>

Inheritance diagram for Real:

BaseType List of all members.

Public Methods

 Real (float mean=0.0, float sigma=0.0)
 Create a new real with the specified distribution.

void set (float mean, float sigma)
 Set the distribution paramaters.

void regen ()
 Choose a new value from the distribution.

float getMean () const
 Get the mean value of the distribution.

float getSigma () const
 Get the standard deviation of the distribution.

float getValue () const
 Get the actual value.

virtual std::string asString () const
 Standard representation string.

virtual std::string typeString () const
 Return a string representation of the type.

 operator float () const
 Allow implicit coersion to a floating point value.

virtual void serialize (Archive &)
 Serialize to or from a data archive.

virtual void parseXML (const char *cdata)
 Internal method used by the XML parser.

virtual void convertXML ()
 Convert XML data to internal format prior to serialization.


Detailed Description

A guassian distributed floating-point value.

This class represents a "real-world" value distributed according to a normal distribution. Reals are specified by a median value and a standard deviation. When constructed the actual value is generated from this distribution.

Author:
Mark Rose <mrose@stm.lbl.gov>


Constructor & Destructor Documentation

Real::Real float    mean = 0.0,
float    sigma = 0.0
 

Create a new real with the specified distribution.

Parameters:
mean  the mean value of the normal distribution.
sigma  the standard deviation of the distribution.


Member Function Documentation

std::string Real::asString   [virtual]
 

Standard representation string.

Implements BaseType.

void BaseType::convertXML   [virtual, inherited]
 

Convert XML data to internal format prior to serialization.

This method is currently only called by the XML parser for Object classes. If another BaseType class requires this method, a call must be added to the appropriate XML handler in the parser.

float Real::getMean  
 

Get the mean value of the distribution.

float Real::getSigma  
 

Get the standard deviation of the distribution.

float Real::getValue  
 

Get the actual value.

Real::operator float   const [inline]
 

Allow implicit coersion to a floating point value.

void Real::parseXML const char *    cdata [virtual]
 

Internal method used by the XML parser.

The format for Reals is "mean:sigma"

Reimplemented from BaseType.

void Real::regen  
 

Choose a new value from the distribution.

void Real::serialize Archive   [virtual]
 

Serialize to or from a data archive.

Only the distribution parameters (mean and sigma) are saved. A new value will be generated from the saved distribution.

Reimplemented from BaseType.

void Real::set float    mean,
float    sigma
 

Set the distribution paramaters.

Parameters:
mean  the mean value of the normal distribution.
sigma  the standard deviation of the distribution.

virtual std::string Real::typeString   const [inline, virtual]
 

Return a string representation of the type.

Implements BaseType.


The documentation for this class was generated from the following files:
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage.

Generated on Tue Oct 14 12:06:42 2003, using Doxygen 1.2.18.

[SF.net]