#include <IdealObstacleLoss.h>
◆ IdealObstacleLoss()
| inet::physicallayer::IdealObstacleLoss::IdealObstacleLoss |
( |
| ) |
|
◆ computeObstacleLoss()
| double inet::physicallayer::IdealObstacleLoss::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.
59 TotalObstacleLossComputation obstacleLossVisitor(
this, transmissionPosition, receptionPosition);
60 physicalEnvironment->visitObjects(&obstacleLossVisitor, LineSegment(transmissionPosition, receptionPosition));
61 return obstacleLossVisitor.isObstacleFound() ? 0 : 1;
◆ initialize()
| void inet::physicallayer::IdealObstacleLoss::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
30 medium = check_and_cast<IRadioMedium *>(getParentModule());
◆ isObstacle()
42 const ShapeBase *shape =
object->getShape();
43 const Coord& position =
object->getPosition();
44 const Quaternion& orientation =
object->getOrientation();
45 RotationMatrix rotation(orientation.toEulerAngles());
46 const LineSegment lineSegment(rotation.rotateVectorInverse(transmissionPosition - position), rotation.rotateVectorInverse(receptionPosition - position));
47 Coord intersection1, intersection2, normal1, normal2;
48 bool hasIntersections = shape->computeIntersection(lineSegment, intersection1, intersection2, normal1, normal2);
49 bool isObstacle = hasIntersections && intersection1 != intersection2;
51 ObstaclePenetratedEvent event(
object, intersection1, intersection2, normal1, normal2,
isObstacle ? 1 : 0);
◆ printToStream()
| std::ostream & inet::physicallayer::IdealObstacleLoss::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level, |
|
|
int |
evFlags = 0 |
|
) |
| const |
|
overridevirtual |
Prints this object to the provided output stream.
Reimplemented from inet::IPrintableObject.
37 return stream <<
"IdealObstacleLoss";
◆ medium
| IRadioMedium* inet::physicallayer::IdealObstacleLoss::medium = nullptr |
|
protected |
The radio medium where the radio signal propagation takes place.
◆ physicalEnvironment
The physical environment that provides to obstacles.
The documentation for this class was generated from the following files: