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

(-)a/src/wifi/model/rrpaa-wifi-manager.cc (-7 / +7 lines)
 Lines 246-257   RrpaaWifiManager::CheckInit (RrpaaWifiRemoteStation *station) Link Here 
246
      //Initialize at minimal rate and maximal power.
246
      //Initialize at minimal rate and maximal power.
247
      station->m_prevRateIndex = 0;
247
      station->m_prevRateIndex = 0;
248
      station->m_rateIndex = 0;
248
      station->m_rateIndex = 0;
249
      station->m_prevPowerLevel = m_maxPower;
249
      station->m_prevPowerLevel = m_nPower - 1;
250
      station->m_powerLevel = m_maxPower;
250
      station->m_powerLevel = m_nPower - 1;
251
      WifiMode mode = GetSupported (station, 0);
251
      WifiMode mode = GetSupported (station, 0);
252
      uint8_t channelWidth = GetChannelWidth (station);
252
      uint8_t channelWidth = GetChannelWidth (station);
253
      DataRate rate = DataRate (mode.GetDataRate (channelWidth));
253
      DataRate rate = DataRate (mode.GetDataRate (channelWidth));
254
      double power = GetPhy ()->GetPowerDbm (m_maxPower);
254
      double power = GetPhy ()->GetPowerDbm (station->m_powerLevel);
255
      m_rateChange (rate, rate, station->m_state->m_address);
255
      m_rateChange (rate, rate, station->m_state->m_address);
256
      m_powerChange (power, power, station->m_state->m_address);
256
      m_powerChange (power, power, station->m_state->m_address);
257
257
 Lines 470-476   RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) Link Here 
470
  NS_LOG_DEBUG ("Worst loss prob= " << wploss);
470
  NS_LOG_DEBUG ("Worst loss prob= " << wploss);
471
  if (bploss >= thresholds.m_mtl)
471
  if (bploss >= thresholds.m_mtl)
472
    {
472
    {
473
      if (station->m_powerLevel < m_maxPower)
473
      if (station->m_powerLevel < m_nPower - 1)
474
        {
474
        {
475
          NS_LOG_DEBUG ("bploss >= MTL and power < maxPower => Increase Power");
475
          NS_LOG_DEBUG ("bploss >= MTL and power < maxPower => Increase Power");
476
          station->m_pdTable[station->m_rateIndex][station->m_powerLevel] /= m_gamma;
476
          station->m_pdTable[station->m_rateIndex][station->m_powerLevel] /= m_gamma;
 Lines 505-511   RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) Link Here 
505
                {
505
                {
506
                  station->m_pdTable[i][station->m_powerLevel] = 1;
506
                  station->m_pdTable[i][station->m_powerLevel] = 1;
507
                }
507
                }
508
              NS_LOG_DEBUG ("pdTable[" << i << "][" << station->m_powerLevel << "] = " << station->m_pdTable[i][station->m_powerLevel]);
508
              NS_LOG_DEBUG ("pdTable[" << i << "][" << (int)station->m_powerLevel << "] = " << station->m_pdTable[i][station->m_powerLevel]);
509
            }
509
            }
510
          double rand = m_uniformRandomVariable->GetValue (0,1);
510
          double rand = m_uniformRandomVariable->GetValue (0,1);
511
          if (rand < station->m_pdTable[station->m_rateIndex + 1][station->m_powerLevel])
511
          if (rand < station->m_pdTable[station->m_rateIndex + 1][station->m_powerLevel])
 Lines 519-525   RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) Link Here 
519
          NS_LOG_DEBUG ("wploss <= ORI and rate = maxRate => Probabilistic Power Decrease");
519
          NS_LOG_DEBUG ("wploss <= ORI and rate = maxRate => Probabilistic Power Decrease");
520
520
521
          // Recalculate probabilities of higher powers.
521
          // Recalculate probabilities of higher powers.
522
          for (uint32_t i = m_maxPower; i > station->m_powerLevel; i--)
522
          for (uint32_t i = m_nPower - 1; i > station->m_powerLevel; i--)
523
            {
523
            {
524
              station->m_pdTable[station->m_rateIndex][i] *= m_delta;
524
              station->m_pdTable[station->m_rateIndex][i] *= m_delta;
525
              if (station->m_pdTable[station->m_rateIndex][i] > 1)
525
              if (station->m_pdTable[station->m_rateIndex][i] > 1)
 Lines 544-550   RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) Link Here 
544
          NS_LOG_DEBUG ("loss between ORI and MTL and power > minPower => Probabilistic Power Decrease");
544
          NS_LOG_DEBUG ("loss between ORI and MTL and power > minPower => Probabilistic Power Decrease");
545
545
546
          // Recalculate probabilities of higher powers.
546
          // Recalculate probabilities of higher powers.
547
          for (uint32_t i = m_maxPower; i >= station->m_powerLevel; i--)
547
          for (uint32_t i = m_nPower - 1; i >= station->m_powerLevel; i--)
548
            {
548
            {
549
              station->m_pdTable[station->m_rateIndex][i] *= m_delta;
549
              station->m_pdTable[station->m_rateIndex][i] *= m_delta;
550
              if (station->m_pdTable[station->m_rateIndex][i] > 1)
550
              if (station->m_pdTable[station->m_rateIndex][i] > 1)

Return to bug 2820