YansWifiPhyHelper wifiPhy ;
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetErrorRateModel("ns3::YansErrorRateModel",
"WifiMode",EnumValue(WIFI_MOD_CLASS_ERP_OFDM),
"snr",DoubleValue(10.0),
"nbits",UintegerValue(8)
);
...
The error message is "msg="Invalid attribute set (WifiMode) on ns3::YansErrorRateModel", file=../src/core/model/object-factory.cc, line=69
terminate called without an active exception"
I think I am giving wrong attribute of the class ns3::YansErrorRateModel::GetChunkSuccessRate but I don't know what is right definition attribute of (WifiMode mode, double snr, uint32_t nbits)
I am modifying the channel model in mesh.cc. How can I fix my code??
Thanks for helping !!!!
mode | the Wi-Fi mode the chunk is sent | |||||
snr | the SNR of the chunk | |||||
nbits | the number of bits in this chunk | double snr =30; uint32_t FrameSize = 1000; Ptr<YansErrorRateModel> yans = CreateObject<YansErrorRateModel>(); yans->GetChunkSuccessRate(WifiMode("ErpOfdmRate54Mbps"),pow(10.0, snr / 10.0), FrameSize * 8); |
nodes.Create (m_ySize*m_xSize);
// Configure YansWifiChannel
Ptr <YansErrorRateModel> yans = CreateObject<YansErrorRateModel> ();
double snr = -3;
yans->GetChunkSuccessRate (WifiMode ("OfdmRate54Mbps"), std::pow (10.0,snr/10.0), m_packetSize*8);
YansWifiPhyHelper wifiPhy ;
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
wifiPhy.SetErrorRateModel("ns3::YansErrorRateModel");
I also include the header file. I want to know that how can I observe the BER affects in mesh.cc and am I successfully changing the BER by changing the SNR ???
Thanks for helping!!!