bug 627: Jakes Propagation Loss Model doesn't properly calculate signal loss
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon Jul 13 09:57:32 2009 +0200 (7 months ago)
changeset 46997555c9a0564b
parent 4698 280e7729894c
child 4700 a52c39181dd4
bug 627: Jakes Propagation Loss Model doesn't properly calculate signal loss
src/devices/wifi/jakes-propagation-loss-model.cc
src/devices/wifi/jakes-propagation-loss-model.h
     1.1 --- a/src/devices/wifi/jakes-propagation-loss-model.cc	Mon Jul 13 09:07:02 2009 +0200
     1.2 +++ b/src/devices/wifi/jakes-propagation-loss-model.cc	Mon Jul 13 09:57:32 2009 +0200
     1.3 @@ -138,13 +138,15 @@
     1.4      .AddAttribute ("NumberOfRaysPerPath",
     1.5                     "The number of rays to use by default for compute the fading coeficent for a given path (default is 1)",
     1.6                     UintegerValue (1),
     1.7 -		   MakeUintegerAccessor (&JakesPropagationLossModel::m_nRays),
     1.8 +		   MakeUintegerAccessor (&JakesPropagationLossModel::SetNRays,
     1.9 +                                         &JakesPropagationLossModel::GetNRays),
    1.10  		   MakeUintegerChecker<uint8_t> ())
    1.11      .AddAttribute ("NumberOfOscillatorsPerRay",
    1.12                     "The number of oscillators to use by default for compute the coeficent for a given ray of a given "
    1.13                     "path (default is 4)",
    1.14                     UintegerValue (4),
    1.15 -		   MakeUintegerAccessor (&JakesPropagationLossModel::m_nOscillators),
    1.16 +		   MakeUintegerAccessor (&JakesPropagationLossModel::SetNOscillators,
    1.17 +                                         &JakesPropagationLossModel::GetNOscillators),
    1.18  		   MakeUintegerChecker<uint8_t> ())
    1.19      .AddAttribute ("DopplerFreq",
    1.20                     "The doppler frequency in Hz (f_d = v / lambda = v * f / c), the default is 0)",
    1.21 @@ -161,9 +163,10 @@
    1.22  }
    1.23  
    1.24  JakesPropagationLossModel::JakesPropagationLossModel ()
    1.25 -{
    1.26 -  DoConstruct ();
    1.27 -}
    1.28 +  : m_amp (0),
    1.29 +    m_nRays (0),
    1.30 +    m_nOscillators (0)
    1.31 +{}
    1.32  
    1.33  JakesPropagationLossModel::~JakesPropagationLossModel ()
    1.34  {
    1.35 @@ -181,8 +184,16 @@
    1.36  }
    1.37  
    1.38  void
    1.39 -JakesPropagationLossModel::DoConstruct ()
    1.40 +JakesPropagationLossModel::SetNRays (uint8_t nRays)
    1.41  {
    1.42 +  m_nRays = nRays;
    1.43 +}
    1.44 +
    1.45 +void
    1.46 +JakesPropagationLossModel::SetNOscillators (uint8_t nOscillators)
    1.47 +{
    1.48 +  m_nOscillators = nOscillators;
    1.49 +  delete [] m_amp;
    1.50    uint16_t N = 4 * m_nOscillators + 2;
    1.51    m_amp = new ComplexNumber[m_nOscillators + 1];
    1.52    m_amp[0].real = 2.0 * sqrt(2.0 / N) * cos (PI / 4.0);
    1.53 @@ -195,17 +206,17 @@
    1.54      }
    1.55  }
    1.56  
    1.57 -void
    1.58 -JakesPropagationLossModel::SetNRays (uint8_t nRays)
    1.59 +uint8_t 
    1.60 +JakesPropagationLossModel::GetNRays (void) const
    1.61  {
    1.62 -  m_nRays = nRays;
    1.63 +  return m_nRays;
    1.64 +}
    1.65 +uint8_t 
    1.66 +JakesPropagationLossModel::GetNOscillators (void) const
    1.67 +{
    1.68 +  return m_nOscillators;
    1.69  }
    1.70  
    1.71 -void
    1.72 -JakesPropagationLossModel::SetNOscillators (uint8_t nOscillators)
    1.73 -{
    1.74 -  m_nOscillators = nOscillators;
    1.75 -}
    1.76  
    1.77  double 
    1.78  JakesPropagationLossModel::DoCalcRxPower (double txPowerDbm,
     2.1 --- a/src/devices/wifi/jakes-propagation-loss-model.h	Mon Jul 13 09:07:02 2009 +0200
     2.2 +++ b/src/devices/wifi/jakes-propagation-loss-model.h	Mon Jul 13 09:57:32 2009 +0200
     2.3 @@ -96,6 +96,9 @@
     2.4     */
     2.5    void SetNOscillators (uint8_t nOscillators);
     2.6  
     2.7 +  uint8_t GetNRays (void) const;
     2.8 +  uint8_t GetNOscillators (void) const;
     2.9 +
    2.10  private:
    2.11    JakesPropagationLossModel (const JakesPropagationLossModel &o);
    2.12    JakesPropagationLossModel & operator = (const JakesPropagationLossModel &o);