21 #include "bs-scheduler.h"
22 #include "ns3/simulator.h"
23 #include "bs-net-device.h"
24 #include "ns3/packet-burst.h"
26 #include "wimax-mac-header.h"
27 #include "ss-record.h"
28 #include "wimax-mac-queue.h"
30 #include "burst-profile-manager.h"
31 #include "wimax-connection.h"
32 #include "connection-manager.h"
33 #include "ss-manager.h"
34 #include "service-flow.h"
35 #include "service-flow-record.h"
36 #include "service-flow-manager.h"
41 NS_OBJECT_ENSURE_REGISTERED (BSScheduler);
44 BSScheduler::GetTypeId (
void)
46 static TypeId tid = TypeId (
"ns3::BSScheduler").SetParent<Object> ();
50 BSScheduler::BSScheduler ()
51 : m_downlinkBursts (new std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > > ())
57 BSScheduler::BSScheduler (Ptr<BaseStationNetDevice> bs)
58 : m_downlinkBursts (new std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > > ())
63 BSScheduler::~BSScheduler (
void)
65 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > > *downlinkBursts = m_downlinkBursts;
66 std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > pair;
67 while (downlinkBursts->size ())
69 pair = downlinkBursts->front ();
74 delete m_downlinkBursts;
79 BSScheduler::SetBs (Ptr<BaseStationNetDevice> bs)
84 Ptr<BaseStationNetDevice> BSScheduler::GetBs (
void)
90 BSScheduler::CheckForFragmentation (Ptr<WimaxConnection> connection,
92 WimaxPhy::ModulationType modulationType)
94 NS_LOG_INFO (
"BS Scheduler, CheckForFragmentation");
95 if (connection->GetType () != Cid::TRANSPORT)
97 NS_LOG_INFO (
"\t No Transport connction, Fragmentation IS NOT possible");
100 uint32_t availableByte = GetBs ()->GetPhy ()->
101 GetNrBytes (availableSymbols, modulationType);
103 uint32_t headerSize = connection->GetQueue ()->GetFirstPacketHdrSize (
104 MacHeaderType::HEADER_TYPE_GENERIC);
105 NS_LOG_INFO (
"\t availableByte = " << availableByte <<
106 " headerSize = " << headerSize);
108 if (availableByte > headerSize)
#define NS_LOG_COMPONENT_DEFINE(name)