|
INET Framework for OMNeT++/OMNEST
|
This class computes obstacle loss based on the actual straight path that the radio signal travels from the transmitter to the receiver.
More...
#include <DielectricObstacleLoss.h>
|
| unsigned int | intersectionComputationCount |
| | Total number of obstacle intersection computations. More...
|
| |
| unsigned int | intersectionCount |
| | Total number of actual obstacle intersections. More...
|
| |
| virtual int | numInitStages () const override |
| |
| virtual void | initialize (int stage) override |
| |
| virtual void | finish () override |
| |
| virtual double | computeDielectricLoss (const physicalenvironment::IMaterial *material, Hz frequency, m distance) const |
| |
| virtual double | computeReflectionLoss (const physicalenvironment::IMaterial *incidentMaterial, const physicalenvironment::IMaterial *refractiveMaterial, double angle) const |
| |
| virtual double | computeObjectLoss (const physicalenvironment::IPhysicalObject *object, Hz frequency, const Coord &transmissionPosition, const Coord &receptionPosition) const |
| |
| | DielectricObstacleLoss () |
| |
| virtual std::ostream & | printToStream (std::ostream &stream, int level, int evFlags=0) const override |
| | Prints this object to the provided output stream. More...
|
| |
| virtual double | computeObstacleLoss (Hz frequency, const Coord &transmissionPosition, const Coord &receptionPosition) const override |
| | Returns the obstacle loss factor caused by physical objects present in the environment as a function of frequency, transmission position, and reception position. More...
|
| |
This class computes obstacle loss based on the actual straight path that the radio signal travels from the transmitter to the receiver.
The total loss is the combination of the dielectric losses in the intersected obstacles and the reflection losses of the penetrated faces along this path.
◆ DielectricObstacleLoss()
| inet::physicallayer::DielectricObstacleLoss::DielectricObstacleLoss |
( |
| ) |
|
◆ computeDielectricLoss()
56 double lossTangent = material->getDielectricLossTangent(frequency);
57 mps propagationSpeed = material->getPropagationSpeed();
58 double factor = std::exp(-atan(lossTangent) *
unit(2 *
M_PI * frequency * distance / propagationSpeed).get());
59 ASSERT(0 <= factor && factor <= 1);
Referenced by computeObjectLoss().
◆ computeObjectLoss()
86 const ShapeBase *shape =
object->getShape();
87 const Coord& position =
object->getPosition();
88 const Quaternion& orientation =
object->getOrientation();
89 RotationMatrix rotation(orientation.toEulerAngles());
90 const LineSegment lineSegment(rotation.rotateVectorInverse(transmissionPosition - position), rotation.rotateVectorInverse(receptionPosition - position));
91 Coord intersection1, intersection2, normal1, normal2;
93 bool hasIntersections = shape->computeIntersection(lineSegment, intersection1, intersection2, normal1, normal2);
94 if (hasIntersections && (intersection1 != intersection2)) {
96 const IMaterial *material =
object->getMaterial();
98 double intersectionDistance = intersection2.distance(intersection1);
102 double angle1 = (intersection1 - intersection2).angle(normal1);
103 if (!std::isnan(angle1))
112 ObstaclePenetratedEvent event(
object, intersection1, intersection2, normal1, normal2, totalLoss);
◆ computeObstacleLoss()
| double inet::physicallayer::DielectricObstacleLoss::computeObstacleLoss |
( |
Hz |
frequency, |
|
|
const Coord & |
transmissionPosition, |
|
|
const Coord & |
receptionPosition |
|
) |
| const |
|
overridevirtual |
Returns the obstacle loss factor caused by physical objects present in the environment as a function of frequency, transmission position, and reception position.
The value is in the range [0, 1] where 1 means no loss at all and 0 means all power is lost.
Implements inet::physicallayer::IObstacleLoss.
120 double totalLoss = 1;
121 TotalObstacleLossComputation obstacleLossVisitor(
this, frequency, transmissionPosition, receptionPosition);
122 physicalEnvironment->visitObjects(&obstacleLossVisitor, LineSegment(transmissionPosition, receptionPosition));
123 totalLoss = obstacleLossVisitor.getTotalLoss();
◆ computeReflectionLoss()
66 double n1 = incidentMaterial->getRefractiveIndex();
67 double n2 = refractiveMaterial->getRefractiveIndex();
68 double st =
sin(angle);
69 double ct =
cos(angle);
70 double n1ct = n1 * ct;
71 double n2ct = n2 * ct;
72 double k =
sqrt(1 - pow(n1 / n2 * st, 2));
75 double rs = pow((n1ct - n2k) / (n1ct + n2k), 2);
76 double rp = pow((n1k - n2ct) / (n1k + n2ct), 2);
77 double r = (rs + rp) / 2;
78 double transmittance = 1 - r;
79 ASSERT(0 <= transmittance && transmittance <= 1);
Referenced by computeObjectLoss().
◆ finish()
| void inet::physicallayer::DielectricObstacleLoss::finish |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ initialize()
| void inet::physicallayer::DielectricObstacleLoss::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
35 medium = check_and_cast<IRadioMedium *>(getParentModule());
◆ numInitStages()
| virtual int inet::physicallayer::DielectricObstacleLoss::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ printToStream()
| std::ostream & inet::physicallayer::DielectricObstacleLoss::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level, |
|
|
int |
evFlags = 0 |
|
) |
| const |
|
overridevirtual |
Prints this object to the provided output stream.
Reimplemented from inet::IPrintableObject.
50 return stream <<
"DielectricObstacleLoss";
◆ enableDielectricLoss
| bool inet::physicallayer::DielectricObstacleLoss::enableDielectricLoss = false |
|
protected |
◆ enableReflectionLoss
| bool inet::physicallayer::DielectricObstacleLoss::enableReflectionLoss = false |
|
protected |
◆ intersectionComputationCount
| unsigned int inet::physicallayer::DielectricObstacleLoss::intersectionComputationCount |
|
mutableprotected |
◆ intersectionCount
| unsigned int inet::physicallayer::DielectricObstacleLoss::intersectionCount |
|
mutableprotected |
◆ medium
| IRadioMedium* inet::physicallayer::DielectricObstacleLoss::medium |
|
protected |
◆ physicalEnvironment
The documentation for this class was generated from the following files:
unsigned int intersectionComputationCount
Total number of obstacle intersection computations.
Definition: DielectricObstacleLoss.h:66
static simsignal_t obstaclePenetratedSignal
Definition: ITracingObstacleLoss.h:35
compose< m, pow< s, -1 > > mps
Definition: Units.h:1151
bool enableDielectricLoss
Definition: DielectricObstacleLoss.h:49
ModuleRefByPar< physicalenvironment::IPhysicalEnvironment > physicalEnvironment
The physical environment that provides to obstacles.
Definition: DielectricObstacleLoss.h:58
Definition: IMaterial.h:20
virtual double computeReflectionLoss(const physicalenvironment::IMaterial *incidentMaterial, const physicalenvironment::IMaterial *refractiveMaterial, double angle) const
Definition: DielectricObstacleLoss.cc:63
Value cos(const value< Value, Unit > &angle)
Definition: Units.h:1524
value< Value, pow< Unit, 1, 2 > > sqrt(const value< Value, Unit > &a)
Definition: Units.h:272
bool enableReflectionLoss
Definition: DielectricObstacleLoss.h:50
virtual double computeDielectricLoss(const physicalenvironment::IMaterial *material, Hz frequency, m distance) const
Definition: DielectricObstacleLoss.cc:53
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
IRadioMedium * medium
The radio medium where the radio signal propagation takes place.
Definition: DielectricObstacleLoss.h:54
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
pow< internal::none, 0 > unit
Definition: Units.h:72
const double k
Definition: Qam1024Modulation.cc:14
DielectricObstacleLoss()
Definition: DielectricObstacleLoss.cc:23
virtual const physicalenvironment::IMaterial * getMaterial() const =0
Returns the material of this medium.
value< double, units::m > m
Definition: Units.h:1233
#define M_PI
Definition: INETMath.h:52
unsigned int intersectionCount
Total number of actual obstacle intersections.
Definition: DielectricObstacleLoss.h:70
Value sin(const value< Value, Unit > &angle)
Definition: Units.h:1518