ns3::SatMarkovContainer Class Reference

Container for Markov-model. More...

#include "satellite-markov-container.h"

+ Inheritance diagram for ns3::SatMarkovContainer:
+ Collaboration diagram for ns3::SatMarkovContainer:

Public Types

typedef void(* FadingTraceCallback) (double time, SatEnums::ChannelType_t channelType, double value)
 Callback for FadingTrace trace source. More...
 
- Public Types inherited from ns3::SatBaseFading
typedef Callback< double > ElevationCallback
 Gets elevation angle in degrees. More...
 
typedef Callback< double > VelocityCallback
 Gets velocity in m/s. More...
 

Public Member Functions

 SatMarkovContainer ()
 Constructor. More...
 
 SatMarkovContainer (Ptr< SatMarkovConf > markovConf, SatBaseFading::ElevationCallback elevation, SatBaseFading::VelocityCallback velocity)
 Constructor. More...
 
 ~SatMarkovContainer ()
 Destructor. More...
 
void DoDispose ()
 Do needed dispose actions. More...
 
double DoGetFading (Address macAddress, SatEnums::ChannelType_t channeltype)
 Function for getting the fading. More...
 
void LockToSet (uint32_t newSet)
 Function for locking the parameter set. More...
 
void LockToSetAndState (uint32_t newSet, uint32_t newState)
 Function for locking the parameter set and state. More...
 
void RandomizeLockedSetAndState ()
 Function for locking the parameter set and state to random values. More...
 
void RandomizeLockedState (uint32_t set)
 Function for locking the state to random value. More...
 
void UnlockSetAndState ()
 Function for unlocking the parameter set and state. More...
 
- Public Member Functions inherited from ns3::SatBaseFading
 SatBaseFading ()
 Constructor. More...
 
virtual ~SatBaseFading ()
 Destructor. More...
 
double GetFading (Address macAddress, SatEnums::ChannelType_t channelType)
 Function for getting the fading value. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 NS-3 function for type id. More...
 
- Static Public Member Functions inherited from ns3::SatBaseFading
static TypeId GetTypeId (void)
 NS-3 type id function. More...
 

Private Member Functions

double CalculateDistanceSinceLastStateChange ()
 Function for calculating the distance since latest state change position. More...
 
double CalculateElevation ()
 Function for calculating the elevation. More...
 
double CalculateFading (SatEnums::ChannelType_t channelType)
 Function for calculating the fading value. More...
 
void CreateFaders (SatMarkovConf::MarkovFaderType_t faderType)
 Function for creating the Markov state faders. More...
 
void EvaluateStateChange (SatEnums::ChannelType_t channelType)
 Function for evaluating state change. More...
 
double GetCachedFadingValue (SatEnums::ChannelType_t channelType)
 Function for getting the cached fading values. More...
 
bool HasCooldownPeriodPassed (SatEnums::ChannelType_t channelType)
 Function for checking whether the cooldown period has passed. More...
 
void Reset ()
 Clear used variables. More...
 
void UpdateProbabilities (uint32_t set)
 Function for updating the state change probabilities. More...
 

Private Attributes

Time m_cooldownPeriodLength
 Cooldown period length in time. More...
 
ElevationCallback m_currentElevation
 Current elevation value. More...
 
uint32_t m_currentSet
 Current parameter set. More...
 
uint32_t m_currentState
 Current state. More...
 
bool m_enableSetLock
 Variable for disabling the parameter set change. More...
 
bool m_enableStateLock
 Variable for disabling state changes. More...
 
Ptr< SatBaseFaderm_fader_down
 Downlink fader. More...
 
Ptr< SatBaseFaderm_fader_up
 Uplink fader. More...
 
TracedCallback< double, SatEnums::ChannelType_t, double > m_fadingTrace
 Fading trace function. More...
 
double m_latestCalculatedFadingValue_down
 Latest calculated downlink fading value. More...
 
double m_latestCalculatedFadingValue_up
 Latest calculated uplink fading value. More...
 
Time m_latestCalculationTime_down
 Latest calculation time for downlink fading value. More...
 
Time m_latestCalculationTime_up
 Latest calculation time for uplink fading value. More...
 
Time m_latestStateChangeTime
 Latest calculation time for state change. More...
 
Ptr< SatMarkovConfm_markovConf
 Markoc model configuration. More...
 
Ptr< SatMarkovModelm_markovModel
 Markov model object. More...
 
double m_minimumPositionChangeInMeters
 Minimum state change distance in meters. More...
 
uint32_t m_numOfSets
 Number of parameter sets available. More...
 
uint32_t m_numOfStates
 Number of states available. More...
 
bool m_useDecibels
 Defines whether the calculations should return the fading value in decibels or not. More...
 
VelocityCallback m_velocity
 Node movement velocity. More...
 

Detailed Description

Container for Markov-model.

This class contains the Markov-model state machines and implements the fading interface. The class implements, e.g., the state machine selection and contains the logic for deciding when the new fading value will be calculated and state change evaluation should happen.

Definition at line 45 of file satellite-markov-container.h.

Member Typedef Documentation

◆ FadingTraceCallback

typedef void(* ns3::SatMarkovContainer::FadingTraceCallback) (double time, SatEnums::ChannelType_t channelType, double value)

Callback for FadingTrace trace source.

Parameters
timethe current simulation time (in seconds)
channelTypethe type of the relevant channel, e.g., FORWARD_FEEDER_CH, FORWARD_USER_CH, RETURN_USER_CH, or RETURN_FEEDER_CH
valuefading value, in unit determined by configuration

Definition at line 127 of file satellite-markov-container.h.

Constructor & Destructor Documentation

◆ SatMarkovContainer() [1/2]

ns3::SatMarkovContainer::SatMarkovContainer ( )

Constructor.

Definition at line 47 of file satellite-markov-container.cc.

◆ SatMarkovContainer() [2/2]

ns3::SatMarkovContainer::SatMarkovContainer ( Ptr< SatMarkovConf markovConf,
SatBaseFading::ElevationCallback  elevation,
SatBaseFading::VelocityCallback  velocity 
)

Constructor.

Parameters
markovConfMarkov configuration object.
elevationElevation angle callback.
velocityVelocity callback.

create Markov model

initialize Markov model

create faders

initialize fading values

Definition at line 72 of file satellite-markov-container.cc.

References CalculateFading(), CreateFaders(), ns3::SatEnums::FORWARD_USER_CH, m_cooldownPeriodLength, m_currentElevation, m_currentSet, m_currentState, m_markovConf, m_markovModel, m_minimumPositionChangeInMeters, m_numOfStates, ns3::SatEnums::RETURN_USER_CH, and UpdateProbabilities().

+ Here is the call graph for this function:

◆ ~SatMarkovContainer()

ns3::SatMarkovContainer::~SatMarkovContainer ( )

Destructor.

Definition at line 119 of file satellite-markov-container.cc.

References Reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ CalculateDistanceSinceLastStateChange()

double ns3::SatMarkovContainer::CalculateDistanceSinceLastStateChange ( )
private

Function for calculating the distance since latest state change position.

Returns
distance

Definition at line 470 of file satellite-markov-container.cc.

References m_latestStateChangeTime, and m_velocity.

Referenced by EvaluateStateChange().

+ Here is the caller graph for this function:

◆ CalculateElevation()

double ns3::SatMarkovContainer::CalculateElevation ( )
private

Function for calculating the elevation.

Returns
elevation value

◆ CalculateFading()

double ns3::SatMarkovContainer::CalculateFading ( SatEnums::ChannelType_t  channelType)
private

◆ CreateFaders()

void ns3::SatMarkovContainer::CreateFaders ( SatMarkovConf::MarkovFaderType_t  faderType)
private

Function for creating the Markov state faders.

Definition at line 150 of file satellite-markov-container.cc.

References ns3::SatMarkovConf::LOO_FADER, m_currentSet, m_currentState, m_fader_down, m_fader_up, m_markovConf, m_numOfStates, and ns3::SatMarkovConf::RAYLEIGH_FADER.

Referenced by SatMarkovContainer().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::SatMarkovContainer::DoDispose ( void  )

Do needed dispose actions.

Definition at line 127 of file satellite-markov-container.cc.

References Reset().

+ Here is the call graph for this function:

◆ DoGetFading()

double ns3::SatMarkovContainer::DoGetFading ( Address  macAddress,
SatEnums::ChannelType_t  channeltype 
)
virtual

Function for getting the fading.

SatMarkovContainer is inherited from SatBaseFading abstract base class, which defines an abstract interface method DoGetFading with Address and ChannelType as input parameters. DoGetFading is implemented in the inherited classes SatMarkovContainer and SatFadingInputTrace. SatFadingInputTrace needs the Address as a parameter in DoGetFading method to be able to get the fading from the correct fading file. Note, that the Address parameter is not utilized in SatMarkovContainer::DoGetFading () at all.

Parameters
macAddressMAC address
channeltypechannel type
Returns
fading value

Implements ns3::SatBaseFading.

Definition at line 183 of file satellite-markov-container.cc.

References CalculateFading(), EvaluateStateChange(), GetCachedFadingValue(), HasCooldownPeriodPassed(), m_fadingTrace, and m_velocity.

Referenced by ns3::SatMarkovFadingExamplePlot::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EvaluateStateChange()

void ns3::SatMarkovContainer::EvaluateStateChange ( SatEnums::ChannelType_t  channelType)
private

Function for evaluating state change.

Definition at line 235 of file satellite-markov-container.cc.

References CalculateDistanceSinceLastStateChange(), m_currentElevation, m_currentSet, m_enableSetLock, m_enableStateLock, m_latestStateChangeTime, m_markovConf, m_markovModel, m_minimumPositionChangeInMeters, and UpdateProbabilities().

Referenced by DoGetFading().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCachedFadingValue()

double ns3::SatMarkovContainer::GetCachedFadingValue ( SatEnums::ChannelType_t  channelType)
private

Function for getting the cached fading values.

Parameters
channelTypechannel type
Returns
cached fading value

Definition at line 213 of file satellite-markov-container.cc.

References ns3::SatEnums::FORWARD_FEEDER_CH, ns3::SatEnums::FORWARD_USER_CH, m_latestCalculatedFadingValue_down, m_latestCalculatedFadingValue_up, ns3::SatEnums::RETURN_FEEDER_CH, and ns3::SatEnums::RETURN_USER_CH.

Referenced by DoGetFading().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::SatMarkovContainer::GetTypeId ( void  )
static

NS-3 function for type id.

Returns
type id

Definition at line 34 of file satellite-markov-container.cc.

References m_fadingTrace.

◆ HasCooldownPeriodPassed()

bool ns3::SatMarkovContainer::HasCooldownPeriodPassed ( SatEnums::ChannelType_t  channelType)
private

Function for checking whether the cooldown period has passed.

Parameters
channelTypechannel type
Returns
has cooldown period passed

Definition at line 266 of file satellite-markov-container.cc.

References ns3::SatEnums::FORWARD_FEEDER_CH, ns3::SatEnums::FORWARD_USER_CH, m_cooldownPeriodLength, m_latestCalculationTime_down, m_latestCalculationTime_up, ns3::SatEnums::RETURN_FEEDER_CH, and ns3::SatEnums::RETURN_USER_CH.

Referenced by DoGetFading().

+ Here is the caller graph for this function:

◆ LockToSet()

void ns3::SatMarkovContainer::LockToSet ( uint32_t  newSet)

Function for locking the parameter set.

Parameters
newSetnew set

Definition at line 403 of file satellite-markov-container.cc.

References m_currentSet, m_enableSetLock, m_enableStateLock, m_numOfSets, and UpdateProbabilities().

Referenced by RandomizeLockedState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LockToSetAndState()

void ns3::SatMarkovContainer::LockToSetAndState ( uint32_t  newSet,
uint32_t  newState 
)

Function for locking the parameter set and state.

Parameters
newSetnew set
newStatenew state

Definition at line 380 of file satellite-markov-container.cc.

References m_currentSet, m_currentState, m_enableSetLock, m_enableStateLock, m_numOfSets, m_numOfStates, and UpdateProbabilities().

Referenced by RandomizeLockedSetAndState(), and ns3::SatMarkovFadingExamplePlot::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RandomizeLockedSetAndState()

void ns3::SatMarkovContainer::RandomizeLockedSetAndState ( )

Function for locking the parameter set and state to random values.

Definition at line 421 of file satellite-markov-container.cc.

References LockToSetAndState(), m_numOfSets, and m_numOfStates.

+ Here is the call graph for this function:

◆ RandomizeLockedState()

void ns3::SatMarkovContainer::RandomizeLockedState ( uint32_t  set)

Function for locking the state to random value.

The set will be locked to the value provided by the parameter

Parameters
setThe value for set

Definition at line 442 of file satellite-markov-container.cc.

References LockToSet(), m_currentState, m_enableStateLock, and m_numOfStates.

+ Here is the call graph for this function:

◆ Reset()

void ns3::SatMarkovContainer::Reset ( void  )
private

Clear used variables.

Definition at line 136 of file satellite-markov-container.cc.

References m_currentElevation, m_fader_down, m_fader_up, m_markovConf, m_markovModel, and m_velocity.

Referenced by ~SatMarkovContainer(), and DoDispose().

+ Here is the caller graph for this function:

◆ UnlockSetAndState()

void ns3::SatMarkovContainer::UnlockSetAndState ( )

Function for unlocking the parameter set and state.

Definition at line 461 of file satellite-markov-container.cc.

References m_enableSetLock, and m_enableStateLock.

◆ UpdateProbabilities()

void ns3::SatMarkovContainer::UpdateProbabilities ( uint32_t  set)
private

Function for updating the state change probabilities.

Parameters
setparameter set

Definition at line 298 of file satellite-markov-container.cc.

References m_markovConf, m_markovModel, and m_numOfStates.

Referenced by SatMarkovContainer(), EvaluateStateChange(), LockToSet(), and LockToSetAndState().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cooldownPeriodLength

Time ns3::SatMarkovContainer::m_cooldownPeriodLength
private

Cooldown period length in time.

Definition at line 175 of file satellite-markov-container.h.

Referenced by SatMarkovContainer(), and HasCooldownPeriodPassed().

◆ m_currentElevation

ElevationCallback ns3::SatMarkovContainer::m_currentElevation
private

Current elevation value.

Definition at line 225 of file satellite-markov-container.h.

Referenced by SatMarkovContainer(), EvaluateStateChange(), and Reset().

◆ m_currentSet

uint32_t ns3::SatMarkovContainer::m_currentSet
private

◆ m_currentState

uint32_t ns3::SatMarkovContainer::m_currentState
private

◆ m_enableSetLock

bool ns3::SatMarkovContainer::m_enableSetLock
private

Variable for disabling the parameter set change.

Definition at line 205 of file satellite-markov-container.h.

Referenced by EvaluateStateChange(), LockToSet(), LockToSetAndState(), and UnlockSetAndState().

◆ m_enableStateLock

bool ns3::SatMarkovContainer::m_enableStateLock
private

Variable for disabling state changes.

Definition at line 210 of file satellite-markov-container.h.

Referenced by CalculateFading(), EvaluateStateChange(), LockToSet(), LockToSetAndState(), RandomizeLockedState(), and UnlockSetAndState().

◆ m_fader_down

Ptr<SatBaseFader> ns3::SatMarkovContainer::m_fader_down
private

Downlink fader.

Definition at line 150 of file satellite-markov-container.h.

Referenced by CalculateFading(), CreateFaders(), and Reset().

◆ m_fader_up

Ptr<SatBaseFader> ns3::SatMarkovContainer::m_fader_up
private

Uplink fader.

Definition at line 145 of file satellite-markov-container.h.

Referenced by CalculateFading(), CreateFaders(), and Reset().

◆ m_fadingTrace

TracedCallback<double, SatEnums::ChannelType_t, double > ns3::SatMarkovContainer::m_fadingTrace
private

Fading trace function.

Definition at line 239 of file satellite-markov-container.h.

Referenced by DoGetFading(), and GetTypeId().

◆ m_latestCalculatedFadingValue_down

double ns3::SatMarkovContainer::m_latestCalculatedFadingValue_down
private

Latest calculated downlink fading value.

Definition at line 190 of file satellite-markov-container.h.

Referenced by CalculateFading(), and GetCachedFadingValue().

◆ m_latestCalculatedFadingValue_up

double ns3::SatMarkovContainer::m_latestCalculatedFadingValue_up
private

Latest calculated uplink fading value.

Definition at line 185 of file satellite-markov-container.h.

Referenced by CalculateFading(), and GetCachedFadingValue().

◆ m_latestCalculationTime_down

Time ns3::SatMarkovContainer::m_latestCalculationTime_down
private

Latest calculation time for downlink fading value.

Definition at line 200 of file satellite-markov-container.h.

Referenced by CalculateFading(), and HasCooldownPeriodPassed().

◆ m_latestCalculationTime_up

Time ns3::SatMarkovContainer::m_latestCalculationTime_up
private

Latest calculation time for uplink fading value.

Definition at line 195 of file satellite-markov-container.h.

Referenced by CalculateFading(), and HasCooldownPeriodPassed().

◆ m_latestStateChangeTime

Time ns3::SatMarkovContainer::m_latestStateChangeTime
private

Latest calculation time for state change.

Definition at line 220 of file satellite-markov-container.h.

Referenced by CalculateDistanceSinceLastStateChange(), and EvaluateStateChange().

◆ m_markovConf

Ptr<SatMarkovConf> ns3::SatMarkovContainer::m_markovConf
private

Markoc model configuration.

Definition at line 140 of file satellite-markov-container.h.

Referenced by SatMarkovContainer(), CreateFaders(), EvaluateStateChange(), Reset(), and UpdateProbabilities().

◆ m_markovModel

Ptr<SatMarkovModel> ns3::SatMarkovContainer::m_markovModel
private

Markov model object.

Definition at line 135 of file satellite-markov-container.h.

Referenced by SatMarkovContainer(), CalculateFading(), EvaluateStateChange(), Reset(), and UpdateProbabilities().

◆ m_minimumPositionChangeInMeters

double ns3::SatMarkovContainer::m_minimumPositionChangeInMeters
private

Minimum state change distance in meters.

Definition at line 180 of file satellite-markov-container.h.

Referenced by SatMarkovContainer(), and EvaluateStateChange().

◆ m_numOfSets

uint32_t ns3::SatMarkovContainer::m_numOfSets
private

Number of parameter sets available.

Definition at line 160 of file satellite-markov-container.h.

Referenced by LockToSet(), LockToSetAndState(), and RandomizeLockedSetAndState().

◆ m_numOfStates

uint32_t ns3::SatMarkovContainer::m_numOfStates
private

◆ m_useDecibels

bool ns3::SatMarkovContainer::m_useDecibels
private

Defines whether the calculations should return the fading value in decibels or not.

Definition at line 230 of file satellite-markov-container.h.

Referenced by CalculateFading().

◆ m_velocity

VelocityCallback ns3::SatMarkovContainer::m_velocity
private

Node movement velocity.

Definition at line 215 of file satellite-markov-container.h.

Referenced by CalculateDistanceSinceLastStateChange(), DoGetFading(), and Reset().


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