#include <ranvar.h>
Inheritance diagram for ParetoRandomVariable:


Public Member Functions | |
| virtual double | value () |
| ParetoRandomVariable () | |
| ParetoRandomVariable (double, double) | |
| double * | avgp () |
| double * | shapep () |
| virtual double | avg () |
| double | shape () |
| void | setavg (double d) |
| void | setshape (double d) |
| int | command (int argc, const char *const *argv) |
| int | seed (char *) |
Protected Attributes | |
| RNG * | rng_ |
Private Attributes | |
| double | avg_ |
| double | shape_ |
| double | scale_ |
|
|
Definition at line 132 of file ranvar.cc.
00133 {
00134 bind("avg_", &avg_);
00135 bind("shape_", &shape_);
00136 }
|
|
||||||||||||
|
Definition at line 138 of file ranvar.cc.
|
|
|
Implements RandomVariable. Definition at line 80 of file ranvar.h. References avg_.
00080 { return avg_; };
|
|
|
Definition at line 78 of file ranvar.h. References avg_.
00078 { return &avg_; };
|
|
||||||||||||
|
Reimplemented in EmpiricalRandomVariable. Definition at line 32 of file ranvar.cc. References RandomVariable::rng_, and RandomVariable::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:

|
|
Definition at line 60 of file ranvar.cc. References RandomVariable::rng_. Referenced by EXPOO_Traffic::command().
|
|
|
Definition at line 82 of file ranvar.h. References avg_.
00082 { avg_ = d; };
|
|
|
Definition at line 83 of file ranvar.h. References shape_.
00083 { shape_ = d; };
|
|
|
Definition at line 81 of file ranvar.h. References shape_.
00081 { return shape_; };
|
|
|
Definition at line 79 of file ranvar.h. References shape_.
00079 { return &shape_; };
|
|
|
Implements RandomVariable. Definition at line 144 of file ranvar.cc. References avg_, RNG::pareto(), RandomVariable::rng_, and shape_.
00145 {
00146 /* yuck, user wants to specify shape and avg, but the
00147 * computation here is simpler if we know the 'scale'
00148 * parameter. right thing is to probably do away with
00149 * the use of 'bind' and provide an API such that we
00150 * can update the scale everytime the user updates shape
00151 * or avg.
00152 */
00153 return(rng_->pareto(avg_ * (shape_ -1)/shape_, shape_));
00154 }
|
Here is the call graph for this function:

|
|
Definition at line 85 of file ranvar.h. Referenced by avg(), avgp(), ParetoRandomVariable(), setavg(), and value(). |
|
|
|
|
|
|
Definition at line 86 of file ranvar.h. Referenced by ParetoRandomVariable(), setshape(), shape(), shapep(), and value(). |
1.3.3