5G-LENA nr-v4.0
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
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.
 
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.
 
uint32_t GetStartingPeriodicity () const
 Get the periodicity.
 
bool IncreasePeriodicity (std::unordered_map< uint16_t, std::shared_ptr< NrMacSchedulerUeInfo > > *ueMap) override
 Increase the periodicity and assign to all UEs a different offset.
 
bool IsMaxSrsReached () const override
 Check if all SRS periodicity is at the maximum allowed and all offsets have been used.
 
void RemoveUe (uint32_t offset) override
 Function called when the scheduler has to release a previously owned periodicity and offset.
 
void SetStartingPeriodicity (uint32_t start)
 Set the Periodicity for all the UEs.
 
- Public Member Functions inherited from ns3::NrMacSchedulerSrs
virtual ~NrMacSchedulerSrs ()=default
 Default.
 

Static Public Member Functions

static TypeId GetTypeId ()
 GetTypeId.
 

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.

Introspection did not find any typical Config paths.

Attributes

  • StartingPeriodicity: Starting value for the periodicity
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 80
    • Flags: construct write read

No TraceSources are defined for this type.
Size of this type is 120 bytes (on a 64-bit architecture).

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

Constructor & Destructor Documentation

◆ NrMacSchedulerSrsDefault()

ns3::NrMacSchedulerSrsDefault::NrMacSchedulerSrsDefault ( )

◆ ~NrMacSchedulerSrsDefault()

ns3::NrMacSchedulerSrsDefault::~NrMacSchedulerSrsDefault ( )
override

~NrMacSchedulerSrsDefault

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

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
IncreasePeriodicity

Implements ns3::NrMacSchedulerSrs.

Definition at line 56 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 27 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 102 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 39 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 82 of file nr-mac-scheduler-srs-default.cc.

References SetStartingPeriodicity().

+ Here is the call graph for this function:

◆ IsMaxSrsReached()

bool ns3::NrMacSchedulerSrsDefault::IsMaxSrsReached ( ) const
overridevirtual

Check if all SRS periodicity is at the maximum allowed and all offsets have been used.

Returns
true if all SRS offsets have been used

Implements ns3::NrMacSchedulerSrs.

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

◆ 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 75 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 121 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: