INET Framework for OMNeT++/OMNEST
inet::httptools::rdConstant Class Reference

Constant distribution random object. More...

#include <HttpRandom.h>

Inheritance diagram for inet::httptools::rdConstant:
inet::httptools::rdObject

Public Member Functions

 rdConstant (double value)
 
 rdConstant (cXMLAttributeMap attributes)
 
double draw () override
 
- Public Member Functions inherited from inet::httptools::rdObject
virtual ~rdObject ()
 
DISTR_TYPE getType ()
 
std::string typeStr ()
 
virtual std::string toString ()
 

Protected Attributes

double m_value = NaN
 The constant. More...
 
- Protected Attributes inherited from inet::httptools::rdObject
DISTR_TYPE m_type = dt_normal
 

Additional Inherited Members

- Protected Member Functions inherited from inet::httptools::rdObject
bool _hasKey (cXMLAttributeMap attributes, std::string key)
 

Detailed Description

Constant distribution random object.

Not really a random object, but used to allow constants to be assigned in stead of random distributions when initializing parameters.

Constructor & Destructor Documentation

inet::httptools::rdConstant::rdConstant ( double  value)
224 {
226  m_value = value;
227 }
Definition: HttpRandom.h:33
DISTR_TYPE m_type
Definition: HttpRandom.h:49
double m_value
The constant.
Definition: HttpRandom.h:223
inet::httptools::rdConstant::rdConstant ( cXMLAttributeMap  attributes)
230 {
232  if (!_hasKey(attributes, "value"))
233  throw "No value specified";
234  m_value = atof(attributes["value"].c_str());
235 }
Definition: HttpRandom.h:33
DISTR_TYPE m_type
Definition: HttpRandom.h:49
double m_value
The constant.
Definition: HttpRandom.h:223
bool _hasKey(cXMLAttributeMap attributes, std::string key)
Definition: HttpRandom.h:52

Member Function Documentation

double inet::httptools::rdConstant::draw ( )
overridevirtual

Implements inet::httptools::rdObject.

238 {
239  return m_value;
240 }
double m_value
The constant.
Definition: HttpRandom.h:223

Member Data Documentation

double inet::httptools::rdConstant::m_value = NaN
protected

The constant.


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