View | Details | Raw Unified | Return to bug 938
Collapse All | Expand All

(-)a/src/propagation/model/cost231-propagation-loss-model.cc (-15 / +3 lines)
 Lines 55-67    Link Here 
55
                   MakeDoubleChecker<double> ())
55
                   MakeDoubleChecker<double> ())
56
56
57
    .AddAttribute ("BSAntennaHeight",
57
    .AddAttribute ("BSAntennaHeight",
58
                   " BS Antenna Height (default is 50m).",
58
                   "BS Antenna Height (default is 50m).",
59
                   DoubleValue (50.0),
59
                   DoubleValue (50.0),
60
                   MakeDoubleAccessor (&Cost231PropagationLossModel::m_BSAntennaHeight),
60
                   MakeDoubleAccessor (&Cost231PropagationLossModel::m_BSAntennaHeight),
61
                   MakeDoubleChecker<double> ())
61
                   MakeDoubleChecker<double> ())
62
62
63
    .AddAttribute ("SSAntennaHeight",
63
    .AddAttribute ("SSAntennaHeight",
64
                   " SS Antenna Height (default is 3m).",
64
                   "SS Antenna Height (default is 3m).",
65
                   DoubleValue (3),
65
                   DoubleValue (3),
66
                   MakeDoubleAccessor (&Cost231PropagationLossModel::m_SSAntennaHeight),
66
                   MakeDoubleAccessor (&Cost231PropagationLossModel::m_SSAntennaHeight),
67
                   MakeDoubleChecker<double> ())
67
                   MakeDoubleChecker<double> ())
 Lines 76-82    Link Here 
76
76
77
Cost231PropagationLossModel::Cost231PropagationLossModel ()
77
Cost231PropagationLossModel::Cost231PropagationLossModel ()
78
{
78
{
79
  C = 0;
80
  m_shadowing = 10;
79
  m_shadowing = 10;
81
}
80
}
82
81
 Lines 146-162    Link Here 
146
  return m_SSAntennaHeight;
145
  return m_SSAntennaHeight;
147
}
146
}
148
147
149
void
150
Cost231PropagationLossModel::SetEnvironment (Environment env)
151
{
152
  m_environment = env;
153
}
154
Cost231PropagationLossModel::Environment
155
Cost231PropagationLossModel::GetEnvironment (void) const
156
{
157
  return m_environment;
158
}
159
160
double
148
double
161
Cost231PropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
149
Cost231PropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
162
{
150
{
 Lines 178-184    Link Here 
178
  // Ch. 4, eq. 4.4.3, pg. 135
166
  // Ch. 4, eq. 4.4.3, pg. 135
179
167
180
  double loss_in_db = 46.3 + (33.9 * std::log10(frequency_MHz)) - (13.82 * std::log10 (m_BSAntennaHeight)) - C_H
168
  double loss_in_db = 46.3 + (33.9 * std::log10(frequency_MHz)) - (13.82 * std::log10 (m_BSAntennaHeight)) - C_H
181
		  	  	  + ((44.9 - 6.55 * std::log10 (m_BSAntennaHeight)) * std::log10 (distance_km)) + C + m_shadowing;
169
		  	  	  + ((44.9 - 6.55 * std::log10 (m_BSAntennaHeight)) * std::log10 (distance_km)) + m_shadowing;
182
170
183
  NS_LOG_DEBUG ("dist =" << distance << ", Path Loss = " << loss_in_db);
171
  NS_LOG_DEBUG ("dist =" << distance << ", Path Loss = " << loss_in_db);
184
172
(-)a/src/propagation/model/cost231-propagation-loss-model.h (-15 / +73 lines)
 Lines 51-93    Link Here 
51
{
51
{
52
52
53
public:
53
public:
54
  /**
55
   * \brief Get the type ID.
56
   * \return the object TypeId
57
   */
54
  static TypeId GetTypeId (void);
58
  static TypeId GetTypeId (void);
55
  Cost231PropagationLossModel ();
59
  Cost231PropagationLossModel ();
56
  enum Environment
57
  {
58
    SubUrban, MediumCity, Metropolitan
59
  };
60
60
61
  /**
61
  /**
62
   * Get the propagation loss
62
   * \param a the mobility model of the source
63
   * \param a the mobility model of the source
63
   * \param b the mobility model of the destination
64
   * \param b the mobility model of the destination
64
   * \returns the propagation loss (in dBm)
65
   * \returns the propagation loss (in dBm)
65
   */
66
   */
66
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
67
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
68
69
  /**
70
   * Set the BS antenna height
71
   * \param height BS antenna height [m]
72
   */
67
  void SetBSAntennaHeight (double height);
73
  void SetBSAntennaHeight (double height);
74
  /**
75
   * Set the SS antenna height
76
   * \param height SS antenna height [m]
77
   */
68
  void SetSSAntennaHeight (double height);
78
  void SetSSAntennaHeight (double height);
69
  void SetEnvironment (Environment env);
79
80
  /**
81
   * Set the wavelength
82
   * \param lambda the wavelength
83
   */
70
  void SetLambda (double lambda);
84
  void SetLambda (double lambda);
85
  /**
86
   * Set the wavelength
87
   * \param frequency the signal frequency [Hz]
88
   * \param speed the signal speed [m/s]
89
   */
90
  void SetLambda (double frequency, double speed);
91
  /**
92
   * Set the minimum model distance
93
   * \param minDistance the minimum model distance
94
   */
71
  void SetMinDistance (double minDistance);
95
  void SetMinDistance (double minDistance);
96
  /**
97
   * Get the BS antenna height
98
   * \returns BS antenna height [m]
99
   */
72
  double GetBSAntennaHeight (void) const;
100
  double GetBSAntennaHeight (void) const;
101
  /**
102
   * Get the SS antenna height
103
   * \returns SS antenna height [m]
104
   */
73
  double GetSSAntennaHeight (void) const;
105
  double GetSSAntennaHeight (void) const;
74
  Environment GetEnvironment (void) const;
106
  /**
107
   * Get the minimum model distance
108
   * \returns the minimum model distance
109
   */
75
  double GetMinDistance (void) const;
110
  double GetMinDistance (void) const;
111
  /**
112
   * Get the wavelength
113
   * \returns the wavelength
114
   */
76
  double GetLambda (void) const;
115
  double GetLambda (void) const;
77
  void SetLambda (double frequency, double speed);
116
  /**
117
   * Get the shadowing value
118
   * \returns the shadowing value
119
   */
78
  double GetShadowing (void);
120
  double GetShadowing (void);
121
  /**
122
   * Set the shadowing value
123
   * \param shadowing the shadowing value
124
   */
79
  void SetShadowing (double shadowing);
125
  void SetShadowing (double shadowing);
80
private:
126
private:
127
  /**
128
   * \brief Copy constructor
129
   *
130
   * Defined and unimplemented to avoid misuse
131
   */
132
  Cost231PropagationLossModel (const Cost231PropagationLossModel &);
133
  /**
134
   * \brief Copy constructor
135
   *
136
   * Defined and unimplemented to avoid misuse
137
   * \returns
138
   */
139
  Cost231PropagationLossModel & operator = (const Cost231PropagationLossModel &);
140
81
  virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
141
  virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
82
  virtual int64_t DoAssignStreams (int64_t stream);
142
  virtual int64_t DoAssignStreams (int64_t stream);
83
  double m_BSAntennaHeight; // in meter
143
  double m_BSAntennaHeight; //!< BS Antenna Height [m]
84
  double m_SSAntennaHeight; // in meter
144
  double m_SSAntennaHeight; //!< SS Antenna Height [m]
85
  double C;
145
  double m_lambda; //!< The wavelength
86
  double m_lambda;
146
  double m_minDistance; //!< minimum distance [m]
87
  Environment m_environment;
147
  double m_frequency; //!< frequency [Hz]
88
  double m_minDistance; // in meter
148
  double m_shadowing; //!< Shadowing loss [dB]
89
  double m_frequency; // frequency in MHz
90
  double m_shadowing;
91
149
92
};
150
};
93
151
(-)a/src/propagation/model/itu-r-1411-los-propagation-loss-model.h (-3 / +18 lines)
 Lines 44-50    Link Here 
44
44
45
public:
45
public:
46
46
47
  // inherited from Object
47
  /**
48
   * \brief Get the type ID.
49
   * \return the object TypeId
50
   */
48
  static TypeId GetTypeId (void);
51
  static TypeId GetTypeId (void);
49
52
50
  ItuR1411LosPropagationLossModel ();
53
  ItuR1411LosPropagationLossModel ();
 Lines 69-82    Link Here 
69
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
72
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
70
73
71
private:
74
private:
75
  /**
76
   * \brief Copy constructor
77
   *
78
   * Defined and unimplemented to avoid misuse
79
   */
80
  ItuR1411LosPropagationLossModel (const ItuR1411LosPropagationLossModel &);
81
  /**
82
   * \brief Copy constructor
83
   *
84
   * Defined and unimplemented to avoid misuse
85
   * \returns
86
   */
87
  ItuR1411LosPropagationLossModel & operator = (const ItuR1411LosPropagationLossModel &);
72
88
73
  // inherited from PropagationLossModel
74
  virtual double DoCalcRxPower (double txPowerDbm,
89
  virtual double DoCalcRxPower (double txPowerDbm,
75
                                Ptr<MobilityModel> a,
90
                                Ptr<MobilityModel> a,
76
                                Ptr<MobilityModel> b) const;
91
                                Ptr<MobilityModel> b) const;
77
  virtual int64_t DoAssignStreams (int64_t stream);
92
  virtual int64_t DoAssignStreams (int64_t stream);
78
  
93
  
79
  double m_lambda; // wavelength
94
  double m_lambda; //!< wavelength
80
};
95
};
81
96
82
} // namespace ns3
97
} // namespace ns3
(-)a/src/propagation/model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h (-11 / +26 lines)
 Lines 44-50    Link Here 
44
44
45
public:
45
public:
46
46
47
  // inherited from Object
47
  /**
48
   * \brief Get the type ID.
49
   * \return the object TypeId
50
   */
48
  static TypeId GetTypeId (void);
51
  static TypeId GetTypeId (void);
49
52
50
  ItuR1411NlosOverRooftopPropagationLossModel ();
53
  ItuR1411NlosOverRooftopPropagationLossModel ();
 Lines 69-90    Link Here 
69
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
72
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
70
73
71
private:
74
private:
75
  /**
76
   * \brief Copy constructor
77
   *
78
   * Defined and unimplemented to avoid misuse
79
   */
80
  ItuR1411NlosOverRooftopPropagationLossModel (const ItuR1411NlosOverRooftopPropagationLossModel &);
81
  /**
82
   * \brief Copy constructor
83
   *
84
   * Defined and unimplemented to avoid misuse
85
   * \returns
86
   */
87
  ItuR1411NlosOverRooftopPropagationLossModel & operator = (const ItuR1411NlosOverRooftopPropagationLossModel &);
72
88
73
  // inherited from PropagationLossModel
74
  virtual double DoCalcRxPower (double txPowerDbm,
89
  virtual double DoCalcRxPower (double txPowerDbm,
75
                                Ptr<MobilityModel> a,
90
                                Ptr<MobilityModel> a,
76
                                Ptr<MobilityModel> b) const;
91
                                Ptr<MobilityModel> b) const;
77
  virtual int64_t DoAssignStreams (int64_t stream);
92
  virtual int64_t DoAssignStreams (int64_t stream);
78
  
93
  
79
  double m_frequency; ///< frequency in MHz
94
  double m_frequency; //!< frequency in MHz
80
  double m_lambda; ///< wavelength
95
  double m_lambda; //!< wavelength
81
  EnvironmentType m_environment;
96
  EnvironmentType m_environment; //!< Environment Scenario
82
  CitySize m_citySize;
97
  CitySize m_citySize; //!< Dimension of the city
83
  double m_rooftopHeight; ///< in meters
98
  double m_rooftopHeight; //!< in meters
84
  double m_streetsOrientation; ///< in degrees [0,90]
99
  double m_streetsOrientation; //!< in degrees [0,90]
85
  double m_streetsWidth; ///< in meters
100
  double m_streetsWidth; //!< in meters
86
  double m_buildingsExtend; ///< in meters
101
  double m_buildingsExtend; //!< in meters
87
  double m_buildingSeparation; ///< in meters
102
  double m_buildingSeparation; //!< in meters
88
103
89
};
104
};
90
105
(-)a/src/propagation/model/jakes-process.cc (-2 / +2 lines)
 Lines 85-91    Link Here 
85
void
85
void
86
JakesProcess::SetDopplerFrequencyHz (double dopplerFrequencyHz)
86
JakesProcess::SetDopplerFrequencyHz (double dopplerFrequencyHz)
87
{
87
{
88
  m_omegaDopplerMax = 2 * dopplerFrequencyHz * JakesPropagationLossModel::PI;
88
  m_omegaDopplerMax = 2 * dopplerFrequencyHz * M_PI;
89
}
89
}
90
90
91
void
91
void
 Lines 101-107    Link Here 
101
      unsigned int n = i + 1;
101
      unsigned int n = i + 1;
102
      /// 1. Rotation speed
102
      /// 1. Rotation speed
103
      /// 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
103
      /// 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
104
      double alpha = (2.0 * JakesPropagationLossModel::PI * n - JakesPropagationLossModel::PI + theta) / (4.0 * m_nOscillators);
104
      double alpha = (2.0 * M_PI * n - M_PI + theta) / (4.0 * m_nOscillators);
105
      /// 1b. Initiate rotation speed:
105
      /// 1b. Initiate rotation speed:
106
      double omega = m_omegaDopplerMax * std::cos (alpha);
106
      double omega = m_omegaDopplerMax * std::cos (alpha);
107
      /// 2. Initiate complex amplitude:
107
      /// 2. Initiate complex amplitude:
(-)a/src/propagation/model/jakes-process.h (-20 / +56 lines)
 Lines 55-97    Link Here 
55
class JakesProcess : public Object
55
class JakesProcess : public Object
56
{
56
{
57
public:
57
public:
58
  /**
59
   * \brief Get the type ID.
60
   * \return the object TypeId
61
   */
58
  static TypeId GetTypeId (void);
62
  static TypeId GetTypeId (void);
59
  JakesProcess ();
63
  JakesProcess ();
60
  virtual ~JakesProcess();
64
  virtual ~JakesProcess();
61
  virtual void DoDispose ();
65
  virtual void DoDispose ();
66
67
  /**
68
   * Get the channel complex gain
69
   * \return the channel complex gain
70
   */
62
  std::complex<double> GetComplexGain () const;
71
  std::complex<double> GetComplexGain () const;
63
  /// Get Channel gain [dB]
72
  /**
73
   * Get the channel gain in dB
74
   * \return the channel gain [dB]
75
   */
64
  double GetChannelGainDb () const;
76
  double GetChannelGainDb () const;
65
  void SetPropagationLossModel (Ptr<const PropagationLossModel>);
77
78
  /**
79
   * Set the propagation model using this class
80
   * \param model the propagation model using this class
81
   */
82
  void SetPropagationLossModel (Ptr<const PropagationLossModel> model);
66
private:
83
private:
67
  /// Represents a single oscillator
84
  /**
85
   * This class Represents a single oscillator
86
   */
68
  struct Oscillator
87
  struct Oscillator
69
  {
88
  {
70
    /// Initiate oscillator with complex amplitude, initial phase and rotation speed
89
    /**
90
     * Initiate oscillator with complex amplitude, initial phase and rotation speed
91
     * \param amplitude initial complex amplitude
92
     * \param initialPhase initial phase
93
     * \param omega rotation speed
94
     */
71
    Oscillator (std::complex<double> amplitude, double initialPhase, double omega);
95
    Oscillator (std::complex<double> amplitude, double initialPhase, double omega);
72
    // Get the complex amplitude at moment \param t
96
    /**
97
     * Get the complex amplitude at a given moment
98
     * \param t time instant
99
     * \returns the complex amplitude
100
     */
73
    std::complex<double> GetValueAt (Time t) const;
101
    std::complex<double> GetValueAt (Time t) const;
74
    /// Complex number \f$Re=\cos(\psi_n), Im = i\sin(\psi_n)]\f$
102
75
    std::complex<double> m_amplitude;
103
    std::complex<double> m_amplitude; //!< Complex number \f$Re=\cos(\psi_n), Im = i\sin(\psi_n)]\f$
76
    /// Phase \f$\phi_n\f$ of the oscillator
104
    double m_phase; //!< Phase \f$\phi_n\f$ of the oscillator
77
    double m_phase;
105
    double m_omega; //!< Rotation speed of the oscillator \f$\omega_d \cos(\alpha_n)\f$
78
    /// Rotation speed of the oscillator \f$\omega_d \cos(\alpha_n)\f$
79
    double m_omega;
80
  };
106
  };
81
private:
107
private:
108
109
  /**
110
   * Set the number of Oscillators to use
111
   * @param nOscillators the number of oscillators
112
   */
82
  void SetNOscillators (unsigned int nOscillators);
113
  void SetNOscillators (unsigned int nOscillators);
114
115
  /**
116
   * Set the Doppler frequency
117
   * @param dopplerFrequencyHz the Doppler frequency [Hz]
118
   */
83
  void SetDopplerFrequencyHz (double dopplerFrequencyHz);
119
  void SetDopplerFrequencyHz (double dopplerFrequencyHz);
120
121
  /**
122
   *
123
   */
84
  void ConstructOscillators ();
124
  void ConstructOscillators ();
85
private:
125
private:
86
  /// Vector of oscillators:
126
  std::vector<Oscillator> m_oscillators; //!< Vector of oscillators
87
  std::vector<Oscillator> m_oscillators;
127
  double m_omegaDopplerMax; //!< max rotation speed Doppler frequency
88
  ///\name Attributes:
128
  unsigned int m_nOscillators;  //!< number of oscillators
89
  ///\{
129
  Ptr<UniformRandomVariable> m_uniformVariable; //!< random stream
90
  double m_omegaDopplerMax;
130
  Ptr<const JakesPropagationLossModel> m_jakes; //!< pointer to the propagation loss model
91
  unsigned int m_nOscillators;
92
  Ptr<UniformRandomVariable> m_uniformVariable;
93
  Ptr<const JakesPropagationLossModel> m_jakes;
94
  ///\}
95
};
131
};
96
} // namespace ns3
132
} // namespace ns3
97
#endif // DOPPLER_PROCESS_H
133
#endif // DOPPLER_PROCESS_H
(-)a/src/propagation/model/jakes-propagation-loss-model.cc (-5 / +3 lines)
 Lines 30-42    Link Here 
30
NS_OBJECT_ENSURE_REGISTERED (JakesPropagationLossModel);
30
NS_OBJECT_ENSURE_REGISTERED (JakesPropagationLossModel);
31
31
32
32
33
const double JakesPropagationLossModel::PI = 3.14159265358979323846;
34
35
JakesPropagationLossModel::JakesPropagationLossModel()
33
JakesPropagationLossModel::JakesPropagationLossModel()
36
{
34
{
37
  m_uniformVariable = CreateObject<UniformRandomVariable> ();
35
  m_uniformVariable = CreateObject<UniformRandomVariable> ();
38
  m_uniformVariable->SetAttribute ("Min", DoubleValue (-1.0 * PI));
36
  m_uniformVariable->SetAttribute ("Min", DoubleValue (-1.0 * M_PI));
39
  m_uniformVariable->SetAttribute ("Max", DoubleValue (PI));
37
  m_uniformVariable->SetAttribute ("Max", DoubleValue (M_PI));
40
}
38
}
41
39
42
JakesPropagationLossModel::~JakesPropagationLossModel()
40
JakesPropagationLossModel::~JakesPropagationLossModel()
 Lines 62-68    Link Here 
62
    {
60
    {
63
      pathData = CreateObject<JakesProcess> ();
61
      pathData = CreateObject<JakesProcess> ();
64
      pathData->SetPropagationLossModel (this);
62
      pathData->SetPropagationLossModel (this);
65
      m_propagationCache.AddPathData (pathData, a, b, 0/**Spectrum model uid is not used in PropagationLossModel*/);
63
      m_propagationCache.AddPathData (pathData, a, b, 0 /**Spectrum model uid is not used in PropagationLossModel*/);
66
    }
64
    }
67
  return txPowerDbm + pathData->GetChannelGainDb ();
65
  return txPowerDbm + pathData->GetChannelGainDb ();
68
}
66
}
(-)a/src/propagation/model/jakes-propagation-loss-model.h (-6 / +26 lines)
 Lines 29-58    Link Here 
29
/**
29
/**
30
 * \ingroup propagation
30
 * \ingroup propagation
31
 *
31
 *
32
 * \brief a  jakes narrowband propagation model.
32
 * \brief a  Jakes narrowband propagation model.
33
 * Symmetrical cache for JakesProcess
33
 * Symmetrical cache for JakesProcess
34
 */
34
 */
35
35
36
class JakesPropagationLossModel : public PropagationLossModel
36
class JakesPropagationLossModel : public PropagationLossModel
37
{
37
{
38
public:
38
public:
39
  /**
40
   * \brief Get the type ID.
41
   * \return the object TypeId
42
   */
39
  static TypeId GetTypeId ();
43
  static TypeId GetTypeId ();
40
  JakesPropagationLossModel ();
44
  JakesPropagationLossModel ();
41
  virtual ~JakesPropagationLossModel ();
45
  virtual ~JakesPropagationLossModel ();
42
  
46
  
43
  static const double PI;
44
45
private:
47
private:
46
  friend class JakesProcess;
48
  friend class JakesProcess;
49
50
  /**
51
   * \brief Copy constructor
52
   *
53
   * Defined and unimplemented to avoid misuse
54
   */
55
  JakesPropagationLossModel (const JakesPropagationLossModel &);
56
  /**
57
   * \brief Copy constructor
58
   *
59
   * Defined and unimplemented to avoid misuse
60
   * \returns
61
   */
62
  JakesPropagationLossModel & operator = (const JakesPropagationLossModel &);
47
  double DoCalcRxPower (double txPowerDbm,
63
  double DoCalcRxPower (double txPowerDbm,
48
                        Ptr<MobilityModel> a,
64
                        Ptr<MobilityModel> a,
49
                        Ptr<MobilityModel> b) const;
65
                        Ptr<MobilityModel> b) const;
50
  virtual int64_t DoAssignStreams (int64_t stream);
66
  virtual int64_t DoAssignStreams (int64_t stream);
67
68
  /**
69
   * Get the underlying RNG stream
70
   * \return the RNG stream
71
   */
51
  Ptr<UniformRandomVariable> GetUniformRandomVariable () const;
72
  Ptr<UniformRandomVariable> GetUniformRandomVariable () const;
52
73
53
  Ptr<UniformRandomVariable> m_uniformVariable;
74
  Ptr<UniformRandomVariable> m_uniformVariable; //!< random stream
54
private:
75
  mutable PropagationCache<JakesProcess> m_propagationCache; //!< Propagation cache
55
  mutable PropagationCache<JakesProcess> m_propagationCache;
56
};
76
};
57
77
58
} // namespace ns3
78
} // namespace ns3
(-)a/src/propagation/model/kun-2600-mhz-propagation-loss-model.h (-2 / +17 lines)
 Lines 42-49    Link Here 
42
{
42
{
43
43
44
public:
44
public:
45
45
  /**
46
  // inherited from Object
46
   * \brief Get the type ID.
47
   * \return the object TypeId
48
   */
47
  static TypeId GetTypeId (void);
49
  static TypeId GetTypeId (void);
48
50
49
  Kun2600MhzPropagationLossModel ();
51
  Kun2600MhzPropagationLossModel ();
 Lines 59-64    Link Here 
59
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
61
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
60
62
61
private:
63
private:
64
  /**
65
   * \brief Copy constructor
66
   *
67
   * Defined and unimplemented to avoid misuse
68
   */
69
  Kun2600MhzPropagationLossModel (const Kun2600MhzPropagationLossModel &);
70
  /**
71
   * \brief Copy constructor
72
   *
73
   * Defined and unimplemented to avoid misuse
74
   * \returns
75
   */
76
  Kun2600MhzPropagationLossModel & operator = (const Kun2600MhzPropagationLossModel &);
62
77
63
  // inherited from PropagationLossModel
78
  // inherited from PropagationLossModel
64
  virtual double DoCalcRxPower (double txPowerDbm,
79
  virtual double DoCalcRxPower (double txPowerDbm,
(-)a/src/propagation/model/okumura-hata-propagation-loss-model.h (-5 / +20 lines)
 Lines 45-51    Link Here 
45
45
46
public:
46
public:
47
47
48
  // inherited from Object
48
  /**
49
   * \brief Get the type ID.
50
   * \return the object TypeId
51
   */
49
  static TypeId GetTypeId (void);
52
  static TypeId GetTypeId (void);
50
53
51
  OkumuraHataPropagationLossModel ();
54
  OkumuraHataPropagationLossModel ();
 Lines 61-76    Link Here 
61
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
64
  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
62
65
63
private:
66
private:
67
  /**
68
   * \brief Copy constructor
69
   *
70
   * Defined and unimplemented to avoid misuse
71
   */
72
  OkumuraHataPropagationLossModel (const OkumuraHataPropagationLossModel &);
73
  /**
74
   * \brief Copy constructor
75
   *
76
   * Defined and unimplemented to avoid misuse
77
   * \returns
78
   */
79
  OkumuraHataPropagationLossModel & operator = (const OkumuraHataPropagationLossModel &);
64
80
65
  // inherited from PropagationLossModel
66
  virtual double DoCalcRxPower (double txPowerDbm,
81
  virtual double DoCalcRxPower (double txPowerDbm,
67
                                Ptr<MobilityModel> a,
82
                                Ptr<MobilityModel> a,
68
                                Ptr<MobilityModel> b) const;
83
                                Ptr<MobilityModel> b) const;
69
  virtual int64_t DoAssignStreams (int64_t stream);
84
  virtual int64_t DoAssignStreams (int64_t stream);
70
  
85
  
71
  EnvironmentType m_environment;
86
  EnvironmentType m_environment;  //!< Environment Scenario
72
  CitySize m_citySize;
87
  CitySize m_citySize;  //!< Size of the city
73
  double m_frequency; // frequency in MHz
88
  double m_frequency; //!< frequency in Hz
74
};
89
};
75
90
76
} // namespace ns3
91
} // namespace ns3
(-)a/src/propagation/model/propagation-cache.h (-5 / +29 lines)
 Lines 27-33    Link Here 
27
{
27
{
28
/**
28
/**
29
 * \ingroup propagation
29
 * \ingroup propagation
30
 * \brief Constructs a cache of objects, where each obect is responsible for a single propagation path loss calculations.
30
 * \brief Constructs a cache of objects, where each object is responsible for a single propagation path loss calculations.
31
 * Propagation path a-->b and b-->a is the same thing. Propagation path is identified by
31
 * Propagation path a-->b and b-->a is the same thing. Propagation path is identified by
32
 * a couple of MobilityModels and a spectrum model UID
32
 * a couple of MobilityModels and a spectrum model UID
33
 */
33
 */
 Lines 37-42    Link Here 
37
public:
37
public:
38
  PropagationCache () {};
38
  PropagationCache () {};
39
  ~PropagationCache () {};
39
  ~PropagationCache () {};
40
41
  /**
42
   * Get the model associated with the path
43
   * \param a 1st node mobility model
44
   * \param b 2nd node mobility model
45
   * \param modelUid model UID
46
   * \return the model
47
   */
40
  Ptr<T> GetPathData (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid)
48
  Ptr<T> GetPathData (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid)
41
  {
49
  {
42
    PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid);
50
    PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid);
 Lines 47-52    Link Here 
47
      }
55
      }
48
    return it->second;
56
    return it->second;
49
  };
57
  };
58
59
  /**
60
   * Add a model to the path
61
   * \param data the model to associate to the path
62
   * \param a 1st node mobility model
63
   * \param b 2nd node mobility model
64
   * \param modelUid model UID
65
   */
50
  void AddPathData (Ptr<T> data, Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid)
66
  void AddPathData (Ptr<T> data, Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid)
51
  {
67
  {
52
    PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid);
68
    PropagationPathIdentifier key = PropagationPathIdentifier (a, b, modelUid);
 Lines 57-68    Link Here 
57
  /// Each path is identified by
73
  /// Each path is identified by
58
  struct PropagationPathIdentifier
74
  struct PropagationPathIdentifier
59
  {
75
  {
76
    /**
77
     * Constructor
78
     * @param a 1st node mobility model
79
     * @param b 2nd node mobility model
80
     * @param modelUid model UID
81
     */
60
    PropagationPathIdentifier (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid) :
82
    PropagationPathIdentifier (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b, uint32_t modelUid) :
61
      m_srcMobility (a), m_dstMobility (b), m_spectrumModelUid (modelUid)
83
      m_srcMobility (a), m_dstMobility (b), m_spectrumModelUid (modelUid)
62
    {};
84
    {};
63
    Ptr<const MobilityModel> m_srcMobility;
85
    Ptr<const MobilityModel> m_srcMobility; //!< 1st node mobility model
64
    Ptr<const MobilityModel> m_dstMobility;
86
    Ptr<const MobilityModel> m_dstMobility; //!< 2nd node mobility model
65
    uint32_t m_spectrumModelUid;
87
    uint32_t m_spectrumModelUid; //!< model UID
66
    bool operator < (const PropagationPathIdentifier & other) const
88
    bool operator < (const PropagationPathIdentifier & other) const
67
    {
89
    {
68
      if (m_spectrumModelUid != other.m_spectrumModelUid)
90
      if (m_spectrumModelUid != other.m_spectrumModelUid)
 Lines 81-89    Link Here 
81
      return false;
103
      return false;
82
    }
104
    }
83
  };
105
  };
106
107
  /// Typedef: PropagationPathIdentifier, Ptr<T>
84
  typedef std::map<PropagationPathIdentifier, Ptr<T> > PathCache;
108
  typedef std::map<PropagationPathIdentifier, Ptr<T> > PathCache;
85
private:
109
private:
86
  PathCache m_pathCache;
110
  PathCache m_pathCache; //!< Path cache
87
};
111
};
88
} // namespace ns3
112
} // namespace ns3
89
113
(-)a/src/propagation/model/propagation-delay-model.h (-2 / +14 lines)
 Lines 37-42    Link Here 
37
class PropagationDelayModel : public Object
37
class PropagationDelayModel : public Object
38
{
38
{
39
public:
39
public:
40
  /**
41
   * \brief Get the type ID.
42
   * \return the object TypeId
43
   */
40
  static TypeId GetTypeId (void);
44
  static TypeId GetTypeId (void);
41
  virtual ~PropagationDelayModel ();
45
  virtual ~PropagationDelayModel ();
42
  /**
46
  /**
 Lines 74-79    Link Here 
74
class RandomPropagationDelayModel : public PropagationDelayModel
78
class RandomPropagationDelayModel : public PropagationDelayModel
75
{
79
{
76
public:
80
public:
81
  /**
82
   * \brief Get the type ID.
83
   * \return the object TypeId
84
   */
77
  static TypeId GetTypeId (void);
85
  static TypeId GetTypeId (void);
78
86
79
  /**
87
  /**
 Lines 84-90    Link Here 
84
  virtual Time GetDelay (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
92
  virtual Time GetDelay (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
85
private:
93
private:
86
  virtual int64_t DoAssignStreams (int64_t stream);
94
  virtual int64_t DoAssignStreams (int64_t stream);
87
  Ptr<RandomVariableStream> m_variable;
95
  Ptr<RandomVariableStream> m_variable; //!< random generator
88
};
96
};
89
97
90
/**
98
/**
 Lines 95-100    Link Here 
95
class ConstantSpeedPropagationDelayModel : public PropagationDelayModel
103
class ConstantSpeedPropagationDelayModel : public PropagationDelayModel
96
{
104
{
97
public:
105
public:
106
  /**
107
   * \brief Get the type ID.
108
   * \return the object TypeId
109
   */
98
  static TypeId GetTypeId (void);
110
  static TypeId GetTypeId (void);
99
111
100
  /**
112
  /**
 Lines 112-118    Link Here 
112
  double GetSpeed (void) const;
124
  double GetSpeed (void) const;
113
private:
125
private:
114
  virtual int64_t DoAssignStreams (int64_t stream);
126
  virtual int64_t DoAssignStreams (int64_t stream);
115
  double m_speed;
127
  double m_speed; //!< speed
116
};
128
};
117
129
118
} // namespace ns3
130
} // namespace ns3
(-)a/src/propagation/model/propagation-loss-model.cc (-7 / +3 lines)
 Lines 140-147    Link Here 
140
140
141
NS_OBJECT_ENSURE_REGISTERED (FriisPropagationLossModel);
141
NS_OBJECT_ENSURE_REGISTERED (FriisPropagationLossModel);
142
142
143
const double FriisPropagationLossModel::PI = 3.14159265358979323846;
144
145
TypeId 
143
TypeId 
146
FriisPropagationLossModel::GetTypeId (void)
144
FriisPropagationLossModel::GetTypeId (void)
147
{
145
{
 Lines 264-270    Link Here 
264
      return txPowerDbm - m_minLoss;
262
      return txPowerDbm - m_minLoss;
265
    }
263
    }
266
  double numerator = m_lambda * m_lambda;
264
  double numerator = m_lambda * m_lambda;
267
  double denominator = 16 * PI * PI * distance * distance * m_systemLoss;
265
  double denominator = 16 * M_PI * M_PI * distance * distance * m_systemLoss;
268
  double lossDb = -10 * log10 (numerator / denominator);
266
  double lossDb = -10 * log10 (numerator / denominator);
269
  NS_LOG_DEBUG ("distance=" << distance<< "m, loss=" << lossDb <<"dB");
267
  NS_LOG_DEBUG ("distance=" << distance<< "m, loss=" << lossDb <<"dB");
270
  return txPowerDbm - std::max (lossDb, m_minLoss);
268
  return txPowerDbm - std::max (lossDb, m_minLoss);
 Lines 281-288    Link Here 
281
279
282
NS_OBJECT_ENSURE_REGISTERED (TwoRayGroundPropagationLossModel);
280
NS_OBJECT_ENSURE_REGISTERED (TwoRayGroundPropagationLossModel);
283
281
284
const double TwoRayGroundPropagationLossModel::PI = 3.14159265358979323846;
285
286
TypeId 
282
TypeId 
287
TwoRayGroundPropagationLossModel::GetTypeId (void)
283
TwoRayGroundPropagationLossModel::GetTypeId (void)
288
{
284
{
 Lines 419-431    Link Here 
419
   *
415
   *
420
   */
416
   */
421
417
422
  double dCross = (4 * PI * txAntHeight * rxAntHeight) / m_lambda;
418
  double dCross = (4 * M_PI * txAntHeight * rxAntHeight) / m_lambda;
423
  double tmp = 0;
419
  double tmp = 0;
424
  if (distance <= dCross)
420
  if (distance <= dCross)
425
    {
421
    {
426
      // We use Friis
422
      // We use Friis
427
      double numerator = m_lambda * m_lambda;
423
      double numerator = m_lambda * m_lambda;
428
      tmp = PI * distance;
424
      tmp = M_PI * distance;
429
      double denominator = 16 * tmp * tmp * m_systemLoss;
425
      double denominator = 16 * tmp * tmp * m_systemLoss;
430
      double pr = 10 * std::log10 (numerator / denominator);
426
      double pr = 10 * std::log10 (numerator / denominator);
431
      NS_LOG_DEBUG ("Receiver within crossover (" << dCross << "m) for Two_ray path; using Friis");
427
      NS_LOG_DEBUG ("Receiver within crossover (" << dCross << "m) for Two_ray path; using Friis");
(-)a/src/propagation/model/propagation-loss-model.h (-57 / +266 lines)
 Lines 41-47    Link Here 
41
/**
41
/**
42
 * \ingroup propagation
42
 * \ingroup propagation
43
 *
43
 *
44
 * \brief Modelize the propagation loss through a transmission medium
44
 * \brief Models the propagation loss through a transmission medium
45
 *
45
 *
46
 * Calculate the receive power (dbm) from a transmit power (dbm)
46
 * Calculate the receive power (dbm) from a transmit power (dbm)
47
 * and a mobility model for the source and destination positions.
47
 * and a mobility model for the source and destination positions.
 Lines 49-54    Link Here 
49
class PropagationLossModel : public Object
49
class PropagationLossModel : public Object
50
{
50
{
51
public:
51
public:
52
  /**
53
   * Get the type ID.
54
   * \brief Get the type ID.
55
   * \return the object TypeId
56
   */
52
  static TypeId GetTypeId (void);
57
  static TypeId GetTypeId (void);
53
58
54
  PropagationLossModel ();
59
  PropagationLossModel ();
 Lines 76-81    Link Here 
76
  Ptr<PropagationLossModel> GetNext ();
81
  Ptr<PropagationLossModel> GetNext ();
77
82
78
  /**
83
  /**
84
   * Returns the Rx Power taking into account all the PropagatinLossModel(s)
85
   * chained to the current one.
86
   *
79
   * \param txPowerDbm current transmission power (in dBm)
87
   * \param txPowerDbm current transmission power (in dBm)
80
   * \param a the mobility model of the source
88
   * \param a the mobility model of the source
81
   * \param b the mobility model of the destination
89
   * \param b the mobility model of the destination
 Lines 99-106    Link Here 
99
  int64_t AssignStreams (int64_t stream);
107
  int64_t AssignStreams (int64_t stream);
100
108
101
private:
109
private:
102
  PropagationLossModel (const PropagationLossModel &o);
110
  /**
103
  PropagationLossModel &operator = (const PropagationLossModel &o);
111
   * \brief Copy constructor
112
   *
113
   * Defined and unimplemented to avoid misuse
114
   */
115
  PropagationLossModel (const PropagationLossModel &);
116
  /**
117
   * \brief Copy constructor
118
   *
119
   * Defined and unimplemented to avoid misuse
120
   * \returns
121
   */
122
  PropagationLossModel &operator = (const PropagationLossModel &);
123
124
  /**
125
   * Returns the Rx Power taking into account only the particular
126
   * PropagatinLossModel.
127
   *
128
   * \param txPowerDbm current transmission power (in dBm)
129
   * \param a the mobility model of the source
130
   * \param b the mobility model of the destination
131
   * \returns the reception power after adding/multiplying propagation loss (in dBm)
132
   */
104
  virtual double DoCalcRxPower (double txPowerDbm,
133
  virtual double DoCalcRxPower (double txPowerDbm,
105
                                Ptr<MobilityModel> a,
134
                                Ptr<MobilityModel> a,
106
                                Ptr<MobilityModel> b) const = 0;
135
                                Ptr<MobilityModel> b) const = 0;
 Lines 111-117    Link Here 
111
   */
140
   */
112
  virtual int64_t DoAssignStreams (int64_t stream) = 0;
141
  virtual int64_t DoAssignStreams (int64_t stream) = 0;
113
142
114
  Ptr<PropagationLossModel> m_next;
143
  Ptr<PropagationLossModel> m_next; //!< Next propagation loss model in the list
115
};
144
};
116
145
117
/**
146
/**
 Lines 122-140    Link Here 
122
class RandomPropagationLossModel : public PropagationLossModel
151
class RandomPropagationLossModel : public PropagationLossModel
123
{
152
{
124
public:
153
public:
154
  /**
155
   * \brief Get the type ID.
156
   * \return the object TypeId
157
   */
125
  static TypeId GetTypeId (void);
158
  static TypeId GetTypeId (void);
126
159
127
  RandomPropagationLossModel ();
160
  RandomPropagationLossModel ();
128
  virtual ~RandomPropagationLossModel ();
161
  virtual ~RandomPropagationLossModel ();
129
162
130
private:
163
private:
131
  RandomPropagationLossModel (const RandomPropagationLossModel &o);
164
  /**
132
  RandomPropagationLossModel & operator = (const RandomPropagationLossModel &o);
165
   * \brief Copy constructor
166
   *
167
   * Defined and unimplemented to avoid misuse
168
   */
169
  RandomPropagationLossModel (const RandomPropagationLossModel &);
170
  /**
171
   * \brief Copy constructor
172
   *
173
   * Defined and unimplemented to avoid misuse
174
   * \returns
175
   */
176
  RandomPropagationLossModel & operator = (const RandomPropagationLossModel &);
133
  virtual double DoCalcRxPower (double txPowerDbm,
177
  virtual double DoCalcRxPower (double txPowerDbm,
134
                                Ptr<MobilityModel> a,
178
                                Ptr<MobilityModel> a,
135
                                Ptr<MobilityModel> b) const;
179
                                Ptr<MobilityModel> b) const;
136
  virtual int64_t DoAssignStreams (int64_t stream);
180
  virtual int64_t DoAssignStreams (int64_t stream);
137
  Ptr<RandomVariableStream> m_variable;
181
  Ptr<RandomVariableStream> m_variable; //!< random generator
138
};
182
};
139
183
140
/**
184
/**
 Lines 217-222    Link Here 
217
class FriisPropagationLossModel : public PropagationLossModel
261
class FriisPropagationLossModel : public PropagationLossModel
218
{
262
{
219
public:
263
public:
264
  /**
265
   * \brief Get the type ID.
266
   * \return the object TypeId
267
   */
220
  static TypeId GetTypeId (void);
268
  static TypeId GetTypeId (void);
221
  FriisPropagationLossModel ();
269
  FriisPropagationLossModel ();
222
  /**
270
  /**
 Lines 256-275    Link Here 
256
  double GetSystemLoss (void) const;
304
  double GetSystemLoss (void) const;
257
305
258
private:
306
private:
259
  FriisPropagationLossModel (const FriisPropagationLossModel &o);
307
  /**
260
  FriisPropagationLossModel & operator = (const FriisPropagationLossModel &o);
308
   * \brief Copy constructor
309
   *
310
   * Defined and unimplemented to avoid misuse
311
   */
312
  FriisPropagationLossModel (const FriisPropagationLossModel &);
313
  /**
314
   * \brief Copy constructor
315
   *
316
   * Defined and unimplemented to avoid misuse
317
   * \returns
318
   */
319
  FriisPropagationLossModel & operator = (const FriisPropagationLossModel &);
320
261
  virtual double DoCalcRxPower (double txPowerDbm,
321
  virtual double DoCalcRxPower (double txPowerDbm,
262
                                Ptr<MobilityModel> a,
322
                                Ptr<MobilityModel> a,
263
                                Ptr<MobilityModel> b) const;
323
                                Ptr<MobilityModel> b) const;
264
  virtual int64_t DoAssignStreams (int64_t stream);
324
  virtual int64_t DoAssignStreams (int64_t stream);
325
326
  /**
327
   * Transforms a Dbm value to Watt
328
   * \param dbm the Dbm value
329
   * \return the Watts
330
   */
265
  double DbmToW (double dbm) const;
331
  double DbmToW (double dbm) const;
332
333
  /**
334
   * Transforms a Watt value to Dbm
335
   * \param w the Watt value
336
   * \return the Dbm
337
   */
266
  double DbmFromW (double w) const;
338
  double DbmFromW (double w) const;
267
339
268
  static const double PI;
340
  double m_lambda;        //!< the carrier wavelength
269
  double m_lambda;
341
  double m_frequency;     //!< the carrier frequency
270
  double m_frequency;
342
  double m_systemLoss;    //!< the system loss
271
  double m_systemLoss;
343
  double m_minLoss;       //!< the minimum loss
272
  double m_minLoss;
273
};
344
};
274
345
275
/**
346
/**
 Lines 303-308    Link Here 
303
class TwoRayGroundPropagationLossModel : public PropagationLossModel
374
class TwoRayGroundPropagationLossModel : public PropagationLossModel
304
{
375
{
305
public:
376
public:
377
  /**
378
   * \brief Get the type ID.
379
   * \return the object TypeId
380
   */
306
  static TypeId GetTypeId (void);
381
  static TypeId GetTypeId (void);
307
  TwoRayGroundPropagationLossModel ();
382
  TwoRayGroundPropagationLossModel ();
308
383
 Lines 349-369    Link Here 
349
  void SetHeightAboveZ (double heightAboveZ);
424
  void SetHeightAboveZ (double heightAboveZ);
350
425
351
private:
426
private:
352
  TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &o);
427
  /**
353
  TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &o);
428
   * \brief Copy constructor
429
   *
430
   * Defined and unimplemented to avoid misuse
431
   */
432
  TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &);
433
  /**
434
   * \brief Copy constructor
435
   *
436
   * Defined and unimplemented to avoid misuse
437
   * \returns
438
   */
439
  TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &);
440
354
  virtual double DoCalcRxPower (double txPowerDbm,
441
  virtual double DoCalcRxPower (double txPowerDbm,
355
                                Ptr<MobilityModel> a,
442
                                Ptr<MobilityModel> a,
356
                                Ptr<MobilityModel> b) const;
443
                                Ptr<MobilityModel> b) const;
357
  virtual int64_t DoAssignStreams (int64_t stream);
444
  virtual int64_t DoAssignStreams (int64_t stream);
445
446
  /**
447
   * Transforms a Dbm value to Watt
448
   * \param dbm the Dbm value
449
   * \return the Watts
450
   */
358
  double DbmToW (double dbm) const;
451
  double DbmToW (double dbm) const;
452
453
  /**
454
   * Transforms a Watt value to Dbm
455
   * \param w the Watt value
456
   * \return the Dbm
457
   */
359
  double DbmFromW (double w) const;
458
  double DbmFromW (double w) const;
360
459
361
  static const double PI;
460
  double m_lambda;        //!< the carrier wavelength
362
  double m_lambda;
461
  double m_frequency;     //!< the carrier frequency
363
  double m_frequency;
462
  double m_systemLoss;    //!< the system loss
364
  double m_systemLoss;
463
  double m_minDistance;   //!< minimum distance for the model
365
  double m_minDistance;
464
  double m_heightAboveZ;  //!< antenna height above the node's Z coordinate
366
  double m_heightAboveZ;
367
};
465
};
368
466
369
/**
467
/**
 Lines 389-394    Link Here 
389
class LogDistancePropagationLossModel : public PropagationLossModel
487
class LogDistancePropagationLossModel : public PropagationLossModel
390
{
488
{
391
public:
489
public:
490
  /**
491
   * \brief Get the type ID.
492
   * \return the object TypeId
493
   */
392
  static TypeId GetTypeId (void);
494
  static TypeId GetTypeId (void);
393
  LogDistancePropagationLossModel ();
495
  LogDistancePropagationLossModel ();
394
496
 Lines 402-421    Link Here 
402
   */
504
   */
403
  double GetPathLossExponent (void) const;
505
  double GetPathLossExponent (void) const;
404
506
507
  /**
508
   * Set the reference path loss at a given distance
509
   * \param referenceDistance reference distance
510
   * \param referenceLoss reference path loss
511
   */
405
  void SetReference (double referenceDistance, double referenceLoss);
512
  void SetReference (double referenceDistance, double referenceLoss);
406
513
407
private:
514
private:
408
  LogDistancePropagationLossModel (const LogDistancePropagationLossModel &o);
515
  /**
409
  LogDistancePropagationLossModel & operator = (const LogDistancePropagationLossModel &o);
516
   * \brief Copy constructor
517
   *
518
   * Defined and unimplemented to avoid misuse
519
   */
520
  LogDistancePropagationLossModel (const LogDistancePropagationLossModel &);
521
  /**
522
   * \brief Copy constructor
523
   *
524
   * Defined and unimplemented to avoid misuse
525
   * \returns
526
   */
527
  LogDistancePropagationLossModel & operator = (const LogDistancePropagationLossModel &);
528
410
  virtual double DoCalcRxPower (double txPowerDbm,
529
  virtual double DoCalcRxPower (double txPowerDbm,
411
                                Ptr<MobilityModel> a,
530
                                Ptr<MobilityModel> a,
412
                                Ptr<MobilityModel> b) const;
531
                                Ptr<MobilityModel> b) const;
413
  virtual int64_t DoAssignStreams (int64_t stream);
532
  virtual int64_t DoAssignStreams (int64_t stream);
533
534
  /**
535
   *  Creates a default reference loss model
536
   * \return a default reference loss model
537
   */
414
  static Ptr<PropagationLossModel> CreateDefaultReference (void);
538
  static Ptr<PropagationLossModel> CreateDefaultReference (void);
415
539
416
  double m_exponent;
540
  double m_exponent; //!< model exponent
417
  double m_referenceDistance;
541
  double m_referenceDistance; //!< reference distance
418
  double m_referenceLoss;
542
  double m_referenceLoss; //!< reference loss
419
};
543
};
420
544
421
/**
545
/**
 Lines 461-489    Link Here 
461
class ThreeLogDistancePropagationLossModel : public PropagationLossModel
585
class ThreeLogDistancePropagationLossModel : public PropagationLossModel
462
{
586
{
463
public:
587
public:
588
  /**
589
   * \brief Get the type ID.
590
   * \return the object TypeId
591
   */
464
  static TypeId GetTypeId (void);
592
  static TypeId GetTypeId (void);
465
  ThreeLogDistancePropagationLossModel ();
593
  ThreeLogDistancePropagationLossModel ();
466
594
467
  // Parameters are all accessible via attributes.
595
  // Parameters are all accessible via attributes.
468
596
469
private:
597
private:
470
  ThreeLogDistancePropagationLossModel (const ThreeLogDistancePropagationLossModel& o);
598
  /**
471
  ThreeLogDistancePropagationLossModel& operator= (const ThreeLogDistancePropagationLossModel& o);
599
   * \brief Copy constructor
600
   *
601
   * Defined and unimplemented to avoid misuse
602
   */
603
  ThreeLogDistancePropagationLossModel (const ThreeLogDistancePropagationLossModel&);
604
  /**
605
   * \brief Copy constructor
606
   *
607
   * Defined and unimplemented to avoid misuse
608
   * \returns
609
   */
610
  ThreeLogDistancePropagationLossModel& operator= (const ThreeLogDistancePropagationLossModel&);
472
611
473
  virtual double DoCalcRxPower (double txPowerDbm,
612
  virtual double DoCalcRxPower (double txPowerDbm,
474
                                Ptr<MobilityModel> a,
613
                                Ptr<MobilityModel> a,
475
                                Ptr<MobilityModel> b) const;
614
                                Ptr<MobilityModel> b) const;
476
  virtual int64_t DoAssignStreams (int64_t stream);
615
  virtual int64_t DoAssignStreams (int64_t stream);
477
616
478
  double m_distance0;
617
  double m_distance0; //!< Beginning of the first (near) distance field
479
  double m_distance1;
618
  double m_distance1; //!< Beginning of the second (middle) distance field.
480
  double m_distance2;
619
  double m_distance2; //!< Beginning of the third (far) distance field.
481
620
482
  double m_exponent0;
621
  double m_exponent0; //!< The exponent for the first field.
483
  double m_exponent1;
622
  double m_exponent1; //!< The exponent for the second field.
484
  double m_exponent2;
623
  double m_exponent2; //!< The exponent for the third field.
485
624
486
  double m_referenceLoss;
625
  double m_referenceLoss; //!< The reference loss at distance d0 (dB).
487
};
626
};
488
627
489
/**
628
/**
 Lines 509-514    Link Here 
509
class NakagamiPropagationLossModel : public PropagationLossModel
648
class NakagamiPropagationLossModel : public PropagationLossModel
510
{
649
{
511
public:
650
public:
651
  /**
652
   * \brief Get the type ID.
653
   * \return the object TypeId
654
   */
512
  static TypeId GetTypeId (void);
655
  static TypeId GetTypeId (void);
513
656
514
  NakagamiPropagationLossModel ();
657
  NakagamiPropagationLossModel ();
 Lines 516-538    Link Here 
516
  // Parameters are all accessible via attributes.
659
  // Parameters are all accessible via attributes.
517
660
518
private:
661
private:
519
  NakagamiPropagationLossModel (const NakagamiPropagationLossModel& o);
662
  /**
520
  NakagamiPropagationLossModel& operator= (const NakagamiPropagationLossModel& o);
663
   * \brief Copy constructor
664
   *
665
   * Defined and unimplemented to avoid misuse
666
   */
667
  NakagamiPropagationLossModel (const NakagamiPropagationLossModel&);
668
  /**
669
   * \brief Copy constructor
670
   *
671
   * Defined and unimplemented to avoid misuse
672
   * \returns
673
   */
674
  NakagamiPropagationLossModel& operator= (const NakagamiPropagationLossModel&);
521
675
522
  virtual double DoCalcRxPower (double txPowerDbm,
676
  virtual double DoCalcRxPower (double txPowerDbm,
523
                                Ptr<MobilityModel> a,
677
                                Ptr<MobilityModel> a,
524
                                Ptr<MobilityModel> b) const;
678
                                Ptr<MobilityModel> b) const;
525
  virtual int64_t DoAssignStreams (int64_t stream);
679
  virtual int64_t DoAssignStreams (int64_t stream);
526
680
527
  double m_distance1;
681
  double m_distance1; //!< Distance1
528
  double m_distance2;
682
  double m_distance2; //!< Distance2
529
683
530
  double m_m0;
684
  double m_m0;        //!< m for distances smaller than Distance1
531
  double m_m1;
685
  double m_m1;        //!< m for distances smaller than Distance2
532
  double m_m2;
686
  double m_m2;        //!< m for distances greater than Distance2
533
687
534
  Ptr<ErlangRandomVariable>  m_erlangRandomVariable;
688
  Ptr<ErlangRandomVariable>  m_erlangRandomVariable; //!< Erlang random variable
535
  Ptr<GammaRandomVariable> m_gammaRandomVariable;
689
  Ptr<GammaRandomVariable> m_gammaRandomVariable;    //!< Gamma random variable
536
};
690
};
537
691
538
/**
692
/**
 Lines 551-556    Link Here 
551
class FixedRssLossModel : public PropagationLossModel
705
class FixedRssLossModel : public PropagationLossModel
552
{
706
{
553
public:
707
public:
708
  /**
709
   * \brief Get the type ID.
710
   * \return the object TypeId
711
   */
554
  static TypeId GetTypeId (void);
712
  static TypeId GetTypeId (void);
555
713
556
  FixedRssLossModel ();
714
  FixedRssLossModel ();
 Lines 563-575    Link Here 
563
  void SetRss (double rss);
721
  void SetRss (double rss);
564
722
565
private:
723
private:
566
  FixedRssLossModel (const FixedRssLossModel &o);
724
  /**
567
  FixedRssLossModel & operator = (const FixedRssLossModel &o);
725
   * \brief Copy constructor
726
   *
727
   * Defined and unimplemented to avoid misuse
728
   */
729
  FixedRssLossModel (const FixedRssLossModel &);
730
  /**
731
   * \brief Copy constructor
732
   *
733
   * Defined and unimplemented to avoid misuse
734
   * \returns
735
   */
736
  FixedRssLossModel & operator = (const FixedRssLossModel &);
737
568
  virtual double DoCalcRxPower (double txPowerDbm,
738
  virtual double DoCalcRxPower (double txPowerDbm,
569
                                Ptr<MobilityModel> a,
739
                                Ptr<MobilityModel> a,
570
                                Ptr<MobilityModel> b) const;
740
                                Ptr<MobilityModel> b) const;
741
571
  virtual int64_t DoAssignStreams (int64_t stream);
742
  virtual int64_t DoAssignStreams (int64_t stream);
572
  double m_rss;
743
  double m_rss; //!< the received signal strength
573
};
744
};
574
745
575
/**
746
/**
 Lines 582-587    Link Here 
582
class MatrixPropagationLossModel : public PropagationLossModel
753
class MatrixPropagationLossModel : public PropagationLossModel
583
{
754
{
584
public:
755
public:
756
  /**
757
   * \brief Get the type ID.
758
   * \return the object TypeId
759
   */
585
  static TypeId GetTypeId (void);
760
  static TypeId GetTypeId (void);
586
761
587
  MatrixPropagationLossModel ();
762
  MatrixPropagationLossModel ();
 Lines 597-617    Link Here 
597
   * \param symmetric   If true (default), both a->b and b->a paths will be affected
772
   * \param symmetric   If true (default), both a->b and b->a paths will be affected
598
   */ 
773
   */ 
599
  void SetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b, double loss, bool symmetric = true);
774
  void SetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b, double loss, bool symmetric = true);
600
  /// Set default loss (in dB, positive) to be used, infinity if not set
775
601
  void SetDefaultLoss (double);
776
  /**
777
   * Set the default propagation loss (in dB, positive) to be used, infinity if not set
778
   * \param defaultLoss the default proagation loss
779
   */
780
  void SetDefaultLoss (double defaultLoss);
602
781
603
private:
782
private:
783
  /**
784
   * \brief Copy constructor
785
   *
786
   * Defined and unimplemented to avoid misuse
787
   */
788
  MatrixPropagationLossModel (const MatrixPropagationLossModel &);
789
  /**
790
   * \brief Copy constructor
791
   *
792
   * Defined and unimplemented to avoid misuse
793
   * \returns
794
   */
795
  MatrixPropagationLossModel &operator = (const MatrixPropagationLossModel &);
796
604
  virtual double DoCalcRxPower (double txPowerDbm,
797
  virtual double DoCalcRxPower (double txPowerDbm,
605
                                Ptr<MobilityModel> a,
798
                                Ptr<MobilityModel> a,
606
                                Ptr<MobilityModel> b) const;
799
                                Ptr<MobilityModel> b) const;
800
607
  virtual int64_t DoAssignStreams (int64_t stream);
801
  virtual int64_t DoAssignStreams (int64_t stream);
608
private:
802
private:
609
  /// default loss
803
  double m_default; //!< default loss
610
  double m_default; 
611
804
805
  /// Typedef: Mobility models pair
612
  typedef std::pair< Ptr<MobilityModel>, Ptr<MobilityModel> > MobilityPair; 
806
  typedef std::pair< Ptr<MobilityModel>, Ptr<MobilityModel> > MobilityPair; 
613
  /// Fixed loss between pair of nodes
807
614
  std::map<MobilityPair, double> m_loss;
808
  std::map<MobilityPair, double> m_loss; //!< Propagation loss between pair of nodes
615
};
809
};
616
810
617
/**
811
/**
 Lines 627-643    Link Here 
627
class RangePropagationLossModel : public PropagationLossModel
821
class RangePropagationLossModel : public PropagationLossModel
628
{
822
{
629
public:
823
public:
824
  /**
825
   * \brief Get the type ID.
826
   * \return the object TypeId
827
   */
630
  static TypeId GetTypeId (void);
828
  static TypeId GetTypeId (void);
631
  RangePropagationLossModel ();
829
  RangePropagationLossModel ();
632
private:
830
private:
633
  RangePropagationLossModel (const RangePropagationLossModel& o);
831
  /**
634
  RangePropagationLossModel& operator= (const RangePropagationLossModel& o);
832
   * \brief Copy constructor
833
   *
834
   * Defined and unimplemented to avoid misuse
835
   */
836
  RangePropagationLossModel (const RangePropagationLossModel&);
837
  /**
838
   * \brief Copy constructor
839
   *
840
   * Defined and unimplemented to avoid misuse
841
   * \returns
842
   */
843
  RangePropagationLossModel& operator= (const RangePropagationLossModel&);
635
  virtual double DoCalcRxPower (double txPowerDbm,
844
  virtual double DoCalcRxPower (double txPowerDbm,
636
                                Ptr<MobilityModel> a,
845
                                Ptr<MobilityModel> a,
637
                                Ptr<MobilityModel> b) const;
846
                                Ptr<MobilityModel> b) const;
638
  virtual int64_t DoAssignStreams (int64_t stream);
847
  virtual int64_t DoAssignStreams (int64_t stream);
639
private:
848
private:
640
  double m_range;
849
  double m_range; //!< Maximum Transmission Range (meters)
641
};
850
};
642
851
643
} // namespace ns3
852
} // namespace ns3

Return to bug 938