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


Public Member Functions | |
| virtual double | value () |
| HyperExponentialRandomVariable () | |
| HyperExponentialRandomVariable (double, double) | |
| double * | avgp () |
| double * | covp () |
| virtual double | avg () |
| double | cov () |
| void | setavg (double d) |
| void | setcov (double d) |
| int | command (int argc, const char *const *argv) |
| int | seed (char *) |
Protected Attributes | |
| RNG * | rng_ |
Private Attributes | |
| double | avg_ |
| double | cov_ |
| double | alpha_ |
|
|
Definition at line 257 of file ranvar.cc. References alpha_, avg_, and cov_.
00258 {
00259 bind("avg_", &avg_);
00260 bind("cov_", &cov_);
00261 alpha_ = .95;
00262 }
|
|
||||||||||||
|
Definition at line 264 of file ranvar.cc. References alpha_, avg_, and cov_.
|
|
|
Implements RandomVariable. Definition at line 157 of file ranvar.h. References avg_.
00157 { return avg_; };
|
|
|
Definition at line 155 of file ranvar.h. References avg_.
00155 { 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 158 of file ranvar.h. References cov_.
00158 { return cov_; };
|
|
|
Definition at line 156 of file ranvar.h. References cov_.
00156 { return &cov_; };
|
|
|
Definition at line 60 of file ranvar.cc. References RandomVariable::rng_. Referenced by EXPOO_Traffic::command().
|
|
|
Definition at line 159 of file ranvar.h. References avg_.
00159 { avg_ = d; };
|
|
|
Definition at line 160 of file ranvar.h. References cov_.
00160 { cov_ = d; };
|
|
|
Implements RandomVariable. Definition at line 271 of file ranvar.cc. References alpha_, avg_, cov_, Random::exponential(), and Random::uniform().
00272 {
00273 double temp, res;
00274 double u = Random::uniform();
00275
00276 temp = sqrt((cov_ * cov_ - 1.0)/(2.0 * alpha_ * (1.0 - alpha_)));
00277 if (u < alpha_)
00278 res = Random::exponential(avg_ - temp * (1.0 - alpha_) * avg_);
00279 else
00280 res = Random::exponential(avg_ + temp * (alpha_) * avg_);
00281 return(res);
00282 }
|
Here is the call graph for this function:

|
|
Definition at line 164 of file ranvar.h. Referenced by HyperExponentialRandomVariable(), and value(). |
|
|
Definition at line 162 of file ranvar.h. Referenced by avg(), avgp(), HyperExponentialRandomVariable(), setavg(), and value(). |
|
|
Definition at line 163 of file ranvar.h. Referenced by cov(), covp(), HyperExponentialRandomVariable(), setcov(), and value(). |
|
1.3.3