Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

RandomVariable Class Reference

#include <ranvar.h>

Inheritance diagram for RandomVariable:

Inheritance graph
[legend]
Collaboration diagram for RandomVariable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual double value ()=0
virtual double avg ()=0
int command (int argc, const char *const *argv)
 RandomVariable ()
int seed (char *)

Protected Attributes

RNGrng_

Constructor & Destructor Documentation

RandomVariable::RandomVariable  ) 
 

Definition at line 27 of file ranvar.cc.

References RNG::defaultrng(), and rng_.

00028 {
00029         rng_ = RNG::defaultrng(); 
00030 }

Here is the call graph for this function:


Member Function Documentation

virtual double RandomVariable::avg  )  [pure virtual]
 

Implemented in UniformRandomVariable, ExponentialRandomVariable, ParetoRandomVariable, ParetoIIRandomVariable, NormalRandomVariable, LogNormalRandomVariable, ConstantRandomVariable, HyperExponentialRandomVariable, and EmpiricalRandomVariable.

int RandomVariable::command int  argc,
const char *const *  argv
 

Reimplemented in EmpiricalRandomVariable.

Definition at line 32 of file ranvar.cc.

References rng_, and value().

Referenced by EmpiricalRandomVariable::command().

00033 {
00034         Tcl& tcl = Tcl::instance();
00035 
00036         if (argc == 2) {
00037                 if (strcmp(argv[1], "value") == 0) {
00038                         tcl.resultf("%6e", value());
00039                         return(TCL_OK);
00040                 }
00041         }
00042         if (argc == 3) {
00043                 if (strcmp(argv[1], "use-rng") == 0) {
00044                         rng_ = (RNG*)TclObject::lookup(argv[2]);
00045                         if (rng_ == 0) {
00046                                 tcl.resultf("no such RNG %s", argv[2]);
00047                                 return(TCL_ERROR);
00048                         }
00049                         return(TCL_OK);
00050                 }
00051         }
00052         return(TclObject::command(argc, argv));
00053 }

Here is the call graph for this function:

int RandomVariable::seed char *   ) 
 

Definition at line 60 of file ranvar.cc.

References rng_.

Referenced by EXPOO_Traffic::command().

00060                                 {
00061         
00062         Tcl& tcl = Tcl::instance();
00063 
00064                 rng_ = (RNG*)TclObject::lookup(x);
00065                 if (rng_ == 0) {
00066                         tcl.resultf("no such RNG %s", x);
00067                         return(TCL_ERROR);
00068                 }
00069                 return(TCL_OK);
00070  
00071 }

virtual double RandomVariable::value  )  [pure virtual]
 

Implemented in UniformRandomVariable, ExponentialRandomVariable, ParetoRandomVariable, ParetoIIRandomVariable, NormalRandomVariable, LogNormalRandomVariable, ConstantRandomVariable, HyperExponentialRandomVariable, and EmpiricalRandomVariable.

Referenced by command(), EPATracePagePool::command(), ProxyTracePagePool::command(), CompMathPagePool::command(), MathPagePool::command(), TracePagePool::command(), MediaPagePool::command(), ErrorModel::CorruptBit(), ErrorModel::CorruptByte(), ErrorModel::CorruptPkt(), WebTrafSession::donePage(), WebTrafSession::expire(), WebPage::expire(), WebTrafSession::handle(), WebPage::handle(), and DelayModel::recv().


Member Data Documentation

RNG* RandomVariable::rng_ [protected]
 

Definition at line 41 of file ranvar.h.

Referenced by command(), RandomVariable(), seed(), EmpiricalRandomVariable::value(), LogNormalRandomVariable::value(), NormalRandomVariable::value(), ParetoIIRandomVariable::value(), ParetoRandomVariable::value(), ExponentialRandomVariable::value(), and UniformRandomVariable::value().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 13:11:35 2004 for NS2.26SourcesOriginal by doxygen 1.3.3