https://www.nsnam.org/docs/models/html/lte-user.html (19.2), я пробовал, но все равно не работает(.
Как у меня есть этот код:
Код: Выделить всё
#include
#include
#include
#include
#include
#include
#include
using namespace std;
using namespace ns3;
//defines for simple code
#define pfff "ns3::PfFfMacScheduler"
#define const_pos_model "ns3::ConstantPositionMobilityModel"
#define simTime Seconds(10);
int main(int argc, char *argv[])
{
//creating UE and ENB (2 and 1)
Ptr lteHelper = CreateObject();
NodeContainer enbNodes;
enbNodes.Create(1);
NodeContainer ueNodes;
ueNodes.Create(2);
//creating class instance for using mobility
MobilityHelper mobility;
//setup the position of ue
Ptr UEposition = CreateObject ();
UEposition->Add(Vector (1.0,1.0, 0.0));
UEposition->Add(Vector (1.0,-1.0, 0.0));
mobility.SetPositionAllocator(UEposition);
mobility.SetMobilityModel(const_pos_model);
mobility.Install(ueNodes);
//setup the position of enb
Ptr ENBposition = CreateObject ();
ENBposition->Add(Vector (0.0,0.0,0.0));
mobility.SetPositionAllocator(ENBposition);
mobility.SetMobilityModel(const_pos_model);
mobility.Install(enbNodes);
//setup pfff scheduler
lteHelper->SetSchedulerType(pfff);
//install LTE settings on UE and ENB devices
NetDeviceContainer enbDevs;
enbDevs = lteHelper->InstallEnbDevice(enbNodes);
NetDeviceContainer ueDevs;
ueDevs = lteHelper->InstallUeDevice(ueNodes);
lteHelper->Attach(ueDevs, enbDevs.Get(0));
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
EpsBearer bearer(q);
lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
lteHelper->EnableMacTraces();
lteHelper->EnableRlcTraces();
Simulator::Stop(Seconds(10));
Simulator::Run();
Simulator::Destroy();
return 0;
}
P.S. - Это программа, которая имитирует 2 UE и 1 ENB с полным трафиком, остальные настройки я установил.
Подробнее здесь: https://stackoverflow.com/questions/784 ... lte-module
Мобильная версия