Bug 3031

Summary: Log Distance Propagation Loss Model Takes no Further Arguments
Product: ns-3 Reporter: Edward F. Sánchez <es1678>
Component: wave moduleAssignee: ns-bugs <ns-bugs>
Status: PATCH PENDING ---    
Severity: enhancement CC: es1678, tomh
Priority: P5    
Version: ns-3.29   
Hardware: PC   
OS: Linux   
Attachments: Edited version of vanet-routing-compare.cc with proposed fix
Version with corrected "frequency" comment

Description Edward F. Sánchez 2018-12-18 20:24:58 UTC
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 UTC
"frequency" is also misspelled in the comment above the lossModel=3 block.
Comment 2 Edward F. Sánchez 2018-12-18 20:31:38 UTC
Created attachment 3244 [details]
Version with corrected "frequency" comment