|
72 |
#include "ns3/olsr-helper.h" |
72 |
#include "ns3/olsr-helper.h" |
73 |
#include "ns3/csma-helper.h" |
73 |
#include "ns3/csma-helper.h" |
74 |
#include "ns3/animation-interface.h" |
74 |
#include "ns3/animation-interface.h" |
|
|
75 |
#include "ns3/rectangle-2d.h" |
75 |
|
76 |
|
76 |
using namespace ns3; |
77 |
using namespace ns3; |
77 |
|
78 |
|
|
192 |
"GridWidth", UintegerValue (5), |
193 |
"GridWidth", UintegerValue (5), |
193 |
"LayoutType", StringValue ("RowFirst")); |
194 |
"LayoutType", StringValue ("RowFirst")); |
194 |
mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel", |
195 |
mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel", |
195 |
"Bounds", RectangleValue (Rectangle (-500, 500, -500, 500)), |
196 |
"Bounds", Rectangle2dValue (Rectangle2d (-500, 500, -500, 500)), |
196 |
"Speed", StringValue ("ns3::ConstantRandomVariable[Constant=2]"), |
197 |
"Speed", StringValue ("ns3::ConstantRandomVariable[Constant=2]"), |
197 |
"Pause", StringValue ("ns3::ConstantRandomVariable[Constant=0.2]")); |
198 |
"Pause", StringValue ("ns3::ConstantRandomVariable[Constant=0.2]")); |
198 |
mobility.Install (backbone); |
199 |
mobility.Install (backbone); |
|
333 |
mobility.PushReferenceMobilityModel (backbone.Get (i)); |
334 |
mobility.PushReferenceMobilityModel (backbone.Get (i)); |
334 |
mobility.SetPositionAllocator (subnetAlloc); |
335 |
mobility.SetPositionAllocator (subnetAlloc); |
335 |
mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel", |
336 |
mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel", |
336 |
"Bounds", RectangleValue (Rectangle (-10, 10, -10, 10)), |
337 |
"Bounds", Rectangle2dValue (Rectangle2d (-10, 10, -10, 10)), |
337 |
"Speed", StringValue ("ns3::ConstantRandomVariable[Constant=3]"), |
338 |
"Speed", StringValue ("ns3::ConstantRandomVariable[Constant=3]"), |
338 |
"Pause", StringValue ("ns3::ConstantRandomVariable[Constant=0.4]")); |
339 |
"Pause", StringValue ("ns3::ConstantRandomVariable[Constant=0.4]")); |
339 |
mobility.Install (stas); |
340 |
mobility.Install (stas); |