25 #ifndef PROPAGATION_LOSS_MODEL_H
26 #define PROPAGATION_LOSS_MODEL_H
28 #include "ns3/object.h"
29 #include "ns3/random-variable-stream.h"
331 double DbmToW (
double dbm)
const;
451 double DbmToW (
double dbm)
const;
512 void SetReference (
double referenceDistance,
double referenceLoss);
a Friis propagation loss model
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
double m_lambda
the carrier wavelength
double DbmFromW(double w) const
Transforms a Watt value to Dbm.
double GetFrequency(void) const
FriisPropagationLossModel & operator=(const FriisPropagationLossModel &)
Copy constructor.
double m_frequency
the carrier frequency
void SetSystemLoss(double systemLoss)
void SetFrequency(double frequency)
double DbmToW(double dbm) const
Transforms a Dbm value to Watt.
static TypeId GetTypeId(void)
Get the type ID.
double GetMinLoss(void) const
double GetSystemLoss(void) const
FriisPropagationLossModel(const FriisPropagationLossModel &)
Copy constructor.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
FriisPropagationLossModel()
void SetMinLoss(double minLoss)
double m_systemLoss
the system loss
double m_minLoss
the minimum loss
a log distance propagation model.
LogDistancePropagationLossModel & operator=(const LogDistancePropagationLossModel &)
Copy constructor.
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.
LogDistancePropagationLossModel()
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
double m_exponent
model exponent
double GetPathLossExponent(void) const
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
static TypeId GetTypeId(void)
Get the type ID.
LogDistancePropagationLossModel(const LogDistancePropagationLossModel &)
Copy constructor.
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.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
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.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
virtual ~MatrixPropagationLossModel()
MatrixPropagationLossModel(const MatrixPropagationLossModel &)
Copy constructor.
double m_default
default loss
std::pair< Ptr< MobilityModel >, Ptr< MobilityModel > > MobilityPair
Typedef: Mobility models pair.
MatrixPropagationLossModel & operator=(const MatrixPropagationLossModel &)
Copy constructor.
std::map< MobilityPair, double > m_loss
Propagation loss between pair of nodes.
Nakagami-m fast fading propagation loss model.
NakagamiPropagationLossModel & operator=(const NakagamiPropagationLossModel &)
Copy constructor.
Ptr< ErlangRandomVariable > m_erlangRandomVariable
Erlang random variable.
double m_m0
m for distances smaller than Distance1
Ptr< GammaRandomVariable > m_gammaRandomVariable
Gamma random variable.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
double m_distance1
Distance1.
NakagamiPropagationLossModel(const NakagamiPropagationLossModel &)
Copy constructor.
double m_distance2
Distance2.
NakagamiPropagationLossModel()
static TypeId GetTypeId(void)
Get the type ID.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
double m_m1
m for distances smaller than Distance2
double m_m2
m for distances greater than Distance2
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
Subclasses must implement this; those not using random variables can return zero.
PropagationLossModel(const PropagationLossModel &)
Copy constructor.
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
Returns the Rx Power taking into account only the particular PropagationLossModel.
PropagationLossModel & operator=(const PropagationLossModel &)
Copy constructor.
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.
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()
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
static TypeId GetTypeId(void)
Get the type ID.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
RandomPropagationLossModel(const RandomPropagationLossModel &)
Copy constructor.
Ptr< RandomVariableStream > m_variable
random generator
RandomPropagationLossModel & operator=(const RandomPropagationLossModel &)
Copy constructor.
virtual ~RandomPropagationLossModel()
The propagation loss depends only on the distance (range) between transmitter and receiver.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
RangePropagationLossModel()
static TypeId GetTypeId(void)
Get the type ID.
RangePropagationLossModel & operator=(const RangePropagationLossModel &)
Copy constructor.
RangePropagationLossModel(const RangePropagationLossModel &)
Copy constructor.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
double m_range
Maximum Transmission Range (meters)
A log distance path loss propagation model with three distance fields.
ThreeLogDistancePropagationLossModel & operator=(const ThreeLogDistancePropagationLossModel &)
Copy constructor.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
double m_referenceLoss
The reference loss at distance d0 (dB).
double m_distance0
Beginning of the first (near) distance field.
double m_distance2
Beginning of the third (far) distance field.
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.
ThreeLogDistancePropagationLossModel(const ThreeLogDistancePropagationLossModel &)
Copy constructor.
double m_exponent1
The exponent for the second field.
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
TwoRayGroundPropagationLossModel(const TwoRayGroundPropagationLossModel &)
Copy constructor.
double GetMinDistance(void) const
double m_heightAboveZ
antenna height above the node's Z coordinate
TwoRayGroundPropagationLossModel()
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
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)
double m_systemLoss
the system loss
static TypeId GetTypeId(void)
Get the type ID.
TwoRayGroundPropagationLossModel & operator=(const TwoRayGroundPropagationLossModel &)
Copy constructor.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero.
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.