25 #ifndef PROPAGATION_LOSS_MODEL_H
26 #define PROPAGATION_LOSS_MODEL_H
28 #include "ns3/object.h"
29 #include "ns3/random-variable-stream.h"
314 double DbmToW (
double dbm)
const;
424 double DbmToW (
double dbm)
const;
489 void SetReference (
double referenceDistance,
double referenceLoss);
a Friis propagation loss model
double m_lambda
the carrier wavelength
double DbmFromW(double w) const
Transforms a Watt value to Dbm.
double GetFrequency(void) const
double m_frequency
the carrier frequency
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
void SetSystemLoss(double systemLoss)
void SetFrequency(double frequency)
FriisPropagationLossModel(const FriisPropagationLossModel &)=delete
double DbmToW(double dbm) const
Transforms a Dbm value to Watt.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
static TypeId GetTypeId(void)
Get the type ID.
double GetMinLoss(void) const
double GetSystemLoss(void) const
FriisPropagationLossModel & operator=(const FriisPropagationLossModel &)=delete
FriisPropagationLossModel()
void SetMinLoss(double minLoss)
double m_systemLoss
the system loss
double m_minLoss
the minimum loss
a log distance propagation model.
LogDistancePropagationLossModel(const LogDistancePropagationLossModel &)=delete
static Ptr< PropagationLossModel > CreateDefaultReference(void)
Creates a default reference loss model.
double m_referenceDistance
reference distance
void SetReference(double referenceDistance, double referenceLoss)
Set the reference path loss at a given distance.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
LogDistancePropagationLossModel & operator=(const LogDistancePropagationLossModel &)=delete
LogDistancePropagationLossModel()
double m_exponent
model exponent
double GetPathLossExponent(void) const
static TypeId GetTypeId(void)
Get the type ID.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_referenceLoss
reference loss
void SetPathLossExponent(double n)
The propagation loss is fixed for each pair of nodes and doesn't depend on their actual positions.
void SetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, double loss, bool symmetric=true)
Set loss (in dB, positive) between pair of ns-3 objects (typically, nodes).
void SetDefaultLoss(double defaultLoss)
Set the default propagation loss (in dB, positive) to be used, infinity if not set.
MatrixPropagationLossModel()
static TypeId GetTypeId(void)
Get the type ID.
MatrixPropagationLossModel(const MatrixPropagationLossModel &)=delete
MatrixPropagationLossModel & operator=(const MatrixPropagationLossModel &)=delete
virtual ~MatrixPropagationLossModel()
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_default
default loss
std::pair< Ptr< MobilityModel >, Ptr< MobilityModel > > MobilityPair
Typedef: Mobility models pair.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
std::map< MobilityPair, double > m_loss
Propagation loss between pair of nodes.
Nakagami-m fast fading propagation loss model.
Ptr< ErlangRandomVariable > m_erlangRandomVariable
Erlang random variable.
double m_m0
m for distances smaller than Distance1
NakagamiPropagationLossModel(const NakagamiPropagationLossModel &)=delete
Ptr< GammaRandomVariable > m_gammaRandomVariable
Gamma random variable.
double m_distance1
Distance1.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_distance2
Distance2.
NakagamiPropagationLossModel()
static TypeId GetTypeId(void)
Get the type ID.
NakagamiPropagationLossModel & operator=(const NakagamiPropagationLossModel &)=delete
double m_m1
m for distances smaller than Distance2
double m_m2
m for distances greater than Distance2
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
A base class which provides memory management and object aggregation.
Models the propagation loss through a transmission medium.
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
PropagationLossModel & operator=(const PropagationLossModel &)=delete
Ptr< PropagationLossModel > m_next
Next propagation loss model in the list.
double CalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account all the PropagationLossModel(s) chained to the current one.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
PropagationLossModel.
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
void SetNext(Ptr< PropagationLossModel > next)
Enables a chain of loss models to act on the signal.
PropagationLossModel(const PropagationLossModel &)=delete
static TypeId GetTypeId(void)
Get the type ID.
virtual ~PropagationLossModel()
Ptr< PropagationLossModel > GetNext()
Gets the next PropagationLossModel in the chain of loss models that act on the signal.
The propagation loss follows a random distribution.
RandomPropagationLossModel()
static TypeId GetTypeId(void)
Get the type ID.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
Ptr< RandomVariableStream > m_variable
random generator
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
RandomPropagationLossModel & operator=(const RandomPropagationLossModel &)=delete
virtual ~RandomPropagationLossModel()
RandomPropagationLossModel(const RandomPropagationLossModel &)=delete
The propagation loss depends only on the distance (range) between transmitter and receiver.
RangePropagationLossModel()
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId(void)
Get the type ID.
RangePropagationLossModel(const RangePropagationLossModel &)=delete
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
RangePropagationLossModel & operator=(const RangePropagationLossModel &)=delete
double m_range
Maximum Transmission Range (meters)
A log distance path loss propagation model with three distance fields.
double m_referenceLoss
The reference loss at distance d0 (dB).
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_distance0
Beginning of the first (near) distance field.
double m_distance2
Beginning of the third (far) distance field.
ThreeLogDistancePropagationLossModel & operator=(const ThreeLogDistancePropagationLossModel &)=delete
ThreeLogDistancePropagationLossModel(const ThreeLogDistancePropagationLossModel &)=delete
double m_exponent2
The exponent for the third field.
double m_distance1
Beginning of the second (middle) distance field.
static TypeId GetTypeId(void)
Get the type ID.
ThreeLogDistancePropagationLossModel()
double m_exponent0
The exponent for the first field.
double m_exponent1
The exponent for the second field.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
a Two-Ray Ground propagation loss model ported from NS2
double DbmToW(double dbm) const
Transforms a Dbm value to Watt.
double m_minDistance
minimum distance for the model
double GetMinDistance(void) const
double m_heightAboveZ
antenna height above the node's Z coordinate
TwoRayGroundPropagationLossModel()
double DbmFromW(double w) const
Transforms a Watt value to Dbm.
void SetSystemLoss(double systemLoss)
void SetMinDistance(double minDistance)
double GetSystemLoss(void) const
void SetFrequency(double frequency)
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_systemLoss
the system loss
static TypeId GetTypeId(void)
Get the type ID.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
TwoRayGroundPropagationLossModel(const TwoRayGroundPropagationLossModel &)=delete
TwoRayGroundPropagationLossModel & operator=(const TwoRayGroundPropagationLossModel &)=delete
double m_frequency
the carrier frequency
void SetHeightAboveZ(double heightAboveZ)
double m_lambda
the carrier wavelength
double GetFrequency(void) const
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.