22 #include "ns3/simulator.h"
24 #include "ns3/packet-burst.h"
66 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > > *downlinkBursts =
m_downlinkBursts;
67 std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > pair;
68 while (downlinkBursts->size ())
70 pair = downlinkBursts->front ();
79 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > >*
91 dlMapIe->
SetCid (connection->GetCid ());
95 <<
", connection: " << connection->GetTypeStr () <<
", CID: " << connection->GetCid ());
98 NS_LOG_INFO (
", SFID: " << connection->GetServiceFlow ()->GetSfid () <<
", service: "
99 << connection->GetServiceFlow ()->GetSchedulingTypeStr ());
101 NS_LOG_INFO (
", modulation: " << modulationType <<
", DIUC: " << (uint32_t) diuc);
111 uint32_t nrSymbolsRequired = 0;
120 if (connection !=
GetBs ()->GetInitialRangingConnection () && connection !=
GetBs ()->GetBroadcastConnection ())
134 else if (connection ==
GetBs ()->GetInitialRangingConnection () || connection
135 ==
GetBs ()->GetBroadcastConnection ())
150 if (nrSymbolsRequired < availableSymbols)
163 if (availableSymbols <= BurstSizeSymbols)
165 availableSymbols -= BurstSizeSymbols;
172 burst = Create<PacketBurst> ();
183 availableSymbols = 0;
185 else if (availableSymbols >= nrSymbolsRequired)
187 packet = connection->
Dequeue ();
188 availableSymbols -= nrSymbolsRequired;
198 if (availableSymbols == 0)
208 << availableSymbols << std::endl <<
"BS scheduler, queues:" <<
" IR "
221 std::vector<Ptr<WimaxConnection> >::const_iterator iter1;
222 std::vector<ServiceFlow*>::iterator iter2;
224 NS_LOG_INFO (
"BS Scheduler: Selecting connection...");
225 if (
GetBs ()->GetBroadcastConnection ()->HasPackets ())
231 else if (
GetBs ()->GetInitialRangingConnection ()->HasPackets ())
233 NS_LOG_INFO (
"Return GetInitialRangingConnection");
239 std::vector<Ptr<WimaxConnection> > connections;
240 std::vector<ServiceFlow*> serviceFlows;
243 for (iter1 = connections.begin (); iter1 != connections.end (); ++iter1)
245 if ((*iter1)->HasPackets ())
254 for (iter1 = connections.begin (); iter1 != connections.end (); ++iter1)
256 if ((*iter1)->HasPackets ())
265 for (iter2 = serviceFlows.begin (); iter2 != serviceFlows.end (); ++iter2)
267 serviceFlowRecord = (*iter2)->GetRecord ();
268 NS_LOG_INFO (
"processing UGS: HAS PACKET=" << (*iter2)->HasPackets () <<
"max Latency = "
269 <<
MilliSeconds ((*iter2)->GetMaximumLatency ()) <<
"Delay = " << ((currentTime
272 if ((*iter2)->HasPackets () && ((currentTime - serviceFlowRecord->
GetDlTimeStamp ())
276 connection = (*iter2)->GetConnection ();
277 NS_LOG_INFO (
"Return UGS SF: CID = " << (*iter2)->GetCid () <<
"SFID = " << (*iter2)->GetSfid ());
283 for (iter2 = serviceFlows.begin (); iter2 != serviceFlows.end (); ++iter2)
285 serviceFlowRecord = (*iter2)->GetRecord ();
287 if ((*iter2)->HasPackets () && ((currentTime - serviceFlowRecord->
GetDlTimeStamp ())
291 connection = (*iter2)->GetConnection ();
292 NS_LOG_INFO (
"Return RTPS SF: CID = " << (*iter2)->GetCid () <<
"SFID = " << (*iter2)->GetSfid ());
298 for (iter2 = serviceFlows.begin (); iter2 != serviceFlows.end (); ++iter2)
300 serviceFlowRecord = (*iter2)->GetRecord ();
301 if ((*iter2)->HasPackets ())
303 NS_LOG_INFO (
"Return NRTPS SF: CID = " << (*iter2)->GetCid () <<
"SFID = " << (*iter2)->GetSfid ());
304 connection = (*iter2)->GetConnection ();
310 for (iter2 = serviceFlows.begin (); iter2 != serviceFlows.end (); ++iter2)
312 serviceFlowRecord = (*iter2)->GetRecord ();
313 if ((*iter2)->HasPackets ())
315 NS_LOG_INFO (
"Return BE SF: CID = " << (*iter2)->GetCid () <<
"SFID = " << (*iter2)->GetSfid ());
316 connection = (*iter2)->GetConnection ();
327 uint32_t availableSymbols)
333 uint32_t nrSymbolsRequired = 0;
347 availableSymbols = 0;
351 packet = connection->
Dequeue ();
352 availableSymbols -= nrSymbolsRequired;
355 if (availableSymbols <= 0)