Thanks for your reply!
I tried it but unfortunately it doesn't work.I read the ns3-model-library and learned that 802.11ac/ax PHY layer can use either 20, 40, 80 (default) or 160 MHz channel width.So I set 802.11ac as standard,and then I used the function "Set()" of class YansWifiPyhHelper to set the channel width through arrtibute "ChannelWidth".The corresponding code is as follows:
WifiHelper wifi;
wifi.SetStandard(WIFI_STANDARD_80211ac);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
Ptr<YansWifiChannel> p_channel = channel.Create();
YansWifiPhyHelper phy;
phy.Set("ChannelWidth",UintegerValue(40));
phy.SetChannel(p_channel);
WifiMacHelper wifiMac;
wifiMac.SetType("ns3::AdhocWifiMac");
NetDeviceContainer devices = wifi.Install(phy,wifiMac,wifinodes);
My code can build successfully but return the message as follows:
msg="WifiRemoteStationManager selected does not support HT rates", +0.000000000s 0 file=../src/wifi/model/rate-control/arf-wifi-manager.cc, line=92
terminate called without an active exception
(Haha,actually I m not not very clear about how
YansWifiPhyHelper works. It is so complicated.)