--- a/src/propagation/model/cost231-propagation-loss-model.cc +++ a/src/propagation/model/cost231-propagation-loss-model.cc @@ -55,13 +55,13 @@ MakeDoubleChecker ()) .AddAttribute ("BSAntennaHeight", - " BS Antenna Height (default is 50m).", + "BS Antenna Height (default is 50m).", DoubleValue (50.0), MakeDoubleAccessor (&Cost231PropagationLossModel::m_BSAntennaHeight), MakeDoubleChecker ()) .AddAttribute ("SSAntennaHeight", - " SS Antenna Height (default is 3m).", + "SS Antenna Height (default is 3m).", DoubleValue (3), MakeDoubleAccessor (&Cost231PropagationLossModel::m_SSAntennaHeight), MakeDoubleChecker ()) @@ -76,7 +76,6 @@ Cost231PropagationLossModel::Cost231PropagationLossModel () { - C = 0; m_shadowing = 10; } @@ -146,17 +145,6 @@ return m_SSAntennaHeight; } -void -Cost231PropagationLossModel::SetEnvironment (Environment env) -{ - m_environment = env; -} -Cost231PropagationLossModel::Environment -Cost231PropagationLossModel::GetEnvironment (void) const -{ - return m_environment; -} - double Cost231PropagationLossModel::GetLoss (Ptr a, Ptr b) const { @@ -178,7 +166,7 @@ // 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); --- a/src/propagation/model/cost231-propagation-loss-model.h +++ a/src/propagation/model/cost231-propagation-loss-model.h @@ -51,43 +51,101 @@ { 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 a, Ptr 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); + /** + * 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; - Environment GetEnvironment (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; - void SetLambda (double frequency, double speed); + /** + * 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 a, Ptr 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] }; --- a/src/propagation/model/itu-r-1411-los-propagation-loss-model.h +++ a/src/propagation/model/itu-r-1411-los-propagation-loss-model.h @@ -44,7 +44,10 @@ public: - // inherited from Object + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); ItuR1411LosPropagationLossModel (); @@ -69,14 +72,26 @@ double GetLoss (Ptr a, Ptr 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 a, Ptr b) const; virtual int64_t DoAssignStreams (int64_t stream); - double m_lambda; // wavelength + double m_lambda; //!< wavelength }; } // namespace ns3 --- a/src/propagation/model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h +++ a/src/propagation/model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h @@ -44,7 +44,10 @@ public: - // inherited from Object + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); ItuR1411NlosOverRooftopPropagationLossModel (); @@ -69,22 +72,34 @@ double GetLoss (Ptr a, Ptr 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 a, Ptr 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 }; --- a/src/propagation/model/jakes-process.cc +++ a/src/propagation/model/jakes-process.cc @@ -85,7 +85,7 @@ void JakesProcess::SetDopplerFrequencyHz (double dopplerFrequencyHz) { - m_omegaDopplerMax = 2 * dopplerFrequencyHz * JakesPropagationLossModel::PI; + m_omegaDopplerMax = 2 * dopplerFrequencyHz * M_PI; } void @@ -101,7 +101,7 @@ 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: --- a/src/propagation/model/jakes-process.h +++ a/src/propagation/model/jakes-process.h @@ -55,43 +55,79 @@ 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 GetComplexGain () const; - /// Get Channel gain [dB] + /** + * Get the channel gain in dB + * \return the channel gain [dB] + */ double GetChannelGainDb () const; - void SetPropagationLossModel (Ptr); + + /** + * Set the propagation model using this class + * \param model the propagation model using this class + */ + void SetPropagationLossModel (Ptr 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 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 GetValueAt (Time t) const; - /// Complex number \f$Re=\cos(\psi_n), Im = i\sin(\psi_n)]\f$ - std::complex 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 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 m_oscillators; - ///\name Attributes: - ///\{ - double m_omegaDopplerMax; - unsigned int m_nOscillators; - Ptr m_uniformVariable; - Ptr m_jakes; - ///\} + std::vector m_oscillators; //!< Vector of oscillators + double m_omegaDopplerMax; //!< max rotation speed Doppler frequency + unsigned int m_nOscillators; //!< number of oscillators + Ptr m_uniformVariable; //!< random stream + Ptr m_jakes; //!< pointer to the propagation loss model }; } // namespace ns3 #endif // DOPPLER_PROCESS_H --- a/src/propagation/model/jakes-propagation-loss-model.cc +++ a/src/propagation/model/jakes-propagation-loss-model.cc @@ -30,13 +30,11 @@ NS_OBJECT_ENSURE_REGISTERED (JakesPropagationLossModel); -const double JakesPropagationLossModel::PI = 3.14159265358979323846; - JakesPropagationLossModel::JakesPropagationLossModel() { m_uniformVariable = CreateObject (); - 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 @@ { pathData = CreateObject (); 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 (); } --- a/src/propagation/model/jakes-propagation-loss-model.h +++ a/src/propagation/model/jakes-propagation-loss-model.h @@ -29,30 +29,50 @@ /** * \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 a, Ptr b) const; virtual int64_t DoAssignStreams (int64_t stream); + + /** + * Get the underlying RNG stream + * \return the RNG stream + */ Ptr GetUniformRandomVariable () const; - Ptr m_uniformVariable; -private: - mutable PropagationCache m_propagationCache; + Ptr m_uniformVariable; //!< random stream + mutable PropagationCache m_propagationCache; //!< Propagation cache }; } // namespace ns3 --- a/src/propagation/model/kun-2600-mhz-propagation-loss-model.h +++ a/src/propagation/model/kun-2600-mhz-propagation-loss-model.h @@ -42,8 +42,10 @@ { public: - - // inherited from Object + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); Kun2600MhzPropagationLossModel (); @@ -59,6 +61,19 @@ double GetLoss (Ptr a, Ptr 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, --- a/src/propagation/model/okumura-hata-propagation-loss-model.h +++ a/src/propagation/model/okumura-hata-propagation-loss-model.h @@ -45,7 +45,10 @@ public: - // inherited from Object + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); OkumuraHataPropagationLossModel (); @@ -61,16 +64,28 @@ double GetLoss (Ptr a, Ptr 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 a, Ptr 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 --- a/src/propagation/model/propagation-cache.h +++ a/src/propagation/model/propagation-cache.h @@ -27,7 +27,7 @@ { /** * \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 @@ 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 GetPathData (Ptr a, Ptr b, uint32_t modelUid) { PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid); @@ -47,6 +55,14 @@ } 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 data, Ptr a, Ptr b, uint32_t modelUid) { PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid); @@ -57,12 +73,18 @@ /// 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 a, Ptr b, uint32_t modelUid) : m_srcMobility (a), m_dstMobility (b), m_spectrumModelUid (modelUid) {}; - Ptr m_srcMobility; - Ptr m_dstMobility; - uint32_t m_spectrumModelUid; + Ptr m_srcMobility; //!< 1st node mobility model + Ptr 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 @@ return false; } }; + + /// Typedef: PropagationPathIdentifier, Ptr typedef std::map > PathCache; private: - PathCache m_pathCache; + PathCache m_pathCache; //!< Path cache }; } // namespace ns3 --- a/src/propagation/model/propagation-delay-model.h +++ a/src/propagation/model/propagation-delay-model.h @@ -37,6 +37,10 @@ class PropagationDelayModel : public Object { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); virtual ~PropagationDelayModel (); /** @@ -74,6 +78,10 @@ class RandomPropagationDelayModel : public PropagationDelayModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); /** @@ -84,7 +92,7 @@ virtual Time GetDelay (Ptr a, Ptr b) const; private: virtual int64_t DoAssignStreams (int64_t stream); - Ptr m_variable; + Ptr m_variable; //!< random generator }; /** @@ -95,6 +103,10 @@ class ConstantSpeedPropagationDelayModel : public PropagationDelayModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); /** @@ -112,7 +124,7 @@ double GetSpeed (void) const; private: virtual int64_t DoAssignStreams (int64_t stream); - double m_speed; + double m_speed; //!< speed }; } // namespace ns3 --- a/src/propagation/model/propagation-loss-model.cc +++ a/src/propagation/model/propagation-loss-model.cc @@ -140,8 +140,6 @@ NS_OBJECT_ENSURE_REGISTERED (FriisPropagationLossModel); -const double FriisPropagationLossModel::PI = 3.14159265358979323846; - TypeId FriisPropagationLossModel::GetTypeId (void) { @@ -264,7 +262,7 @@ 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 @@ NS_OBJECT_ENSURE_REGISTERED (TwoRayGroundPropagationLossModel); -const double TwoRayGroundPropagationLossModel::PI = 3.14159265358979323846; - TypeId TwoRayGroundPropagationLossModel::GetTypeId (void) { @@ -419,13 +415,13 @@ * */ - 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"); --- a/src/propagation/model/propagation-loss-model.h +++ a/src/propagation/model/propagation-loss-model.h @@ -41,7 +41,7 @@ /** * \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 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 @@ Ptr 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 @@ 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 a, Ptr b) const = 0; @@ -111,7 +140,7 @@ */ virtual int64_t DoAssignStreams (int64_t stream) = 0; - Ptr m_next; + Ptr m_next; //!< Next propagation loss model in the list }; /** @@ -122,19 +151,34 @@ 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 a, Ptr b) const; virtual int64_t DoAssignStreams (int64_t stream); - Ptr m_variable; + Ptr m_variable; //!< random generator }; /** @@ -217,6 +261,10 @@ class FriisPropagationLossModel : public PropagationLossModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); FriisPropagationLossModel (); /** @@ -256,20 +304,43 @@ 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 a, Ptr 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 @@ class TwoRayGroundPropagationLossModel : public PropagationLossModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); TwoRayGroundPropagationLossModel (); @@ -349,21 +424,44 @@ 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 a, Ptr 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 @@ class LogDistancePropagationLossModel : public PropagationLossModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); LogDistancePropagationLossModel (); @@ -402,20 +504,42 @@ */ 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 a, Ptr b) const; virtual int64_t DoAssignStreams (int64_t stream); + + /** + * Creates a default reference loss model + * \return a default reference loss model + */ static Ptr 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 @@ 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 a, Ptr 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 @@ class NakagamiPropagationLossModel : public PropagationLossModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); NakagamiPropagationLossModel (); @@ -516,23 +659,34 @@ // 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 a, Ptr 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 m_erlangRandomVariable; - Ptr m_gammaRandomVariable; + Ptr m_erlangRandomVariable; //!< Erlang random variable + Ptr m_gammaRandomVariable; //!< Gamma random variable }; /** @@ -551,6 +705,10 @@ class FixedRssLossModel : public PropagationLossModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); FixedRssLossModel (); @@ -563,13 +721,26 @@ 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 a, Ptr b) const; + virtual int64_t DoAssignStreams (int64_t stream); - double m_rss; + double m_rss; //!< the received signal strength }; /** @@ -582,6 +753,10 @@ class MatrixPropagationLossModel : public PropagationLossModel { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); MatrixPropagationLossModel (); @@ -597,21 +772,40 @@ * \param symmetric If true (default), both a->b and b->a paths will be affected */ void SetLoss (Ptr a, Ptr 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 a, Ptr 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, Ptr > MobilityPair; - /// Fixed loss between pair of nodes - std::map m_loss; + + std::map m_loss; //!< Propagation loss between pair of nodes }; /** @@ -627,17 +821,32 @@ 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 a, Ptr b) const; virtual int64_t DoAssignStreams (int64_t stream); private: - double m_range; + double m_range; //!< Maximum Transmission Range (meters) }; } // namespace ns3