Loading...
Searching...
No Matches
satellite-markov-container.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Frans Laakso <frans.laakso@magister.fi>
19 */
20#ifndef SATELLITE_MARKOV_CONTAINER_H
21#define SATELLITE_MARKOV_CONTAINER_H
22
23#include "geo-coordinate.h"
25#include "satellite-loo-model.h"
29
30#include "ns3/traced-callback.h"
31#include "ns3/vector.h"
32
33#include <stdint.h>
34
35namespace ns3
36{
37
48{
49 public:
54 static TypeId GetTypeId(void);
55
60
67 SatMarkovContainer(Ptr<SatMarkovConf> markovConf,
70
75
79 void DoDispose();
80
90 double DoGetFading(Address macAddress, SatEnums::ChannelType_t channeltype);
91
95 void UnlockSetAndState();
96
102 void LockToSetAndState(uint32_t newSet, uint32_t newState);
103
108 void LockToSet(uint32_t newSet);
109
114
119 void RandomizeLockedState(uint32_t set);
120
129 typedef void (*FadingTraceCallback)(double time,
130 SatEnums::ChannelType_t channelType,
131 double value);
132
133 private:
137 Ptr<SatMarkovModel> m_markovModel;
138
142 Ptr<SatMarkovConf> m_markovConf;
143
147 Ptr<SatBaseFader> m_fader_up;
148
152 Ptr<SatBaseFader> m_fader_down;
153
158
162 uint32_t m_numOfSets;
163
167 uint32_t m_currentSet;
168
173
178
183
188
193
198
203
208
213
218
223
228
233
237 TracedCallback<double, // time
238 SatEnums::ChannelType_t, // channel type
239 double // fading value
240 >
242
247 void UpdateProbabilities(uint32_t set);
248
253
259 double CalculateFading(SatEnums::ChannelType_t channelType);
260
266
273
280
285
291
295 void Reset();
296};
297
298} // namespace ns3
299
300#endif /* SATELLITE_MARKOV_CONTAINER_H */
Callback< double > VelocityCallback
Gets velocity in m/s.
Callback< double > ElevationCallback
Gets elevation angle in degrees.
ChannelType_t
Types of channel.
MarkovFaderType_t
Possible types of Markov state faders.
double DoGetFading(Address macAddress, SatEnums::ChannelType_t channeltype)
Function for getting the fading.
void UpdateProbabilities(uint32_t set)
Function for updating the state change probabilities.
Time m_latestCalculationTime_up
Latest calculation time for uplink fading value.
bool m_useDecibels
Defines whether the calculations should return the fading value in decibels or not.
double m_minimumPositionChangeInMeters
Minimum state change distance in meters.
void UnlockSetAndState()
Function for unlocking the parameter set and state.
void EvaluateStateChange(SatEnums::ChannelType_t channelType)
Function for evaluating state change.
void DoDispose()
Do needed dispose actions.
uint32_t m_currentState
Current state.
double m_latestCalculatedFadingValue_down
Latest calculated downlink fading value.
Time m_latestCalculationTime_down
Latest calculation time for downlink fading value.
uint32_t m_numOfSets
Number of parameter sets available.
double GetCachedFadingValue(SatEnums::ChannelType_t channelType)
Function for getting the cached fading values.
double m_latestCalculatedFadingValue_up
Latest calculated uplink fading value.
void LockToSet(uint32_t newSet)
Function for locking the parameter set.
void RandomizeLockedSetAndState()
Function for locking the parameter set and state to random values.
Ptr< SatMarkovConf > m_markovConf
Markoc model configuration.
void(* FadingTraceCallback)(double time, SatEnums::ChannelType_t channelType, double value)
Callback for FadingTrace trace source.
TracedCallback< double, SatEnums::ChannelType_t, double > m_fadingTrace
Fading trace function.
bool m_enableSetLock
Variable for disabling the parameter set change.
uint32_t m_numOfStates
Number of states available.
double CalculateFading(SatEnums::ChannelType_t channelType)
Function for calculating the fading value.
VelocityCallback m_velocity
Node movement velocity.
void Reset()
Clear used variables.
double CalculateElevation()
Function for calculating the elevation.
double CalculateDistanceSinceLastStateChange()
Function for calculating the distance since latest state change position.
static TypeId GetTypeId(void)
NS-3 function for type id.
bool HasCooldownPeriodPassed(SatEnums::ChannelType_t channelType)
Function for checking whether the cooldown period has passed.
uint32_t m_currentSet
Current parameter set.
ElevationCallback m_currentElevation
Current elevation value.
bool m_enableStateLock
Variable for disabling state changes.
void RandomizeLockedState(uint32_t set)
Function for locking the state to random value.
Ptr< SatBaseFader > m_fader_up
Uplink fader.
Time m_cooldownPeriodLength
Cooldown period length in time.
Time m_latestStateChangeTime
Latest calculation time for state change.
Ptr< SatBaseFader > m_fader_down
Downlink fader.
void LockToSetAndState(uint32_t newSet, uint32_t newState)
Function for locking the parameter set and state.
void CreateFaders(SatMarkovConf::MarkovFaderType_t faderType)
Function for creating the Markov state faders.
Ptr< SatMarkovModel > m_markovModel
Markov model object.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.