#include <IdealObstacleLoss.h>
inet::physicallayer::IdealObstacleLoss::IdealObstacleLoss |
( |
| ) |
|
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.
66 TotalObstacleLossComputation obstacleLossVisitor(
this, transmissionPosition, receptionPosition);
68 return obstacleLossVisitor.isObstacleFound() ? 0 : 1;
virtual void visitObjects(const IVisitor *visitor, const LineSegment &lineSegment) const =0
IPhysicalEnvironment * physicalEnvironment
The physical environment that provides to obstacles.
Definition: IdealObstacleLoss.h:57
void inet::physicallayer::IdealObstacleLoss::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
37 medium = check_and_cast<IRadioMedium *>(getParentModule());
38 physicalEnvironment = getModuleFromPar<IPhysicalEnvironment>(par(
"physicalEnvironmentModule"),
this);
IPhysicalEnvironment * physicalEnvironment
The physical environment that provides to obstacles.
Definition: IdealObstacleLoss.h:57
Local initializations.
Definition: InitStages.h:35
IRadioMedium * medium
The radio medium where the radio signal propagation takes place.
Definition: IdealObstacleLoss.h:53
bool inet::physicallayer::IdealObstacleLoss::isObstacle |
( |
const IPhysicalObject * |
object, |
|
|
const Coord & |
transmissionPosition, |
|
|
const Coord & |
receptionPosition |
|
) |
| const |
|
protectedvirtual |
Referenced by inet::physicallayer::IdealObstacleLoss::TotalObstacleLossComputation::visit().
49 const ShapeBase *shape =
object->getShape();
50 const Coord& position =
object->getPosition();
51 const EulerAngles& orientation =
object->getOrientation();
52 Rotation rotation(orientation);
53 const LineSegment lineSegment(rotation.rotateVectorCounterClockwise(transmissionPosition - position), rotation.rotateVectorCounterClockwise(receptionPosition - position));
54 Coord intersection1, intersection2, normal1, normal2;
55 bool hasIntersections = shape->computeIntersection(lineSegment, intersection1, intersection2, normal1, normal2);
56 bool isObstacle = hasIntersections && intersection1 != intersection2;
58 ObstaclePenetratedEvent event(
object, intersection1, intersection2, normal1, normal2, isObstacle ? 1 : 0);
static simsignal_t obstaclePenetratedSignal
Definition: ITracingObstacleLoss.h:48
IdealObstacleLoss()
Definition: IdealObstacleLoss.cc:30
virtual bool isObstacle(const IPhysicalObject *object, const Coord &transmissionPosition, const Coord &receptionPosition) const
Definition: IdealObstacleLoss.cc:47
std::ostream & inet::physicallayer::IdealObstacleLoss::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level |
|
) |
| const |
|
overridevirtual |
Prints this object to the provided output stream.
Function calls to operator<< with pointers or references either const or not are all forwarded to this function.
Reimplemented from inet::physicallayer::IPrintableObject.
44 return stream <<
"IdealObstacleLoss";
IRadioMedium* inet::physicallayer::IdealObstacleLoss::medium = nullptr |
|
protected |
The radio medium where the radio signal propagation takes place.
Referenced by initialize().
The documentation for this class was generated from the following files: