|
|
| 103 |
|
103 |
|
| 104 |
// setup the STAs |
104 |
// setup the STAs |
| 105 |
stack.Install (sta); |
105 |
stack.Install (sta); |
| 106 |
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", |
106 |
mobility.SetMobilityModel ("ns3::StaticMobilityModel"); |
| 107 |
"Mode", StringValue ("Time"), |
|
|
| 108 |
"Time", StringValue ("2s"), |
| 109 |
"Speed", StringValue ("Constant:1.0"), |
| 110 |
"Bounds", RectangleValue (Rectangle (wifiX, wifiX+5.0,0.0, (nStas+1)*5.0))); |
| 111 |
mobility.Install (sta); |
107 |
mobility.Install (sta); |
| 112 |
wifi.SetMac ("ns3::NqstaWifiMac", |
108 |
wifi.SetMac ("ns3::NqstaWifiMac", |
| 113 |
"Ssid", SsidValue (ssid), |
109 |
"Ssid", SsidValue (ssid), |
|
|
| 148 |
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); |
144 |
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); |
| 149 |
ApplicationContainer apps = onoff.Install (staNodes[0].Get (0)); |
145 |
ApplicationContainer apps = onoff.Install (staNodes[0].Get (0)); |
| 150 |
apps.Start (Seconds (0.5)); |
146 |
apps.Start (Seconds (0.5)); |
| 151 |
apps.Stop (Seconds (3.0)); |
147 |
//apps.Stop (Seconds (3.0)); |
| 152 |
|
148 |
|
|
|
149 |
Ptr<MobilityModel> mob = staNodes[0].Get (0)->GetObject<MobilityModel> (); |
| 150 |
Vector pos; pos.x = -1000; pos.y = -1000; pos.z = 0; |
| 151 |
mob->SetPosition (pos); |
| 153 |
|
152 |
|
| 154 |
WifiHelper::EnablePcap ("wifi-wire-bridging", staNodes[1].Get (1)); |
153 |
WifiHelper::EnablePcap ("wifi-wire-bridging", staNodes[1].Get (1)); |
| 155 |
WifiHelper::EnablePcap ("wifi-wire-bridging", staNodes[0].Get (0)); |
154 |
WifiHelper::EnablePcap ("wifi-wire-bridging", staNodes[0].Get (0)); |
|
|
| 157 |
os.open ("wifi-wire-bridging.mob"); |
156 |
os.open ("wifi-wire-bridging.mob"); |
| 158 |
MobilityHelper::EnableAsciiAll (os); |
157 |
MobilityHelper::EnableAsciiAll (os); |
| 159 |
|
158 |
|
| 160 |
Simulator::Stop (Seconds (100.0)); |
159 |
//Simulator::Stop (Seconds (100.0)); |
| 161 |
Simulator::Run (); |
160 |
Simulator::Run (); |
| 162 |
Simulator::Destroy (); |
161 |
Simulator::Destroy (); |
| 163 |
} |
162 |
} |