satellite-rayleigh-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_RAYLEIGH_MODEL_H
21 #define SATELLITE_RAYLEIGH_MODEL_H
22 
23 #include "satellite-base-fader.h"
26 
27 #include <ns3/random-variable-stream.h>
28 #include <ns3/vector.h>
29 
30 namespace ns3
31 {
32 
41 {
42  public:
47  static TypeId GetTypeId(void);
48 
53 
60  SatRayleighModel(Ptr<SatRayleighConf> rayleighConf, uint32_t initialSet, uint32_t initialState);
61 
66 
70  void DoDispose();
71 
76  std::complex<double> GetComplexGain();
77 
82  double GetChannelGainDb();
83 
88  double GetChannelGain();
89 
95  void UpdateParameters(uint32_t set, uint32_t state);
96 
97  private:
101  void ConstructOscillators();
102 
106  void Reset();
107 
111  std::vector<Ptr<SatFadingOscillator>> m_oscillators;
112 
116  uint32_t m_currentSet;
117 
121  uint32_t m_currentState;
122 
126  Ptr<UniformRandomVariable> m_uniformVariable;
127 
131  Ptr<SatRayleighConf> m_rayleighConf;
132 
136  std::vector<std::vector<double>> m_rayleighParameters;
137 };
138 
139 } // namespace ns3
140 
141 #endif /* SATELLITE_RAYLEIGH_MODEL_H */
Base class for faders such as the Rayleigh fader.
Class for Rayleigh model fader.
Ptr< SatRayleighConf > m_rayleighConf
Rayleigh configuration object.
uint32_t m_currentSet
Current parameter set.
uint32_t m_currentState
Current state.
std::vector< Ptr< SatFadingOscillator > > m_oscillators
Vector of oscillators.
void DoDispose()
Do needed dispose actions.
void UpdateParameters(uint32_t set, uint32_t state)
Function for updating the parameter set and state.
std::vector< std::vector< double > > m_rayleighParameters
Rayleigh model parameters.
double GetChannelGainDb()
Function for returning the channel gain in dB.
void Reset()
Clear used variables.
Ptr< UniformRandomVariable > m_uniformVariable
Uniform distribution random variable.
void ConstructOscillators()
Function for constructing the oscillators.
static TypeId GetTypeId(void)
NS-3 function for type id.
double GetChannelGain()
Function for returning the channel gain.
std::complex< double > GetComplexGain()
Function for calculating the oscillator complex gain.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.