88 |
88 |
89 WifiHelper wifi = WifiHelper::Default (); |
89 WifiHelper wifi = WifiHelper::Default (); |
90 wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); |
90 wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); |
91 |
91 |
92 NqosWifiMacHelper mac = NqosWifiMacHelper::Default (); |
92 NqosWifiMacHelper mac = NqosWifiMacHelper::Default (); |
93 |
93 |
94 Ssid ssid = Ssid ("ns-3-ssid"); |
94 Ssid ssid = Ssid ("ns-3-ssid"); |
95 mac.SetType ("ns3::StaWifiMac", |
95 mac.SetType ("ns3::StaWifiMac", |
96 "Ssid", SsidValue (ssid), |
96 "Ssid", SsidValue (ssid), |
97 "ActiveProbing", BooleanValue (false)); |
97 "ActiveProbing", BooleanValue (false)); |
98 |
98 |
106 apDevices = wifi.Install (phy, mac, wifiApNode); |
106 apDevices = wifi.Install (phy, mac, wifiApNode); |
107 |
107 |
108 MobilityHelper mobility; |
108 MobilityHelper mobility; |
109 |
109 |
110 mobility.SetPositionAllocator ("ns3::GridPositionAllocator", |
110 mobility.SetPositionAllocator ("ns3::GridPositionAllocator", |
111 "MinX", DoubleValue (0.0), |
111 "MinX", DoubleValue (0.0), |
112 "MinY", DoubleValue (0.0), |
112 "MinY", DoubleValue (0.0), |
113 "DeltaX", DoubleValue (5.0), |
113 "DeltaX", DoubleValue (5.0), |
114 "DeltaY", DoubleValue (10.0), |
114 "DeltaY", DoubleValue (10.0), |
115 "GridWidth", UintegerValue (3), |
115 "GridWidth", UintegerValue (3), |
116 "LayoutType", StringValue ("RowFirst")); |
116 "LayoutType", StringValue ("RowFirst")); |
117 |
117 |
118 mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", |
118 mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", |
119 "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); |
119 "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); |
120 mobility.Install (wifiStaNodes); |
120 mobility.Install (wifiStaNodes); |
121 |
121 |
122 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
122 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
123 mobility.Install (wifiApNode); |
123 mobility.Install (wifiApNode); |
124 |
124 |