Bug 3031 - Log Distance Propagation Loss Model Takes no Further Arguments
Log Distance Propagation Loss Model Takes no Further Arguments
Status: PATCH PENDING
Product: ns-3
Classification: Unclassified
Component: wave module
ns-3.29
PC Linux
: P5 enhancement
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-12-18 20:24 EST by Edward F. Sánchez
Modified: 2019-01-01 11:00 EST (History)
2 users (show)

See Also:


Attachments
Edited version of vanet-routing-compare.cc with proposed fix (76.92 KB, text/x-c++src)
2018-12-18 20:24 EST, Edward F. Sánchez
Details
Version with corrected "frequency" comment (76.92 KB, patch)
2018-12-18 20:31 EST, Edward F. Sánchez
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edward F. Sánchez 2018-12-18 20:24:58 EST
Created attachment 3243 [details]
Edited version of vanet-routing-compare.cc with proposed fix

In src/wave/examples/vanet-routing-compare.cc, the VanetRoutingExperiment::SetupAdhocDevices method includes sample code for four propagation loss models, but if the file is run with the -lossModel=4 argument, a runtime error occurs because there is an attempt to pass a frequency value to ns3::LogDistancePropagationLossModel.

This can be fixed by substituting the portion listed below into the existing file:

---- BEGIN PROPOSED CODE CHANGE ----
  // Setup propagation models
  YansWifiChannelHelper wifiChannel;
  wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
  if (m_lossModel == 3)
    {
      // two-ray requires freqeuncy and antenna height
      wifiChannel.AddPropagationLoss (m_lossModelName, "Frequency", DoubleValue (freq), "HeightAboveZ", DoubleValue (1.5));
    }
  else if (m_lossModel == 4)
    {
      // log distance requires no additional parameters
      wifiChannel.AddPropagationLoss (m_lossModelName);
    }
  else
    {
      // other propagation loss models require the frequency
      wifiChannel.AddPropagationLoss (m_lossModelName, "Frequency", DoubleValue (freq));
    }
----- END PROPOSED CODE CHANGE -----

The first and last few lines in the above snippet are unchanged in hopes of helping identify the target area.

Please let me know what comments and questions there may be on this.

Attached is a fully edited version of the file.
Comment 1 Edward F. Sánchez 2018-12-18 20:29:33 EST
"frequency" is also misspelled in the comment above the lossModel=3 block.
Comment 2 Edward F. Sánchez 2018-12-18 20:31:38 EST
Created attachment 3244 [details]
Version with corrected "frequency" comment