5G-LENA  nr-v3.0-29-g83cc959
The 5G/NR module for the ns-3 simulator
ns3::NrMacSchedulerSrsDefault Class Reference

Default algorithm for assigning offset and periodicity. More...

#include "nr-mac-scheduler-srs-default.h"

+ Inheritance diagram for ns3::NrMacSchedulerSrsDefault:
+ Collaboration diagram for ns3::NrMacSchedulerSrsDefault:

Public Member Functions

 NrMacSchedulerSrsDefault ()
 NrMacSchedulerSrsDefault.
 
 ~NrMacSchedulerSrsDefault () override
 ~NrMacSchedulerSrsDefault
 
SrsPeriodicityAndOffset AddUe () override
 Function called when the scheduler needs to know what is the offset and periodicy of a newly added ue. More...
 
int64_t AssignStreams (int64_t stream)
 
bool DecreasePeriodicity (std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo >> *ueMap) override
 Decrease the periodicity and assign to all UEs a different offset. More...
 
uint32_t GetStartingPeriodicity () const
 Get the periodicity. More...
 
bool IncreasePeriodicity (std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo >> *ueMap) override
 Increase the periodicity and assign to all UEs a different offset. More...
 
void RemoveUe (uint32_t offset) override
 Function called when the scheduler has to release a previously owned periodicity and offset. More...
 
void SetStartingPeriodicity (uint32_t start)
 Set the Periodicity for all the UEs. More...
 
- Public Member Functions inherited from ns3::NrMacSchedulerSrs
virtual ~NrMacSchedulerSrs ()=default
 Default.
 

Static Public Member Functions

static TypeId GetTypeId ()
 GetTypeId. More...
 

Detailed Description

Default algorithm for assigning offset and periodicity.

The algorithm assign the same periodicity to all the UEs. When a new periodicity is asked, it is returned a value between 1 and the configured periodicity (minus 1).

The returned values will never be the same; instead, when this must happen, an invalid value is returned and (hopefully) an increase of periodicity is invoked.

Definition at line 27 of file nr-mac-scheduler-srs-default.h.

Member Function Documentation

◆ AddUe()

NrMacSchedulerSrs::SrsPeriodicityAndOffset ns3::NrMacSchedulerSrsDefault::AddUe ( )
overridevirtual

Function called when the scheduler needs to know what is the offset and periodicy of a newly added ue.

Returns
a struct that contains the periodicity and the offset. If the struct is not valid, an increase in periodicity is probably needed.
See also
IncreatePeriodicity

Implements ns3::NrMacSchedulerSrs.

Definition at line 57 of file nr-mac-scheduler-srs-default.cc.

References ns3::NrMacSchedulerSrs::SrsPeriodicityAndOffset::m_isValid, ns3::NrMacSchedulerSrs::SrsPeriodicityAndOffset::m_offset, and ns3::NrMacSchedulerSrs::SrsPeriodicityAndOffset::m_periodicity.

◆ AssignStreams()

int64_t ns3::NrMacSchedulerSrsDefault::AssignStreams ( int64_t  stream)

Assign a fixed random variable stream number to the random variables used by this model. Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 28 of file nr-mac-scheduler-srs-default.cc.

◆ DecreasePeriodicity()

bool ns3::NrMacSchedulerSrsDefault::DecreasePeriodicity ( std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo >> *  ueMap)
overridevirtual

Decrease the periodicity and assign to all UEs a different offset.

Parameters
ueMapthe UE map
Returns
true if the operation was done

The method decreases the periodicity, and then re-assign offsets and periodicity to all the UEs to avoid conflicts.

Implements ns3::NrMacSchedulerSrs.

Definition at line 103 of file nr-mac-scheduler-srs-default.cc.

References SetStartingPeriodicity().

+ Here is the call graph for this function:

◆ GetStartingPeriodicity()

uint32_t ns3::NrMacSchedulerSrsDefault::GetStartingPeriodicity ( ) const

Get the periodicity.

Returns
the periodicity

Definition at line 155 of file nr-mac-scheduler-srs-default.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::NrMacSchedulerSrsDefault::GetTypeId ( )
static

GetTypeId.

Returns
the object type id

Definition at line 40 of file nr-mac-scheduler-srs-default.cc.

References GetStartingPeriodicity(), and SetStartingPeriodicity().

+ Here is the call graph for this function:

◆ IncreasePeriodicity()

bool ns3::NrMacSchedulerSrsDefault::IncreasePeriodicity ( std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo >> *  ueMap)
overridevirtual

Increase the periodicity and assign to all UEs a different offset.

Parameters
ueMapthe UE map
Returns
true if the operation was done

The method increases the periodicity, and then re-assign offsets and periodicity to all the UEs to avoid conflicts.

Implements ns3::NrMacSchedulerSrs.

Definition at line 83 of file nr-mac-scheduler-srs-default.cc.

References SetStartingPeriodicity().

+ Here is the call graph for this function:

◆ RemoveUe()

void ns3::NrMacSchedulerSrsDefault::RemoveUe ( uint32_t  offset)
overridevirtual

Function called when the scheduler has to release a previously owned periodicity and offset.

Parameters
offsetThe offset used by the UE

Note: This interface assumes that all the UEs will share the same periodicity. If that's not the case, the API would have to be updated.

Implements ns3::NrMacSchedulerSrs.

Definition at line 76 of file nr-mac-scheduler-srs-default.cc.

◆ SetStartingPeriodicity()

void ns3::NrMacSchedulerSrsDefault::SetStartingPeriodicity ( uint32_t  start)

Set the Periodicity for all the UEs.

Parameters
startthe periodicity

Definition at line 122 of file nr-mac-scheduler-srs-default.cc.

Referenced by DecreasePeriodicity(), GetTypeId(), and IncreasePeriodicity().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: