[Doxygen] propagation module fixes

This commit is contained in:
Tommaso Pecorella
2014-10-03 22:41:44 +02:00
parent 4943ed3c70
commit a49957015e
14 changed files with 560 additions and 159 deletions

View File

@@ -55,13 +55,13 @@ Cost231PropagationLossModel::GetTypeId (void)
MakeDoubleChecker<double> ())
.AddAttribute ("BSAntennaHeight",
" BS Antenna Height (default is 50m).",
"BS Antenna Height (default is 50m).",
DoubleValue (50.0),
MakeDoubleAccessor (&Cost231PropagationLossModel::m_BSAntennaHeight),
MakeDoubleChecker<double> ())
.AddAttribute ("SSAntennaHeight",
" SS Antenna Height (default is 3m).",
"SS Antenna Height (default is 3m).",
DoubleValue (3),
MakeDoubleAccessor (&Cost231PropagationLossModel::m_SSAntennaHeight),
MakeDoubleChecker<double> ())
@@ -76,7 +76,6 @@ Cost231PropagationLossModel::GetTypeId (void)
Cost231PropagationLossModel::Cost231PropagationLossModel ()
{
C = 0;
m_shadowing = 10;
}
@@ -146,17 +145,6 @@ Cost231PropagationLossModel::GetSSAntennaHeight (void) const
return m_SSAntennaHeight;
}
void
Cost231PropagationLossModel::SetEnvironment (Environment env)
{
m_environment = env;
}
Cost231PropagationLossModel::Environment
Cost231PropagationLossModel::GetEnvironment (void) const
{
return m_environment;
}
double
Cost231PropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
{
@@ -178,7 +166,7 @@ Cost231PropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b
// Ch. 4, eq. 4.4.3, pg. 135
double loss_in_db = 46.3 + (33.9 * std::log10(frequency_MHz)) - (13.82 * std::log10 (m_BSAntennaHeight)) - C_H
+ ((44.9 - 6.55 * std::log10 (m_BSAntennaHeight)) * std::log10 (distance_km)) + C + m_shadowing;
+ ((44.9 - 6.55 * std::log10 (m_BSAntennaHeight)) * std::log10 (distance_km)) + m_shadowing;
NS_LOG_DEBUG ("dist =" << distance << ", Path Loss = " << loss_in_db);

View File

@@ -51,43 +51,101 @@ class Cost231PropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
Cost231PropagationLossModel ();
enum Environment
{
SubUrban, MediumCity, Metropolitan
};
/**
* Get the propagation loss
* \param a the mobility model of the source
* \param b the mobility model of the destination
* \returns the propagation loss (in dBm)
*/
double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
/**
* Set the BS antenna height
* \param height BS antenna height [m]
*/
void SetBSAntennaHeight (double height);
/**
* Set the SS antenna height
* \param height SS antenna height [m]
*/
void SetSSAntennaHeight (double height);
void SetEnvironment (Environment env);
/**
* Set the wavelength
* \param lambda the wavelength
*/
void SetLambda (double lambda);
void SetMinDistance (double minDistance);
double GetBSAntennaHeight (void) const;
double GetSSAntennaHeight (void) const;
Environment GetEnvironment (void) const;
double GetMinDistance (void) const;
double GetLambda (void) const;
/**
* Set the wavelength
* \param frequency the signal frequency [Hz]
* \param speed the signal speed [m/s]
*/
void SetLambda (double frequency, double speed);
/**
* Set the minimum model distance
* \param minDistance the minimum model distance
*/
void SetMinDistance (double minDistance);
/**
* Get the BS antenna height
* \returns BS antenna height [m]
*/
double GetBSAntennaHeight (void) const;
/**
* Get the SS antenna height
* \returns SS antenna height [m]
*/
double GetSSAntennaHeight (void) const;
/**
* Get the minimum model distance
* \returns the minimum model distance
*/
double GetMinDistance (void) const;
/**
* Get the wavelength
* \returns the wavelength
*/
double GetLambda (void) const;
/**
* Get the shadowing value
* \returns the shadowing value
*/
double GetShadowing (void);
/**
* Set the shadowing value
* \param shadowing the shadowing value
*/
void SetShadowing (double shadowing);
private:
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
Cost231PropagationLossModel (const Cost231PropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
Cost231PropagationLossModel & operator = (const Cost231PropagationLossModel &);
virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
double m_BSAntennaHeight; // in meter
double m_SSAntennaHeight; // in meter
double C;
double m_lambda;
Environment m_environment;
double m_minDistance; // in meter
double m_frequency; // frequency in MHz
double m_shadowing;
double m_BSAntennaHeight; //!< BS Antenna Height [m]
double m_SSAntennaHeight; //!< SS Antenna Height [m]
double m_lambda; //!< The wavelength
double m_minDistance; //!< minimum distance [m]
double m_frequency; //!< frequency [Hz]
double m_shadowing; //!< Shadowing loss [dB]
};

View File

@@ -44,7 +44,10 @@ class ItuR1411LosPropagationLossModel : public PropagationLossModel
public:
// inherited from Object
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
ItuR1411LosPropagationLossModel ();
@@ -69,14 +72,26 @@ public:
double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
private:
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
ItuR1411LosPropagationLossModel (const ItuR1411LosPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
ItuR1411LosPropagationLossModel & operator = (const ItuR1411LosPropagationLossModel &);
// inherited from PropagationLossModel
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
double m_lambda; // wavelength
double m_lambda; //!< wavelength
};
} // namespace ns3

View File

@@ -44,7 +44,10 @@ class ItuR1411NlosOverRooftopPropagationLossModel : public PropagationLossModel
public:
// inherited from Object
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
ItuR1411NlosOverRooftopPropagationLossModel ();
@@ -69,22 +72,34 @@ public:
double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
private:
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
ItuR1411NlosOverRooftopPropagationLossModel (const ItuR1411NlosOverRooftopPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
ItuR1411NlosOverRooftopPropagationLossModel & operator = (const ItuR1411NlosOverRooftopPropagationLossModel &);
// inherited from PropagationLossModel
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
double m_frequency; ///< frequency in MHz
double m_lambda; ///< wavelength
EnvironmentType m_environment;
CitySize m_citySize;
double m_rooftopHeight; ///< in meters
double m_streetsOrientation; ///< in degrees [0,90]
double m_streetsWidth; ///< in meters
double m_buildingsExtend; ///< in meters
double m_buildingSeparation; ///< in meters
double m_frequency; //!< frequency in MHz
double m_lambda; //!< wavelength
EnvironmentType m_environment; //!< Environment Scenario
CitySize m_citySize; //!< Dimension of the city
double m_rooftopHeight; //!< in meters
double m_streetsOrientation; //!< in degrees [0,90]
double m_streetsWidth; //!< in meters
double m_buildingsExtend; //!< in meters
double m_buildingSeparation; //!< in meters
};

View File

@@ -85,7 +85,7 @@ JakesProcess::SetNOscillators (unsigned int nOscillators)
void
JakesProcess::SetDopplerFrequencyHz (double dopplerFrequencyHz)
{
m_omegaDopplerMax = 2 * dopplerFrequencyHz * JakesPropagationLossModel::PI;
m_omegaDopplerMax = 2 * dopplerFrequencyHz * M_PI;
}
void
@@ -101,7 +101,7 @@ JakesProcess::ConstructOscillators ()
unsigned int n = i + 1;
/// 1. Rotation speed
/// 1a. Initiate \f[ \alpha_n = \frac{2\pi n - \pi + \theta}{4M}, n=1,2, \ldots,M\f], n is oscillatorNumber, M is m_nOscillators
double alpha = (2.0 * JakesPropagationLossModel::PI * n - JakesPropagationLossModel::PI + theta) / (4.0 * m_nOscillators);
double alpha = (2.0 * M_PI * n - M_PI + theta) / (4.0 * m_nOscillators);
/// 1b. Initiate rotation speed:
double omega = m_omegaDopplerMax * std::cos (alpha);
/// 2. Initiate complex amplitude:

View File

@@ -55,43 +55,79 @@ class JakesPropagationLossModel;
class JakesProcess : public Object
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
JakesProcess ();
virtual ~JakesProcess();
virtual void DoDispose ();
/**
* Get the channel complex gain
* \return the channel complex gain
*/
std::complex<double> GetComplexGain () const;
/// Get Channel gain [dB]
/**
* Get the channel gain in dB
* \return the channel gain [dB]
*/
double GetChannelGainDb () const;
void SetPropagationLossModel (Ptr<const PropagationLossModel>);
/**
* Set the propagation model using this class
* \param model the propagation model using this class
*/
void SetPropagationLossModel (Ptr<const PropagationLossModel> model);
private:
/// Represents a single oscillator
/**
* This class Represents a single oscillator
*/
struct Oscillator
{
/// Initiate oscillator with complex amplitude, initial phase and rotation speed
/**
* Initiate oscillator with complex amplitude, initial phase and rotation speed
* \param amplitude initial complex amplitude
* \param initialPhase initial phase
* \param omega rotation speed
*/
Oscillator (std::complex<double> amplitude, double initialPhase, double omega);
// Get the complex amplitude at moment \param t
/**
* Get the complex amplitude at a given moment
* \param t time instant
* \returns the complex amplitude
*/
std::complex<double> GetValueAt (Time t) const;
/// Complex number \f$Re=\cos(\psi_n), Im = i\sin(\psi_n)]\f$
std::complex<double> m_amplitude;
/// Phase \f$\phi_n\f$ of the oscillator
double m_phase;
/// Rotation speed of the oscillator \f$\omega_d \cos(\alpha_n)\f$
double m_omega;
std::complex<double> m_amplitude; //!< Complex number \f$Re=\cos(\psi_n), Im = i\sin(\psi_n)]\f$
double m_phase; //!< Phase \f$\phi_n\f$ of the oscillator
double m_omega; //!< Rotation speed of the oscillator \f$\omega_d \cos(\alpha_n)\f$
};
private:
/**
* Set the number of Oscillators to use
* @param nOscillators the number of oscillators
*/
void SetNOscillators (unsigned int nOscillators);
/**
* Set the Doppler frequency
* @param dopplerFrequencyHz the Doppler frequency [Hz]
*/
void SetDopplerFrequencyHz (double dopplerFrequencyHz);
/**
*
*/
void ConstructOscillators ();
private:
/// Vector of oscillators:
std::vector<Oscillator> m_oscillators;
///\name Attributes:
///\{
double m_omegaDopplerMax;
unsigned int m_nOscillators;
Ptr<UniformRandomVariable> m_uniformVariable;
Ptr<const JakesPropagationLossModel> m_jakes;
///\}
std::vector<Oscillator> m_oscillators; //!< Vector of oscillators
double m_omegaDopplerMax; //!< max rotation speed Doppler frequency
unsigned int m_nOscillators; //!< number of oscillators
Ptr<UniformRandomVariable> m_uniformVariable; //!< random stream
Ptr<const JakesPropagationLossModel> m_jakes; //!< pointer to the propagation loss model
};
} // namespace ns3
#endif // DOPPLER_PROCESS_H

View File

@@ -30,13 +30,11 @@ NS_LOG_COMPONENT_DEFINE ("Jakes");
NS_OBJECT_ENSURE_REGISTERED (JakesPropagationLossModel);
const double JakesPropagationLossModel::PI = 3.14159265358979323846;
JakesPropagationLossModel::JakesPropagationLossModel()
{
m_uniformVariable = CreateObject<UniformRandomVariable> ();
m_uniformVariable->SetAttribute ("Min", DoubleValue (-1.0 * PI));
m_uniformVariable->SetAttribute ("Max", DoubleValue (PI));
m_uniformVariable->SetAttribute ("Min", DoubleValue (-1.0 * M_PI));
m_uniformVariable->SetAttribute ("Max", DoubleValue (M_PI));
}
JakesPropagationLossModel::~JakesPropagationLossModel()
@@ -62,7 +60,7 @@ JakesPropagationLossModel::DoCalcRxPower (double txPowerDbm,
{
pathData = CreateObject<JakesProcess> ();
pathData->SetPropagationLossModel (this);
m_propagationCache.AddPathData (pathData, a, b, 0/**Spectrum model uid is not used in PropagationLossModel*/);
m_propagationCache.AddPathData (pathData, a, b, 0 /**Spectrum model uid is not used in PropagationLossModel*/);
}
return txPowerDbm + pathData->GetChannelGainDb ();
}

View File

@@ -29,30 +29,50 @@ namespace ns3
/**
* \ingroup propagation
*
* \brief a jakes narrowband propagation model.
* \brief a Jakes narrowband propagation model.
* Symmetrical cache for JakesProcess
*/
class JakesPropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId ();
JakesPropagationLossModel ();
virtual ~JakesPropagationLossModel ();
static const double PI;
private:
friend class JakesProcess;
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
JakesPropagationLossModel (const JakesPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
JakesPropagationLossModel & operator = (const JakesPropagationLossModel &);
double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
/**
* Get the underlying RNG stream
* \return the RNG stream
*/
Ptr<UniformRandomVariable> GetUniformRandomVariable () const;
Ptr<UniformRandomVariable> m_uniformVariable;
private:
mutable PropagationCache<JakesProcess> m_propagationCache;
Ptr<UniformRandomVariable> m_uniformVariable; //!< random stream
mutable PropagationCache<JakesProcess> m_propagationCache; //!< Propagation cache
};
} // namespace ns3

View File

@@ -42,8 +42,10 @@ class Kun2600MhzPropagationLossModel : public PropagationLossModel
{
public:
// inherited from Object
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
Kun2600MhzPropagationLossModel ();
@@ -59,6 +61,19 @@ public:
double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
private:
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
Kun2600MhzPropagationLossModel (const Kun2600MhzPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
Kun2600MhzPropagationLossModel & operator = (const Kun2600MhzPropagationLossModel &);
// inherited from PropagationLossModel
virtual double DoCalcRxPower (double txPowerDbm,

View File

@@ -45,7 +45,10 @@ class OkumuraHataPropagationLossModel : public PropagationLossModel
public:
// inherited from Object
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
OkumuraHataPropagationLossModel ();
@@ -61,16 +64,28 @@ public:
double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
private:
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
OkumuraHataPropagationLossModel (const OkumuraHataPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
OkumuraHataPropagationLossModel & operator = (const OkumuraHataPropagationLossModel &);
// inherited from PropagationLossModel
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
EnvironmentType m_environment;
CitySize m_citySize;
double m_frequency; // frequency in MHz
EnvironmentType m_environment; //!< Environment Scenario
CitySize m_citySize; //!< Size of the city
double m_frequency; //!< frequency in Hz
};
} // namespace ns3

View File

@@ -27,7 +27,7 @@ namespace ns3
{
/**
* \ingroup propagation
* \brief Constructs a cache of objects, where each obect is responsible for a single propagation path loss calculations.
* \brief Constructs a cache of objects, where each object is responsible for a single propagation path loss calculations.
* Propagation path a-->b and b-->a is the same thing. Propagation path is identified by
* a couple of MobilityModels and a spectrum model UID
*/
@@ -37,6 +37,14 @@ class PropagationCache
public:
PropagationCache () {};
~PropagationCache () {};
/**
* Get the model associated with the path
* \param a 1st node mobility model
* \param b 2nd node mobility model
* \param modelUid model UID
* \return the model
*/
Ptr<T> GetPathData (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid)
{
PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid);
@@ -47,6 +55,14 @@ public:
}
return it->second;
};
/**
* Add a model to the path
* \param data the model to associate to the path
* \param a 1st node mobility model
* \param b 2nd node mobility model
* \param modelUid model UID
*/
void AddPathData (Ptr<T> data, Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid)
{
PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid);
@@ -57,12 +73,18 @@ private:
/// Each path is identified by
struct PropagationPathIdentifier
{
/**
* Constructor
* @param a 1st node mobility model
* @param b 2nd node mobility model
* @param modelUid model UID
*/
PropagationPathIdentifier (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid) :
m_srcMobility (a), m_dstMobility (b), m_spectrumModelUid (modelUid)
{};
Ptr<const MobilityModel> m_srcMobility;
Ptr<const MobilityModel> m_dstMobility;
uint32_t m_spectrumModelUid;
Ptr<const MobilityModel> m_srcMobility; //!< 1st node mobility model
Ptr<const MobilityModel> m_dstMobility; //!< 2nd node mobility model
uint32_t m_spectrumModelUid; //!< model UID
bool operator < (const PropagationPathIdentifier & other) const
{
if (m_spectrumModelUid != other.m_spectrumModelUid)
@@ -81,9 +103,11 @@ private:
return false;
}
};
/// Typedef: PropagationPathIdentifier, Ptr<T>
typedef std::map<PropagationPathIdentifier, Ptr<T> > PathCache;
private:
PathCache m_pathCache;
PathCache m_pathCache; //!< Path cache
};
} // namespace ns3

View File

@@ -37,6 +37,10 @@ class MobilityModel;
class PropagationDelayModel : public Object
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
virtual ~PropagationDelayModel ();
/**
@@ -74,6 +78,10 @@ private:
class RandomPropagationDelayModel : public PropagationDelayModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
/**
@@ -84,7 +92,7 @@ public:
virtual Time GetDelay (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
private:
virtual int64_t DoAssignStreams (int64_t stream);
Ptr<RandomVariableStream> m_variable;
Ptr<RandomVariableStream> m_variable; //!< random generator
};
/**
@@ -95,6 +103,10 @@ private:
class ConstantSpeedPropagationDelayModel : public PropagationDelayModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
/**
@@ -112,7 +124,7 @@ public:
double GetSpeed (void) const;
private:
virtual int64_t DoAssignStreams (int64_t stream);
double m_speed;
double m_speed; //!< speed
};
} // namespace ns3

View File

@@ -140,8 +140,6 @@ RandomPropagationLossModel::DoAssignStreams (int64_t stream)
NS_OBJECT_ENSURE_REGISTERED (FriisPropagationLossModel);
const double FriisPropagationLossModel::PI = 3.14159265358979323846;
TypeId
FriisPropagationLossModel::GetTypeId (void)
{
@@ -264,7 +262,7 @@ FriisPropagationLossModel::DoCalcRxPower (double txPowerDbm,
return txPowerDbm - m_minLoss;
}
double numerator = m_lambda * m_lambda;
double denominator = 16 * PI * PI * distance * distance * m_systemLoss;
double denominator = 16 * M_PI * M_PI * distance * distance * m_systemLoss;
double lossDb = -10 * log10 (numerator / denominator);
NS_LOG_DEBUG ("distance=" << distance<< "m, loss=" << lossDb <<"dB");
return txPowerDbm - std::max (lossDb, m_minLoss);
@@ -281,8 +279,6 @@ FriisPropagationLossModel::DoAssignStreams (int64_t stream)
NS_OBJECT_ENSURE_REGISTERED (TwoRayGroundPropagationLossModel);
const double TwoRayGroundPropagationLossModel::PI = 3.14159265358979323846;
TypeId
TwoRayGroundPropagationLossModel::GetTypeId (void)
{
@@ -419,13 +415,13 @@ TwoRayGroundPropagationLossModel::DoCalcRxPower (double txPowerDbm,
*
*/
double dCross = (4 * PI * txAntHeight * rxAntHeight) / m_lambda;
double dCross = (4 * M_PI * txAntHeight * rxAntHeight) / m_lambda;
double tmp = 0;
if (distance <= dCross)
{
// We use Friis
double numerator = m_lambda * m_lambda;
tmp = PI * distance;
tmp = M_PI * distance;
double denominator = 16 * tmp * tmp * m_systemLoss;
double pr = 10 * std::log10 (numerator / denominator);
NS_LOG_DEBUG ("Receiver within crossover (" << dCross << "m) for Two_ray path; using Friis");

View File

@@ -41,7 +41,7 @@ class MobilityModel;
/**
* \ingroup propagation
*
* \brief Modelize the propagation loss through a transmission medium
* \brief Models the propagation loss through a transmission medium
*
* Calculate the receive power (dbm) from a transmit power (dbm)
* and a mobility model for the source and destination positions.
@@ -49,6 +49,11 @@ class MobilityModel;
class PropagationLossModel : public Object
{
public:
/**
* Get the type ID.
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
PropagationLossModel ();
@@ -76,6 +81,9 @@ public:
Ptr<PropagationLossModel> GetNext ();
/**
* Returns the Rx Power taking into account all the PropagatinLossModel(s)
* chained to the current one.
*
* \param txPowerDbm current transmission power (in dBm)
* \param a the mobility model of the source
* \param b the mobility model of the destination
@@ -99,8 +107,29 @@ public:
int64_t AssignStreams (int64_t stream);
private:
PropagationLossModel (const PropagationLossModel &o);
PropagationLossModel &operator = (const PropagationLossModel &o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
PropagationLossModel (const PropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
PropagationLossModel &operator = (const PropagationLossModel &);
/**
* Returns the Rx Power taking into account only the particular
* PropagatinLossModel.
*
* \param txPowerDbm current transmission power (in dBm)
* \param a the mobility model of the source
* \param b the mobility model of the destination
* \returns the reception power after adding/multiplying propagation loss (in dBm)
*/
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const = 0;
@@ -111,7 +140,7 @@ private:
*/
virtual int64_t DoAssignStreams (int64_t stream) = 0;
Ptr<PropagationLossModel> m_next;
Ptr<PropagationLossModel> m_next; //!< Next propagation loss model in the list
};
/**
@@ -122,19 +151,34 @@ private:
class RandomPropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
RandomPropagationLossModel ();
virtual ~RandomPropagationLossModel ();
private:
RandomPropagationLossModel (const RandomPropagationLossModel &o);
RandomPropagationLossModel & operator = (const RandomPropagationLossModel &o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
RandomPropagationLossModel (const RandomPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
RandomPropagationLossModel & operator = (const RandomPropagationLossModel &);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
Ptr<RandomVariableStream> m_variable;
Ptr<RandomVariableStream> m_variable; //!< random generator
};
/**
@@ -217,6 +261,10 @@ private:
class FriisPropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
FriisPropagationLossModel ();
/**
@@ -256,20 +304,43 @@ public:
double GetSystemLoss (void) const;
private:
FriisPropagationLossModel (const FriisPropagationLossModel &o);
FriisPropagationLossModel & operator = (const FriisPropagationLossModel &o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
FriisPropagationLossModel (const FriisPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
FriisPropagationLossModel & operator = (const FriisPropagationLossModel &);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
/**
* Transforms a Dbm value to Watt
* \param dbm the Dbm value
* \return the Watts
*/
double DbmToW (double dbm) const;
/**
* Transforms a Watt value to Dbm
* \param w the Watt value
* \return the Dbm
*/
double DbmFromW (double w) const;
static const double PI;
double m_lambda;
double m_frequency;
double m_systemLoss;
double m_minLoss;
double m_lambda; //!< the carrier wavelength
double m_frequency; //!< the carrier frequency
double m_systemLoss; //!< the system loss
double m_minLoss; //!< the minimum loss
};
/**
@@ -303,6 +374,10 @@ private:
class TwoRayGroundPropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
TwoRayGroundPropagationLossModel ();
@@ -349,21 +424,44 @@ public:
void SetHeightAboveZ (double heightAboveZ);
private:
TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &o);
TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
/**
* Transforms a Dbm value to Watt
* \param dbm the Dbm value
* \return the Watts
*/
double DbmToW (double dbm) const;
/**
* Transforms a Watt value to Dbm
* \param w the Watt value
* \return the Dbm
*/
double DbmFromW (double w) const;
static const double PI;
double m_lambda;
double m_frequency;
double m_systemLoss;
double m_minDistance;
double m_heightAboveZ;
double m_lambda; //!< the carrier wavelength
double m_frequency; //!< the carrier frequency
double m_systemLoss; //!< the system loss
double m_minDistance; //!< minimum distance for the model
double m_heightAboveZ; //!< antenna height above the node's Z coordinate
};
/**
@@ -389,6 +487,10 @@ private:
class LogDistancePropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
LogDistancePropagationLossModel ();
@@ -402,20 +504,42 @@ public:
*/
double GetPathLossExponent (void) const;
/**
* Set the reference path loss at a given distance
* \param referenceDistance reference distance
* \param referenceLoss reference path loss
*/
void SetReference (double referenceDistance, double referenceLoss);
private:
LogDistancePropagationLossModel (const LogDistancePropagationLossModel &o);
LogDistancePropagationLossModel & operator = (const LogDistancePropagationLossModel &o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
LogDistancePropagationLossModel (const LogDistancePropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
LogDistancePropagationLossModel & operator = (const LogDistancePropagationLossModel &);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
/**
* Creates a default reference loss model
* \return a default reference loss model
*/
static Ptr<PropagationLossModel> CreateDefaultReference (void);
double m_exponent;
double m_referenceDistance;
double m_referenceLoss;
double m_exponent; //!< model exponent
double m_referenceDistance; //!< reference distance
double m_referenceLoss; //!< reference loss
};
/**
@@ -461,29 +585,44 @@ L_0 + 10 \cdot n_0 \log_{10}(\frac{d_1}{d_0}) + 10 \cdot n_1 \log_{10}(\frac{d_2
class ThreeLogDistancePropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
ThreeLogDistancePropagationLossModel ();
// Parameters are all accessible via attributes.
private:
ThreeLogDistancePropagationLossModel (const ThreeLogDistancePropagationLossModel& o);
ThreeLogDistancePropagationLossModel& operator= (const ThreeLogDistancePropagationLossModel& o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
ThreeLogDistancePropagationLossModel (const ThreeLogDistancePropagationLossModel&);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
ThreeLogDistancePropagationLossModel& operator= (const ThreeLogDistancePropagationLossModel&);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
double m_distance0;
double m_distance1;
double m_distance2;
double m_distance0; //!< Beginning of the first (near) distance field
double m_distance1; //!< Beginning of the second (middle) distance field.
double m_distance2; //!< Beginning of the third (far) distance field.
double m_exponent0;
double m_exponent1;
double m_exponent2;
double m_exponent0; //!< The exponent for the first field.
double m_exponent1; //!< The exponent for the second field.
double m_exponent2; //!< The exponent for the third field.
double m_referenceLoss;
double m_referenceLoss; //!< The reference loss at distance d0 (dB).
};
/**
@@ -509,6 +648,10 @@ private:
class NakagamiPropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
NakagamiPropagationLossModel ();
@@ -516,23 +659,34 @@ public:
// Parameters are all accessible via attributes.
private:
NakagamiPropagationLossModel (const NakagamiPropagationLossModel& o);
NakagamiPropagationLossModel& operator= (const NakagamiPropagationLossModel& o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
NakagamiPropagationLossModel (const NakagamiPropagationLossModel&);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
NakagamiPropagationLossModel& operator= (const NakagamiPropagationLossModel&);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
double m_distance1;
double m_distance2;
double m_distance1; //!< Distance1
double m_distance2; //!< Distance2
double m_m0;
double m_m1;
double m_m2;
double m_m0; //!< m for distances smaller than Distance1
double m_m1; //!< m for distances smaller than Distance2
double m_m2; //!< m for distances greater than Distance2
Ptr<ErlangRandomVariable> m_erlangRandomVariable;
Ptr<GammaRandomVariable> m_gammaRandomVariable;
Ptr<ErlangRandomVariable> m_erlangRandomVariable; //!< Erlang random variable
Ptr<GammaRandomVariable> m_gammaRandomVariable; //!< Gamma random variable
};
/**
@@ -551,6 +705,10 @@ private:
class FixedRssLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
FixedRssLossModel ();
@@ -563,13 +721,26 @@ public:
void SetRss (double rss);
private:
FixedRssLossModel (const FixedRssLossModel &o);
FixedRssLossModel & operator = (const FixedRssLossModel &o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
FixedRssLossModel (const FixedRssLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
FixedRssLossModel & operator = (const FixedRssLossModel &);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
double m_rss;
double m_rss; //!< the received signal strength
};
/**
@@ -582,6 +753,10 @@ private:
class MatrixPropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
MatrixPropagationLossModel ();
@@ -597,21 +772,40 @@ public:
* \param symmetric If true (default), both a->b and b->a paths will be affected
*/
void SetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b, double loss, bool symmetric = true);
/// Set default loss (in dB, positive) to be used, infinity if not set
void SetDefaultLoss (double);
/**
* Set the default propagation loss (in dB, positive) to be used, infinity if not set
* \param defaultLoss the default proagation loss
*/
void SetDefaultLoss (double defaultLoss);
private:
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
MatrixPropagationLossModel (const MatrixPropagationLossModel &);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
MatrixPropagationLossModel &operator = (const MatrixPropagationLossModel &);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
private:
/// default loss
double m_default;
double m_default; //!< default loss
/// Typedef: Mobility models pair
typedef std::pair< Ptr<MobilityModel>, Ptr<MobilityModel> > MobilityPair;
/// Fixed loss between pair of nodes
std::map<MobilityPair, double> m_loss;
std::map<MobilityPair, double> m_loss; //!< Propagation loss between pair of nodes
};
/**
@@ -627,17 +821,32 @@ private:
class RangePropagationLossModel : public PropagationLossModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
RangePropagationLossModel ();
private:
RangePropagationLossModel (const RangePropagationLossModel& o);
RangePropagationLossModel& operator= (const RangePropagationLossModel& o);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
*/
RangePropagationLossModel (const RangePropagationLossModel&);
/**
* \brief Copy constructor
*
* Defined and unimplemented to avoid misuse
* \returns
*/
RangePropagationLossModel& operator= (const RangePropagationLossModel&);
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
virtual int64_t DoAssignStreams (int64_t stream);
private:
double m_range;
double m_range; //!< Maximum Transmission Range (meters)
};
} // namespace ns3