satellite-per-packet-interference.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  * Copyright (c) 2018 CNES
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Jani Puttonen <jani.puttonen@magister.fi>
20  * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
21  */
22 
23 #ifndef SATELLITE_PER_PACKET_INTERFERENCE_H
24 #define SATELLITE_PER_PACKET_INTERFERENCE_H
25 
26 #include "satellite-enums.h"
28 #include "satellite-interference.h"
29 
30 #include <map>
31 #include <set>
32 
33 namespace ns3
34 {
35 
43 {
44  public:
49  static TypeId GetTypeId(void);
50 
55  TypeId GetInstanceTypeId(void) const;
56 
61 
67  SatPerPacketInterference(SatEnums::ChannelType_t channelType, double rxBandwidthHz);
68 
73 
77  void DoDispose();
78 
83  void SetRxBandwidth(double rxBandwidth);
84 
85  protected:
94  virtual std::vector<std::pair<double, double>> DoCalculate(
95  Ptr<SatInterference::InterferenceChangeEvent> event);
96 
102  virtual void onOwnStartReached(double ifPowerW);
103 
121  virtual void onInterferentEvent(long double timeRatio,
122  double interferenceValue,
123  double& ifPowerW);
124 
125  private:
134  virtual Ptr<SatInterference::InterferenceChangeEvent> DoAdd(Time rxDuration,
135  double rxPower,
136  Address rxAddress);
137 
141  virtual void DoReset(void);
142 
148  virtual void DoNotifyRxStart(Ptr<SatInterference::InterferenceChangeEvent> event);
149 
155  virtual void DoNotifyRxEnd(Ptr<SatInterference::InterferenceChangeEvent> event);
156 
160  typedef std::tuple<uint32_t, long double, bool> InterferenceChange;
161 
165  typedef std::multimap<Time, InterferenceChange> InterferenceChanges;
166 
172 
179 
184 
188  std::set<uint32_t> m_rxEventIds;
189 
194  long double m_residualPowerW;
195 
199  bool m_rxing;
200 
204  uint32_t m_nextEventId;
205 
210 
215 
220 };
221 
222 } // namespace ns3
223 
224 #endif /* SATELLITE_PER_PACKET_INTERFERENCE_H */
ChannelType_t
Types of channel.
Abstract class defining interface for interference calculations objects.
virtual void DoReset(void)
Resets current interference.
bool m_rxing
flag to indicate that at least one receiving is on
long double m_residualPowerW
Residual power value for interference.
virtual void DoNotifyRxEnd(Ptr< SatInterference::InterferenceChangeEvent > event)
Notifies that RX is ended by a receiver.
InterferenceChanges m_interferenceChanges
interference change list
virtual void DoNotifyRxStart(Ptr< SatInterference::InterferenceChangeEvent > event)
Notifies that RX is started by a receiver.
std::set< uint32_t > m_rxEventIds
notified interference event IDs
virtual void onInterferentEvent(long double timeRatio, double interferenceValue, double &ifPowerW)
Helper function meant for subclasses to override.
std::tuple< uint32_t, long double, bool > InterferenceChange
SatPerPacketInterference(const SatPerPacketInterference &o)
virtual std::vector< std::pair< double, double > > DoCalculate(Ptr< SatInterference::InterferenceChangeEvent > event)
Calculates interference power for the given reference Sets final power at end time to finalPower.
SatPerPacketInterference & operator=(const SatPerPacketInterference &o)
std::multimap< Time, InterferenceChange > InterferenceChanges
virtual void onOwnStartReached(double ifPowerW)
Helper function meant for subclasses to override.
virtual Ptr< SatInterference::InterferenceChangeEvent > DoAdd(Time rxDuration, double rxPower, Address rxAddress)
Adds interference power to interference object.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.