OMNeT++ Simulation Library  6.0.3

#include <crandom.h>

Description

Generates random numbers from the triangular distribution.

This class is an object-oriented wrapper around the triang(cRNG *rng, double a, double b, double c) function.

Inheritance diagram for cTriang:
cRandom cOwnedObject cNamedObject cObject

Public Member Functions

Constructors, destructor, etc.
 cTriang (cRNG *rng, double a, double b, double c)
 
 cTriang (const char *name=nullptr, cRNG *rng=nullptr, double a=-1, double b=0, double c=1)
 
 cTriang (const cTriang &other)
 
virtual cTriangdup () const override
 
cTriangoperator= (const cTriang &other)
 
virtual std::string str () const override
 
Parameters.
void setA (double a)
 
double getA () const
 
void setB (double b)
 
double getB () const
 
void setC (double c)
 
double getC () const
 
Random number generation.
virtual double draw () const override
 
- Public Member Functions inherited from cRandom
 cRandom (cRNG *rng)
 
 cRandom (const char *name=nullptr, cRNG *rng=nullptr)
 
virtual ~cRandom ()
 
virtual void setRNG (cRNG *rng)
 
cRNGgetRNG () const
 
- Public Member Functions inherited from cOwnedObject
 cOwnedObject ()
 
 cOwnedObject (const char *name, bool namepooling=true)
 
 cOwnedObject (const cOwnedObject &obj)
 
virtual ~cOwnedObject ()
 
cOwnedObjectoperator= (const cOwnedObject &o)
 
virtual void parsimPack (cCommBuffer *buffer) const override
 
virtual void parsimUnpack (cCommBuffer *buffer) override
 
virtual cObjectgetOwner () const override
 
virtual bool isOwnedObject () const override
 
- Public Member Functions inherited from cNamedObject
 cNamedObject ()
 
 cNamedObject (const char *name, bool namepooling=true)
 
 cNamedObject (const cNamedObject &obj)
 
virtual ~cNamedObject ()
 
cNamedObjectoperator= (const cNamedObject &o)
 
virtual void setName (const char *s)
 
virtual const char * getName () const override
 
virtual void setNamePooling (bool b)
 
virtual bool getNamePooling ()
 
- Public Member Functions inherited from cObject
 cObject ()
 
 cObject (const cObject &other)=default
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
virtual std::string getClassAndFullName () const
 
virtual std::string getClassAndFullPath () const
 
const cObjectgetThisPtr () const
 
virtual std::ostream & printOn (std::ostream &os) const
 
virtual bool isSoftOwner () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
void copyNotSupported () const
 

Additional Inherited Members

- Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
 
static long getLiveObjectCount ()
 
static void resetObjectCounters ()
 
static cSoftOwnergetOwningContext ()
 
- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Member Function Documentation

◆ dup()

virtual cTriang* dup ( ) const
inlineoverridevirtual

Should be redefined in subclasses to create an exact copy of this object. The default implementation just throws an error, to indicate that the method was not redefined.

Reimplemented from cObject.

◆ str()

virtual std::string str ( ) const
overridevirtual

Returns a brief, one-line description of the object. The returned string does (should) NOT include the object's name and class. This method is used to display object information at several places in the Qtenv GUI, among others.

Reimplemented from cObject.

◆ draw()

virtual double draw ( ) const
overridevirtual

Returns a random variate from the distribution represented by this object.

Implements cRandom.


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