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

(-)a/src/wifi/model/rrpaa-wifi-manager.cc (-5 / +5 lines)
 Lines 204-214    Link Here 
204
  m_calcTxTime.push_back (std::make_pair (t, mode));
204
  m_calcTxTime.push_back (std::make_pair (t, mode));
205
}
205
}
206
206
207
Thresholds
207
WifiRrpaaThresholds
208
RrpaaWifiManager::GetThresholds (RrpaaWifiRemoteStation *station, WifiMode mode) const
208
RrpaaWifiManager::GetThresholds (RrpaaWifiRemoteStation *station, WifiMode mode) const
209
{
209
{
210
  NS_LOG_FUNCTION (this << station << mode);
210
  NS_LOG_FUNCTION (this << station << mode);
211
  struct Thresholds threshold;
211
  struct WifiRrpaaThresholds threshold;
212
  for (RrpaaThresholdsTable::const_iterator i = station->m_thresholds.begin (); i != station->m_thresholds.end (); i++)
212
  for (RrpaaThresholdsTable::const_iterator i = station->m_thresholds.begin (); i != station->m_thresholds.end (); i++)
213
    {
213
    {
214
      if (mode == i->second)
214
      if (mode == i->second)
 Lines 303-309    Link Here 
303
        {
303
        {
304
          mtl = nextMtl;
304
          mtl = nextMtl;
305
        }
305
        }
306
      Thresholds th;
306
      WifiRrpaaThresholds th;
307
      th.m_ewnd = ceil (m_tau / totalTxTime.GetSeconds ());
307
      th.m_ewnd = ceil (m_tau / totalTxTime.GetSeconds ());
308
      th.m_ori = ori;
308
      th.m_ori = ori;
309
      th.m_mtl = mtl;
309
      th.m_mtl = mtl;
 Lines 463-469    Link Here 
463
RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station)
463
RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station)
464
{
464
{
465
  NS_LOG_FUNCTION (this << station);
465
  NS_LOG_FUNCTION (this << station);
466
  Thresholds thresholds = GetThresholds (station, station->m_rateIndex);
466
  WifiRrpaaThresholds thresholds = GetThresholds (station, station->m_rateIndex);
467
  double bploss = (double) station->m_nFailed / (double) thresholds.m_ewnd;
467
  double bploss = (double) station->m_nFailed / (double) thresholds.m_ewnd;
468
  double wploss = (double) (station->m_counter + station->m_nFailed) / (double) thresholds.m_ewnd;
468
  double wploss = (double) (station->m_counter + station->m_nFailed) / (double) thresholds.m_ewnd;
469
  NS_LOG_DEBUG ("Best loss prob= " << bploss);
469
  NS_LOG_DEBUG ("Best loss prob= " << bploss);
 Lines 595-601    Link Here 
595
    }
595
    }
596
}
596
}
597
597
598
Thresholds
598
WifiRrpaaThresholds
599
RrpaaWifiManager::GetThresholds (RrpaaWifiRemoteStation *station,
599
RrpaaWifiManager::GetThresholds (RrpaaWifiRemoteStation *station,
600
                                 uint32_t rate) const
600
                                 uint32_t rate) const
601
{
601
{
(-)a/src/wifi/model/rrpaa-wifi-manager.h (-4 / +4 lines)
 Lines 51-57    Link Here 
51
 * For each rate there is a Opportunistic Rate Increase threshold,
51
 * For each rate there is a Opportunistic Rate Increase threshold,
52
 * a Maximum Tolerable Loss threshold and an Evaluation Window.
52
 * a Maximum Tolerable Loss threshold and an Evaluation Window.
53
 */
53
 */
54
struct Thresholds
54
struct WifiRrpaaThresholds
55
{
55
{
56
  double m_ori; //!< The Oportunistic Rate Increase threshold.
56
  double m_ori; //!< The Oportunistic Rate Increase threshold.
57
  double m_mtl; //!< The Maximum Tolerable Loss threshold.
57
  double m_mtl; //!< The Maximum Tolerable Loss threshold.
 Lines 61-67    Link Here 
61
/**
61
/**
62
 * List of thresholds for each mode.
62
 * List of thresholds for each mode.
63
 */
63
 */
64
typedef std::vector<std::pair<Thresholds,WifiMode> > RrpaaThresholdsTable;
64
typedef std::vector<std::pair<WifiRrpaaThresholds,WifiMode> > RrpaaThresholdsTable;
65
65
66
/**
66
/**
67
 * List of probabilities.
67
 * List of probabilities.
 Lines 164-170    Link Here 
164
   *
164
   *
165
   * \return threshold
165
   * \return threshold
166
   */
166
   */
167
  Thresholds GetThresholds (RrpaaWifiRemoteStation *station, WifiMode mode) const;
167
  WifiRrpaaThresholds GetThresholds (RrpaaWifiRemoteStation *station, WifiMode mode) const;
168
168
169
  /**
169
  /**
170
   * Get the thresholds for the given station and mode index.
170
   * Get the thresholds for the given station and mode index.
 Lines 174-180    Link Here 
174
   *
174
   *
175
   * \return threshold
175
   * \return threshold
176
   */
176
   */
177
  Thresholds GetThresholds (RrpaaWifiRemoteStation *station, uint32_t rate) const;
177
  WifiRrpaaThresholds GetThresholds (RrpaaWifiRemoteStation *station, uint32_t rate) const;
178
178
179
  /**
179
  /**
180
   * Get the estimated TxTime of a packet with a given mode.
180
   * Get the estimated TxTime of a packet with a given mode.

Return to bug 2654