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

Uniform distribution random object. More...

#include <HttpRandom.h>

Inheritance diagram for inet::httptools::rdUniform:
inet::httptools::rdObject

Public Member Functions

 rdUniform (double beginning, double end)
 
 rdUniform (cXMLAttributeMap attributes)
 
virtual double draw () override
 
double getBeginning ()
 
void setBeginning (double beginning)
 
double getEnd ()
 
void setEnd (double end)
 
- Public Member Functions inherited from inet::httptools::rdObject
virtual ~rdObject ()
 
DISTR_TYPE getType ()
 
std::string typeStr ()
 
virtual std::string toString ()
 

Protected Attributes

double m_beginning = NaN
 Low limit. More...
 
double m_end = NaN
 High limit. 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

Uniform distribution random object.

Wraps the OMNeT++ uniform distribution function.

Constructor & Destructor Documentation

inet::httptools::rdUniform::rdUniform ( double  beginning,
double  end 
)
86 {
88  m_beginning = beginning;
89  m_end = end;
90 }
Definition: HttpRandom.h:33
double m_end
High limit.
Definition: HttpRandom.h:115
double m_beginning
Low limit.
Definition: HttpRandom.h:114
DISTR_TYPE m_type
Definition: HttpRandom.h:49
inet::httptools::rdUniform::rdUniform ( cXMLAttributeMap  attributes)
93 {
95  if (!_hasKey(attributes, "beginning"))
96  throw "Undefined parameter for random distribution. Beginning must be defined for a normal distribution";
97  if (!_hasKey(attributes, "end"))
98  throw "Undefined parameter for random distribution. End must be defined for a normal distribution";
99  m_beginning = atof(attributes["beginning"].c_str());
100  m_end = atof(attributes["end"].c_str());
101 }
Definition: HttpRandom.h:33
double m_end
High limit.
Definition: HttpRandom.h:115
double m_beginning
Low limit.
Definition: HttpRandom.h:114
DISTR_TYPE m_type
Definition: HttpRandom.h:49
bool _hasKey(cXMLAttributeMap attributes, std::string key)
Definition: HttpRandom.h:52

Member Function Documentation

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

Implements inet::httptools::rdObject.

104 {
105  return RNGCONTEXT uniform(m_beginning, m_end);
106 }
#define RNGCONTEXT
Definition: INETDefs.h:85
double m_end
High limit.
Definition: HttpRandom.h:115
double m_beginning
Low limit.
Definition: HttpRandom.h:114
double inet::httptools::rdUniform::getBeginning ( )
inline
134 { return m_beginning; }
double m_beginning
Low limit.
Definition: HttpRandom.h:114
double inet::httptools::rdUniform::getEnd ( )
inline
136 { return m_end; }
double m_end
High limit.
Definition: HttpRandom.h:115
void inet::httptools::rdUniform::setBeginning ( double  beginning)
inline
135 { m_beginning = beginning; }
double m_beginning
Low limit.
Definition: HttpRandom.h:114
void inet::httptools::rdUniform::setEnd ( double  end)
inline
137 { m_end = end; }
double m_end
High limit.
Definition: HttpRandom.h:115

Member Data Documentation

double inet::httptools::rdUniform::m_beginning = NaN
protected

Low limit.

double inet::httptools::rdUniform::m_end = NaN
protected

High limit.


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