satellite-loo-model.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_LOO_MODEL_H
21 #define SATELLITE_LOO_MODEL_H
22 
23 #include "satellite-base-fader.h"
25 #include "satellite-loo-conf.h"
26 
27 #include <ns3/random-variable-stream.h>
28 #include <ns3/vector.h>
29 
30 namespace ns3
31 {
32 
40 class SatLooModel : public SatBaseFader
41 {
42  public:
47  static TypeId GetTypeId(void);
48 
52  SatLooModel();
53 
61  SatLooModel(Ptr<SatLooConf> looConf,
62  uint32_t numOfStates,
63  uint32_t initialSet,
64  uint32_t initialState);
65 
69  ~SatLooModel();
70 
74  void DoDispose();
75 
80  double GetChannelGainDb();
81 
86  double GetChannelGain();
87 
93  void UpdateParameters(uint32_t set, uint32_t state);
94 
95  private:
99  uint32_t m_numOfStates;
100 
104  uint32_t m_currentSet;
105 
109  uint32_t m_currentState;
110 
114  std::vector<double> m_sigma;
115 
119  Ptr<SatLooConf> m_looConf;
120 
124  std::vector<std::vector<double>> m_looParameters;
125 
129  Ptr<NormalRandomVariable> m_normalRandomVariable;
130 
134  Ptr<UniformRandomVariable> m_uniformVariable;
135 
139  std::vector<std::vector<Ptr<SatFadingOscillator>>> m_directSignalOscillators;
140 
144  std::vector<std::vector<Ptr<SatFadingOscillator>>> m_multipathOscillators;
145 
150 
155 
162  std::complex<double> GetOscillatorCosineWaveSum(
163  std::vector<Ptr<SatFadingOscillator>> oscillator,
164  double timeInSeconds);
165 
172  std::complex<double> GetOscillatorComplexSum(std::vector<Ptr<SatFadingOscillator>> oscillator,
173  double timeInSeconds);
174 
179  void ChangeState(uint32_t newState);
180 
186  void ChangeSet(uint32_t newSet, uint32_t newState);
187 
191  void CalculateSigma();
192 
196  void Reset();
197 };
198 
199 } // namespace ns3
200 
201 #endif /* SATELLITE_LOO_MODEL_H */
Base class for faders such as the Rayleigh fader.
Class for Loo's model fader.
double GetChannelGain()
Function for returning the channel gain.
double GetChannelGainDb()
Function for returning the channel gain in dB.
SatLooModel()
Constructor.
void ChangeState(uint32_t newState)
Function for setting the state.
void UpdateParameters(uint32_t set, uint32_t state)
Function for updating the parameter set and state.
Ptr< UniformRandomVariable > m_uniformVariable
Uniform distribution random variable.
std::vector< std::vector< double > > m_looParameters
Loo's model parameters.
std::complex< double > GetOscillatorComplexSum(std::vector< Ptr< SatFadingOscillator >> oscillator, double timeInSeconds)
Function for calculating oscillator complex sum.
uint32_t m_currentSet
Current parameter set.
std::complex< double > GetOscillatorCosineWaveSum(std::vector< Ptr< SatFadingOscillator >> oscillator, double timeInSeconds)
Function for calculating cosine wave oscillator complex sum.
void CalculateSigma()
Function for calculating sigma for different states.
uint32_t m_numOfStates
Number of states.
void ChangeSet(uint32_t newSet, uint32_t newState)
Function for setting the parameter set and state.
uint32_t m_currentState
Current state.
void Reset()
Clear used variables.
std::vector< std::vector< Ptr< SatFadingOscillator > > > m_multipathOscillators
Multipath oscillators.
void ConstructMultipathOscillators()
Function for constructing multipath oscillators.
std::vector< double > m_sigma
Multipath power converted to linear units.
~SatLooModel()
Destructor.
void ConstructDirectSignalOscillators()
Function for constructing direct signal oscillators.
Ptr< NormalRandomVariable > m_normalRandomVariable
Normal distribution random variable.
void DoDispose()
Do needed dispose actions.
std::vector< std::vector< Ptr< SatFadingOscillator > > > m_directSignalOscillators
Direct signal oscillators.
static TypeId GetTypeId(void)
NS-3 function for type id.
Ptr< SatLooConf > m_looConf
Loo's model configuration object.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.