How to get <PropagationLossModel> object installed on nodes?

44 views
Skip to first unread message

HM

unread,
Apr 2, 2019, 6:45:42 PM4/2/19
to ns-3-users

I used  m_adhocTxDevices = wifi80211p.Install (wifiPhy, wifi80211pMac, m_adhocTxNodes)  to install PHY and MAC on my nodes. I need to use CalcRxPower function which is a public member function under PropagationModelLoss class to calculate rxPower when a node receives a packet. I looked into a few examples yet could not figure out how do I access the object on my nodes.

double rxPower = model->CalcRxPower (TxPower,tx,rx);


In particular, how should I address or define model ?

jared...@gmail.com

unread,
Apr 3, 2019, 11:12:55 PM4/3/19
to ns-3-users
I think you need a channel to add a PropagationLossModel.  The wifiPhy argument in your wifi80211p.Install call has to be a derived class from one of {YansWifi, YansWave, SpectrumWifi}PhyHelper}.  If you use the first two I think you can use YansWifiChannelHelper to create a channel to pass to the Yans*PhyHelper prior to install.  The YansWifiChannelHelper has methods to set the propagation loss and delay models.  Similarly for the SpectrumChannelHelper if you're using SpectrumWifiPhyHelper.

Check out the Propagation Models documentation for the kinds of models you can set in your channel helper.

Good luck,
Jared.
Reply all
Reply to author
Forward
0 new messages