Loading...
Searching...
No Matches
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"
29
30#include <map>
31#include <set>
32#include <stdint.h>
33#include <tuple>
34#include <utility>
35#include <vector>
36
37namespace ns3
38{
39
47{
48 public:
53 static TypeId GetTypeId(void);
54
59
65 SatPerPacketInterference(SatEnums::ChannelType_t channelType, double rxBandwidthHz);
66
71
75 void DoDispose();
76
81 void SetRxBandwidth(double rxBandwidth);
82
83 protected:
92 virtual std::vector<std::pair<double, double>> DoCalculate(
93 Ptr<SatInterference::InterferenceChangeEvent> event);
94
100 virtual void onOwnStartReached(double ifPowerW);
101
119 virtual void onInterferentEvent(long double timeRatio,
120 double interferenceValue,
121 double& ifPowerW);
122
123 private:
132 virtual Ptr<SatInterference::InterferenceChangeEvent> DoAdd(Time rxDuration,
133 double rxPower,
134 Address rxAddress);
135
139 virtual void DoReset(void);
140
146 virtual void DoNotifyRxStart(Ptr<SatInterference::InterferenceChangeEvent> event);
147
153 virtual void DoNotifyRxEnd(Ptr<SatInterference::InterferenceChangeEvent> event);
154
158 typedef std::tuple<uint32_t, long double, bool> InterferenceChange;
159
163 typedef std::multimap<Time, InterferenceChange> InterferenceChanges;
164
170
177
182
186 std::set<uint32_t> m_rxEventIds;
187
192 long double m_residualPowerW;
193
198
203
208
213
218};
219
220} // namespace ns3
221
222#endif /* SATELLITE_PER_PACKET_INTERFERENCE_H */
ChannelType_t
Types of channel.
SatInterference()
Constructor for Satellite interference base class.
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)
SatPerPacketInterference & operator=(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.
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.