#include <shadowing.h>
Inheritance diagram for Shadowing:


Public Member Functions | |
| Shadowing () | |
| ~Shadowing () | |
| virtual double | Pr (PacketStamp *tx, PacketStamp *rx, WirelessPhy *ifp) |
| virtual int | command (int argc, const char *const *argv) |
| virtual double | Pr (PacketStamp *tx, PacketStamp *rx, Phy *) |
| double | Friis (double Pt, double Gt, double Gr, double lambda, double L, double d) |
Protected Attributes | |
| RNG * | ranVar |
| double | pathlossExp_ |
| double | std_db_ |
| double | dist0_ |
| int | seed_ |
| char * | name |
| Topography * | topo |
|
|
Definition at line 48 of file shadowing.cc. References dist0_, pathlossExp_, RNG::PREDEF_SEED_SOURCE, ranVar, seed_, RNG::set_seed(), and std_db_.
|
Here is the call graph for this function:

|
|
Definition at line 60 of file shadowing.cc. References ranVar.
00061 {
00062 delete ranVar;
00063 }
|
|
||||||||||||
|
Reimplemented from Propagation. Definition at line 111 of file shadowing.cc. References Propagation::command(), RNG::HEURISTIC_SEED_SOURCE, RNG::PREDEF_SEED_SOURCE, ranVar, RNG::RAW_SEED_SOURCE, and RNG::set_seed().
00112 {
00113 if (argc == 4) {
00114 if (strcmp(argv[1], "seed") == 0) {
00115 int s = atoi(argv[3]);
00116 if (strcmp(argv[2], "raw") == 0) {
00117 ranVar->set_seed(RNG::RAW_SEED_SOURCE, s);
00118 } else if (strcmp(argv[2], "predef") == 0) {
00119 ranVar->set_seed(RNG::PREDEF_SEED_SOURCE, s);
00120 // s is the index in predefined seed array
00121 // 0 <= s < 64
00122 } else if (strcmp(argv[2], "heuristic") == 0) {
00123 ranVar->set_seed(RNG::HEURISTIC_SEED_SOURCE, 0);
00124 }
00125 return(TCL_OK);
00126 }
00127 }
00128
00129 return Propagation::command(argc, argv);
00130 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
Definition at line 92 of file propagation.cc. Referenced by TwoRayGround::Pr(), Pr(), and FreeSpace::Pr().
|
|
||||||||||||||||
|
Definition at line 72 of file propagation.cc. References abort(), and Propagation::name. Referenced by WirelessPhy::sendUp().
00073 {
00074 fprintf(stderr,"Propagation model %s not implemented for generic NetIF\n",
00075 name);
00076 abort();
00077 return 0; // Make msvc happy
00078 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Reimplemented from Propagation. Definition at line 66 of file shadowing.cc. References dist0_, Propagation::Friis(), PacketStamp::getAntenna(), WirelessPhy::getL(), WirelessPhy::getLambda(), MobileNode::getLoc(), PacketStamp::getNode(), Antenna::getRxGain(), Antenna::getTxGain(), PacketStamp::getTxPr(), Antenna::getX(), Antenna::getY(), Antenna::getZ(), RNG::normal(), pathlossExp_, pow(), Pr(), ranVar, and std_db_. Referenced by Pr(), and ShadowingVis::Pr().
00067 {
00068 double L = ifp->getL(); // system loss
00069 double lambda = ifp->getLambda(); // wavelength
00070
00071 double Xt, Yt, Zt; // loc of transmitter
00072 double Xr, Yr, Zr; // loc of receiver
00073
00074 t->getNode()->getLoc(&Xt, &Yt, &Zt);
00075 r->getNode()->getLoc(&Xr, &Yr, &Zr);
00076
00077 // Is antenna position relative to node position?
00078 Xr += r->getAntenna()->getX();
00079 Yr += r->getAntenna()->getY();
00080 Zr += r->getAntenna()->getZ();
00081 Xt += t->getAntenna()->getX();
00082 Yt += t->getAntenna()->getY();
00083 Zt += t->getAntenna()->getZ();
00084
00085 double dX = Xr - Xt;
00086 double dY = Yr - Yt;
00087 double dZ = Zr - Zt;
00088 double dist = sqrt(dX * dX + dY * dY + dZ * dZ);
00089
00090 // get antenna gain
00091 double Gt = t->getAntenna()->getTxGain(dX, dY, dZ, lambda);
00092 double Gr = r->getAntenna()->getRxGain(dX, dY, dZ, lambda);
00093
00094 // calculate receiving power at reference distance
00095 double Pr0 = Friis(t->getTxPr(), Gt, Gr, lambda, L, dist0_);
00096
00097 // calculate average power loss predicted by path loss model
00098 double avg_db = -10.0 * pathlossExp_ * log10(dist/dist0_);
00099
00100 // get power loss by adding a log-normal random variable (shadowing)
00101 // the power loss is relative to that at reference distance dist0_
00102 double powerLoss_db = avg_db + ranVar->normal(0.0, std_db_);
00103
00104 // calculate the receiving power at dist
00105 double Pr = Pr0 * pow(10.0, powerLoss_db/10.0);
00106
00107 return Pr;
00108 }
|
Here is the call graph for this function:

|
|
Definition at line 46 of file shadowing.h. Referenced by Pr(), and Shadowing(). |
|
|
Definition at line 90 of file propagation.h. Referenced by Propagation::Pr(), and Propagation::Propagation(). |
|
|
Definition at line 44 of file shadowing.h. Referenced by Pr(), and Shadowing(). |
|
|
Definition at line 42 of file shadowing.h. Referenced by command(), Pr(), Shadowing(), and ~Shadowing(). |
|
|
Definition at line 47 of file shadowing.h. Referenced by Shadowing(). |
|
|
Definition at line 45 of file shadowing.h. Referenced by Pr(), and Shadowing(). |
|
|
Definition at line 91 of file propagation.h. Referenced by Propagation::command(), and Propagation::Propagation(). |
1.3.3