satellite-markov-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_MARKOV_MODEL_H
21 #define SATELLITE_MARKOV_MODEL_H
22 
23 #include <ns3/object.h>
24 
25 namespace ns3
26 {
27 
35 class SatMarkovModel : public Object
36 {
37  public:
42  static TypeId GetTypeId(void);
43 
48 
54  SatMarkovModel(uint32_t numOfStates, uint32_t initialState);
55 
60 
67  void SetProbability(uint32_t from, uint32_t to, double probability);
68 
73  uint32_t DoTransition();
74 
79  uint32_t GetState() const;
80 
85  void SetState(uint32_t newState);
86 
90  void DoDispose();
91 
92  private:
96  double* m_probabilities;
97 
101  uint32_t m_numOfStates;
102 
106  uint32_t m_currentState;
107 
111  void Reset();
112 };
113 
114 } // namespace ns3
115 
116 #endif /* SATELLITE_MARKOV_MODEL_H */
Class for Markov state machine.
uint32_t m_numOfStates
Number of states.
static TypeId GetTypeId(void)
NS-3 function for type id.
void Reset()
Clear used variables.
void SetProbability(uint32_t from, uint32_t to, double probability)
Function for setting the probability values.
uint32_t GetState() const
Function for returning the current state.
void DoDispose()
Do needed dispose actions.
double * m_probabilities
Markov state change probabilities.
uint32_t m_currentState
Current state.
uint32_t DoTransition()
Function for evaluating the state change.
void SetState(uint32_t newState)
Function for setting the state.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.