src/lte/test/lte-test-mimo.cc
changeset 10080 1b36e2276e15
parent 9673 da69cd4f2c93
child 10081 f0879d02aafd
equal deleted inserted replaced
10074:037ec40f351b 10080:1b36e2276e15
    49 #include <ns3/boolean.h>
    49 #include <ns3/boolean.h>
    50 #include <ns3/rr-ff-mac-scheduler.h>
    50 #include <ns3/rr-ff-mac-scheduler.h>
    51 #include <ns3/pf-ff-mac-scheduler.h>
    51 #include <ns3/pf-ff-mac-scheduler.h>
    52 #include <ns3/pointer.h>
    52 #include <ns3/pointer.h>
    53 #include <ns3/enum.h>
    53 #include <ns3/enum.h>
       
    54 #include <ns3/buildings-helper.h>
    54 
    55 
    55 #include "lte-test-mimo.h"
    56 #include "lte-test-mimo.h"
    56 
    57 
    57 
    58 
    58 NS_LOG_COMPONENT_DEFINE ("LteTestMimo");
    59 NS_LOG_COMPONENT_DEFINE ("LteTestMimo");
   145   enbNodes.Create (1);
   146   enbNodes.Create (1);
   146   ueNodes.Create (1);
   147   ueNodes.Create (1);
   147 
   148 
   148   // Install Mobility Model
   149   // Install Mobility Model
   149   MobilityHelper mobility;
   150   MobilityHelper mobility;
   150   mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
   151   mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
   151   mobility.Install (enbNodes);
   152   mobility.Install (enbNodes);
   152   mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
   153   BuildingsHelper::Install (enbNodes);
       
   154   mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
   153   mobility.Install (ueNodes);
   155   mobility.Install (ueNodes);
       
   156   BuildingsHelper::Install (ueNodes);
   154 
   157 
   155   // Create Devices and install them in the Nodes (eNB and UE)
   158   // Create Devices and install them in the Nodes (eNB and UE)
   156   NetDeviceContainer enbDevs;
   159   NetDeviceContainer enbDevs;
   157   NetDeviceContainer ueDevs;
   160   NetDeviceContainer ueDevs;
   158   lteHelper->SetSchedulerType (m_schedulerType);
   161   lteHelper->SetSchedulerType (m_schedulerType);
   170 
   173 
   171   Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
   174   Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
   172   Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy ();
   175   Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy ();
   173   enbPhy->SetAttribute ("TxPower", DoubleValue (46.0));
   176   enbPhy->SetAttribute ("TxPower", DoubleValue (46.0));
   174   enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0));
   177   enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0));
   175   Ptr<BuildingsMobilityModel> mmenb = enbNodes.Get (0)->GetObject<BuildingsMobilityModel> ();
   178   Ptr<MobilityModel> mmenb = enbNodes.Get (0)->GetObject<MobilityModel> ();
   176   mmenb->SetPosition (Vector (0.0, 0.0, 30.0));
   179   mmenb->SetPosition (Vector (0.0, 0.0, 30.0));
   177 
   180 
   178   // Set UE's position and power
   181   // Set UE's position and power
   179   Ptr<BuildingsMobilityModel> mmue = ueNodes.Get (0)->GetObject<BuildingsMobilityModel> ();
   182   Ptr<MobilityModel> mmue = ueNodes.Get (0)->GetObject<MobilityModel> ();
   180   mmue->SetPosition (Vector (m_dist, 0.0, 1.0));
   183   mmue->SetPosition (Vector (m_dist, 0.0, 1.0));
   181   Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (0)->GetObject<LteUeNetDevice> ();
   184   Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (0)->GetObject<LteUeNetDevice> ();
   182   Ptr<LteUePhy> uePhy = lteUeDev->GetPhy ();
   185   Ptr<LteUePhy> uePhy = lteUeDev->GetPhy ();
   183   uePhy->SetAttribute ("TxPower", DoubleValue (23.0));
   186   uePhy->SetAttribute ("TxPower", DoubleValue (23.0));
   184   uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0));
   187   uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0));