--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/a37fbbba-1014-4c63-9b52-edbbd82b3b2f%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/aeecf1ff-cb9c-4db6-8d8f-0be9da352b10%40googlegroups.com.
#include <ns3/core-module.h>
#include <ns3/network-module.h>
#include <ns3/mobility-module.h>
#include <ns3/lte-module.h>
#include "ns3/config-store.h"
#include "ns3/netanim-module.h"
//Flow Monitor Headers
#include "ns3/flow-monitor-module.h"
#include "ns3/flow-monitor-helper.h"
using namespace ns3;
using namespace std;
int main(int argc, char *argv[])
{
CommandLine cmd(__FILE__);
cmd.Parse(argc, argv);
ConfigStore inputConfig;
inputConfig.ConfigureDefaults();
////parse again so you can override default values from the command line
cmd.Parse(argc, argv);
Ptr<LteHelper> lteHelper = CreateObject<LteHelper>();
NodeContainer enbNodes;
enbNodes.Create(1);
NodeContainer ueNodes;
ueNodes.Create(1);
NodeContainer allNodes = NodeContainer(enbNodes,ueNodes);
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
positionAlloc->Add (Vector (0.0, 20.0, 0.0)); // UE1
MobilityHelper mobility;
mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
mobility.SetPositionAllocator(positionAlloc);
mobility.Install(allNodes);
NetDeviceContainer enbDevs;
enbDevs = lteHelper->InstallEnbDevice(enbNodes);
NetDeviceContainer ueDevs;
ueDevs = lteHelper->InstallUeDevice(ueNodes);
lteHelper->Attach(ueDevs, enbDevs.Get(0)); /*No cell selection process since UE and eNB is fixed. EPS bearer is default */
enum EpsBearer::Qci q = EpsBearer::GBR_MC_PUSH_TO_TALK ;
EpsBearer bearer(q);
lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
// Flowmonitor
Ptr<FlowMonitor> flowMonitor;
FlowMonitorHelper flowHelper;
flowMonitor = flowHelper.Install(ueNodes);
Simulator::Stop(Seconds(0.02));
Simulator::Run();
flowMonitor->SerializeToXmlFile("LTEOut.xml", true, true);
Simulator::Destroy();
return 0;