src/lte/examples/lena-rem-sector-antenna.cc
changeset 10080 1b36e2276e15
parent 9653 382d27da8905
child 10403 798e90c6c12f
equal deleted inserted replaced
10074:037ec40f351b 10080:1b36e2276e15
    89   building->SetBuildingType (Building::Residential);
    89   building->SetBuildingType (Building::Residential);
    90   building->SetExtWallsType (Building::ConcreteWithWindows);
    90   building->SetExtWallsType (Building::ConcreteWithWindows);
    91   building->SetNFloors (1);
    91   building->SetNFloors (1);
    92   building->SetNRoomsX (nRooms);
    92   building->SetNRoomsX (nRooms);
    93   building->SetNRoomsY (nRooms);
    93   building->SetNRoomsY (nRooms);
    94   mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
    94   mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
    95   mobility.Install (enbNodes);
    95   mobility.Install (enbNodes);
       
    96   BuildingsHelper::Install (enbNodes);
    96   uint32_t plantedEnb = 0;
    97   uint32_t plantedEnb = 0;
    97   for (uint32_t row = 0; row < nRooms; row++)
    98   for (uint32_t row = 0; row < nRooms; row++)
    98     {
    99     {
    99       for (uint32_t column = 0; column < nRooms; column++, plantedEnb++)
   100       for (uint32_t column = 0; column < nRooms; column++, plantedEnb++)
   100         {
   101         {
   101           Vector v (roomLength * (column + 0.5),
   102           Vector v (roomLength * (column + 0.5),
   102                     roomLength * (row + 0.5),
   103                     roomLength * (row + 0.5),
   103                     nodeHeight );
   104                     nodeHeight );
   104           positionAlloc->Add (v);
   105           positionAlloc->Add (v);
   105           enbPosition.push_back (v);
   106           enbPosition.push_back (v);
   106           Ptr<BuildingsMobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<BuildingsMobilityModel> ();
   107           Ptr<MobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<MobilityModel> ();
   107           mmEnb->SetPosition (v);
   108           mmEnb->SetPosition (v);
   108         }
   109         }
   109     }
   110     }
   110 
   111 
   111   // Add a 1-sector site
   112   // Add a 1-sector site
   157               positionAlloc->Add (Vector (posX->GetValue (), posY->GetValue (), nodeHeight));
   158               positionAlloc->Add (Vector (posX->GetValue (), posY->GetValue (), nodeHeight));
   158             }
   159             }
   159           mobility.SetPositionAllocator (positionAlloc);
   160           mobility.SetPositionAllocator (positionAlloc);
   160         }
   161         }
   161       mobility.Install (ueNodes.at(i));
   162       mobility.Install (ueNodes.at(i));
       
   163       BuildingsHelper::Install (ueNodes.at(i));
   162     }
   164     }
   163 
   165 
   164   // Create Devices and install them in the Nodes (eNB and UE)
   166   // Create Devices and install them in the Nodes (eNB and UE)
   165   NetDeviceContainer enbDevs;
   167   NetDeviceContainer enbDevs;
   166   vector < NetDeviceContainer > ueDevs;
   168   vector < NetDeviceContainer > ueDevs;
   199       lteHelper->Attach (ueDev, enbDevs.Get (i));
   201       lteHelper->Attach (ueDev, enbDevs.Get (i));
   200       enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
   202       enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
   201       EpsBearer bearer (q);
   203       EpsBearer bearer (q);
   202       lteHelper->ActivateDataRadioBearer (ueDev, bearer);
   204       lteHelper->ActivateDataRadioBearer (ueDev, bearer);
   203     }
   205     }
   204 
       
   205 
   206 
   206   BuildingsHelper::MakeMobilityModelConsistent ();
   207   BuildingsHelper::MakeMobilityModelConsistent ();
   207 
   208 
   208   // by default, simulation will anyway stop right after the REM has been generated
   209   // by default, simulation will anyway stop right after the REM has been generated
   209   Simulator::Stop (Seconds (0.0069));  
   210   Simulator::Stop (Seconds (0.0069));