LogNormalRandomVariable Class Reference

#include <ranvar.h>

Inheritance diagram for LogNormalRandomVariable:

RandomVariable TclObject Collaboration diagram for LogNormalRandomVariable:

Collaboration graph
[legend]

Detailed Description

Definition at line 145 of file ranvar.h.

Public Member Functions

virtual double avg ()
double * avgp ()
int command (int argc, const char *const *argv)
 LogNormalRandomVariable ()
int seed (char *)
void setavg (double d)
void setstd (double d)
double std ()
double * stdp ()
virtual double value ()

Protected Attributes

RNGrng_

Private Attributes

double avg_
double std_


Constructor & Destructor Documentation

LogNormalRandomVariable::LogNormalRandomVariable  ) 
 

Definition at line 232 of file ranvar.cc.

References avg_, and std_.

00233 { 
00234         bind("avg_", &avg_);
00235         bind("std_", &std_);
00236 }


Member Function Documentation

virtual double LogNormalRandomVariable::avg  )  [inline, virtual]
 

Implements RandomVariable.

Definition at line 151 of file ranvar.h.

References avg_.

00151 { return avg_; };

double* LogNormalRandomVariable::avgp  )  [inline]
 

Definition at line 149 of file ranvar.h.

References avg_.

00149 { return &avg_; };

int RandomVariable::command int  argc,
const char *const *  argv
[inherited]
 

Reimplemented in EmpiricalRandomVariable.

Definition at line 55 of file ranvar.cc.

References RandomVariable::rng_, and RandomVariable::value().

Referenced by EmpiricalRandomVariable::command().

00056 {
00057     Tcl& tcl = Tcl::instance();
00058 
00059     if (argc == 2) {
00060         if (strcmp(argv[1], "value") == 0) {
00061             tcl.resultf("%6e", value());
00062             return(TCL_OK);
00063         }
00064     }
00065     if (argc == 3) {
00066         if (strcmp(argv[1], "use-rng") == 0) {
00067             rng_ = (RNG*)TclObject::lookup(argv[2]);
00068             if (rng_ == 0) {
00069                 tcl.resultf("no such RNG %s", argv[2]);
00070                 return(TCL_ERROR);
00071             }
00072             return(TCL_OK);
00073         }
00074     }
00075     return(TclObject::command(argc, argv));
00076 }

Here is the call graph for this function:

int RandomVariable::seed char *   )  [inherited]
 

Definition at line 83 of file ranvar.cc.

References RandomVariable::rng_.

Referenced by EXPOO_Traffic::command().

00083                                 {
00084         
00085         Tcl& tcl = Tcl::instance();
00086 
00087                 rng_ = (RNG*)TclObject::lookup(x);
00088                 if (rng_ == 0) {
00089                         tcl.resultf("no such RNG %s", x);
00090                         return(TCL_ERROR);
00091                 }
00092                 return(TCL_OK);
00093  
00094 }

void LogNormalRandomVariable::setavg double  d  )  [inline]
 

Definition at line 153 of file ranvar.h.

References avg_.

00153 { avg_ = d; };

void LogNormalRandomVariable::setstd double  d  )  [inline]
 

Definition at line 154 of file ranvar.h.

References std_.

00154 { std_ = d; };

double LogNormalRandomVariable::std  )  [inline]
 

Definition at line 152 of file ranvar.h.

References std_.

00152 { return std_; };

double* LogNormalRandomVariable::stdp  )  [inline]
 

Definition at line 150 of file ranvar.h.

References std_.

00150 { return &std_; };

double LogNormalRandomVariable::value  )  [virtual]
 

Implements RandomVariable.

Definition at line 238 of file ranvar.cc.

References avg_, RNG::lognormal(), RandomVariable::rng_, and std_.

00239 {
00240         return(rng_->lognormal(avg_, std_));
00241 }

Here is the call graph for this function:


Field Documentation

double LogNormalRandomVariable::avg_ [private]
 

Definition at line 154 of file ranvar.h.

Referenced by avg(), avgp(), LogNormalRandomVariable(), setavg(), and value().

RNG* RandomVariable::rng_ [protected, inherited]
 

Definition at line 64 of file ranvar.h.

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

double LogNormalRandomVariable::std_ [private]
 

Definition at line 157 of file ranvar.h.

Referenced by LogNormalRandomVariable(), setstd(), std(), stdp(), and value().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:12:50 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6