examples/mixed-wireless.cc
changeset 3079 68f79ef69388
parent 3015 94d9153aee09
child 3080 030e4a88c6d7
equal deleted inserted replaced
3078:22756d7f8bb5 3079:68f79ef69388
    90   uint32_t backboneNodes = 10;
    90   uint32_t backboneNodes = 10;
    91   uint32_t infraNodes = 5;
    91   uint32_t infraNodes = 5;
    92   uint32_t lanNodes = 5;
    92   uint32_t lanNodes = 5;
    93   uint32_t stopTime = 10;
    93   uint32_t stopTime = 10;
    94 
    94 
       
    95 
       
    96 
    95   //
    97   //
    96   // Simulation defaults are typically set next, before command line
    98   // Simulation defaults are typically set next, before command line
    97   // arguments are parsed.
    99   // arguments are parsed.
    98   //
   100   //
    99   Config::SetDefault ("ns3::OnOffApplication::PacketSize", StringValue ("210"));
   101   Config::SetDefault ("ns3::OnOffApplication::PacketSize", StringValue ("210"));
   157   // each of the nodes we just finished building.  
   159   // each of the nodes we just finished building.  
   158   //
   160   //
   159   MobilityHelper mobility;
   161   MobilityHelper mobility;
   160   Ptr<ListPositionAllocator> positionAlloc = 
   162   Ptr<ListPositionAllocator> positionAlloc = 
   161     CreateObject<ListPositionAllocator> ();
   163     CreateObject<ListPositionAllocator> ();
   162   positionAlloc->Add (Vector (0.0, 0.0, 0.0));
   164   double x = 0.0;
   163   positionAlloc->Add (Vector (5.0, 0.0, 0.0));
   165   for (uint32_t i = 0; i < backboneNodes; ++i)
       
   166     {
       
   167       positionAlloc->Add (Vector (x, 0.0, 0.0));
       
   168       x += 5.0;
       
   169     }
   164   mobility.SetPositionAllocator (positionAlloc);
   170   mobility.SetPositionAllocator (positionAlloc);
   165   mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel",
   171   mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel",
   166                              "Bounds", RectangleValue (Rectangle (0, 1000, 0, 1000)),
   172                              "Bounds", RectangleValue (Rectangle (0, 1000, 0, 1000)),
   167                              "Speed", RandomVariableValue (ConstantVariable (2000)),
   173                              "Speed", RandomVariableValue (ConstantVariable (2000)),
   168                              "Pause", RandomVariableValue (ConstantVariable (0.2)));
   174                              "Pause", RandomVariableValue (ConstantVariable (0.2)));