23 #include "ns3/simulator.h"
28 #include "ns3/uinteger.h"
81 std::list<OfdmUlMapIe>
97 uint32_t randNr = rand ();
98 if (randNr % 5 == 0 ||
GetBs ()->GetNrDcdSent () == 0)
104 if (randNr % 5 == 0 ||
GetBs ()->GetNrUcdSent () == 0)
133 if (timeSinceLastDcd >
GetBs ()->GetDcdInterval ())
139 if (timeSinceLastUcd >
GetBs ()->GetUcdInterval ())
154 const uint32_t &allocationSize,
155 uint32_t &symbolsToAllocation,
156 uint32_t &availableSymbols)
161 symbolsToAllocation += allocationSize;
162 availableSymbols -= allocationSize;
171 bool allocationForDsa =
false;
173 uint32_t symbolsToAllocation = 0;
174 uint32_t allocationSize = 0;
180 for (std::vector<SSRecord*>::iterator iter = ssRecords->begin (); iter != ssRecords->end (); ++iter)
201 if (availableSymbols >= allocationSize)
216 ulMapIe.
SetUiuc (
GetBs ()->GetBurstProfileManager ()->GetBurstProfile (modulationType,
226 if (!allocationForDsa)
230 if (availableSymbols >= allocationSize)
233 allocationForDsa =
true;
255 if (availableSymbols)
265 if (availableSymbols)
275 if (availableSymbols)
287 if (availableSymbols)
297 if (availableSymbols)
307 if (availableSymbols)
336 uint32_t &symbolsToAllocation,
337 uint32_t &availableSymbols)
339 uint32_t allocationSize = 0;
340 uint8_t uiuc = ulMapIe.
GetUiuc ();
341 std::vector<ServiceFlow*> serviceFlows = ssRecord->
GetServiceFlows (schedulingType);
343 for (std::vector<ServiceFlow*>::iterator iter = serviceFlows.begin (); iter != serviceFlows.end (); ++iter)
360 if (bps < serviceFlow->GetMinReservedTrafficRate ())
374 if (availableSymbols < allocationSize)
379 if (allocationSize > 0)
405 uint32_t &symbolsToAllocation,
406 uint32_t &availableSymbols)
408 std::vector<ServiceFlow*> serviceFlows = ssRecord->
GetServiceFlows (schedulingType);
410 for (std::vector<ServiceFlow*>::iterator iter = serviceFlows.begin (); iter != serviceFlows.end (); ++iter)
429 uint32_t &symbolsToAllocation,
430 uint32_t &availableSymbols)
432 uint32_t allocSizeBytes = 0;
433 uint32_t allocSizeSymbols = 0;
434 uint16_t sduSize = 0;
440 if (requiredBandwidth > 0)
445 allocSizeBytes = sduSize;
450 allocSizeBytes = requiredBandwidth;
454 if (availableSymbols >= allocSizeSymbols)
482 if (timeSinceLastIrInterval +
GetBs ()->GetPhy ()->GetFrameDuration () >
GetBs ()->GetInitialRangingInterval ()
483 && availableSymbols >= allocationSize)
487 ulMapIeIr.
SetCid ((
GetBs ()->GetBroadcastConnection ())->GetCid ());
491 NS_LOG_DEBUG (
"BS uplink scheduler, initial ranging allocation, size: " << allocationSize <<
" symbols"
492 <<
", modulation: BPSK 1/2");
498 *
GetBs ()->GetSymbolDuration ().GetSeconds ()) + Seconds (i *
GetBs ()->GetRangReqOppSize ()
499 *
GetBs ()->GetSymbolDuration ().GetSeconds ()));
510 uint8_t delayNrFrames = 1;
513 uint32_t bytesPerFrame =
514 (uint32_t ((
double)(bitsPerSecond) *
GetBs ()->GetPhy ()->GetFrameDuration ().GetSeconds ())) / 8;
534 if (toleratedJitter > frameDurationMSec)
536 delayNrFrames = (uint8_t)(toleratedJitter / frameDurationMSec);
539 uint16_t interval = delayNrFrames * frameDurationMSec;
545 if (serviceFlow->
GetSduSize () > bytesPerFrame)
547 delayNrFrames = (uint8_t)(serviceFlow->
GetSduSize () / bytesPerFrame);
550 uint16_t interval = delayNrFrames * frameDurationMSec;
580 uint32_t grantedBandwidth = 0;