A Discrete-Event Network Simulator
API
spectrum-channel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 CTTC
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Nicola Baldo <nbaldo@cttc.es>
18  */
19 
20 #ifndef SPECTRUM_CHANNEL_H
21 #define SPECTRUM_CHANNEL_H
22 
23 #include <ns3/channel.h>
24 #include <ns3/mobility-model.h>
25 #include <ns3/nstime.h>
26 #include <ns3/object.h>
27 #include <ns3/phased-array-spectrum-propagation-loss-model.h>
28 #include <ns3/propagation-delay-model.h>
29 #include <ns3/propagation-loss-model.h>
30 #include <ns3/spectrum-phy.h>
31 #include <ns3/spectrum-propagation-loss-model.h>
32 #include <ns3/spectrum-signal-parameters.h>
33 #include <ns3/traced-callback.h>
34 
35 namespace ns3
36 {
37 
38 class PacketBurst;
39 class SpectrumValue;
40 
47 class SpectrumChannel : public Channel
48 {
49  public:
59  ~SpectrumChannel() override;
60 
61  // inherited from Object
62  void DoDispose() override;
63 
68  static TypeId GetTypeId();
69 
77 
83 
91 
97 
103 
110 
116 
123 
137  virtual void RemoveRx(Ptr<SpectrumPhy> phy) = 0;
138 
154  virtual void AddRx(Ptr<SpectrumPhy> phy) = 0;
155 
165  double lossDb);
176  typedef void (*GainTracedCallback)(Ptr<const MobilityModel> txMobility,
177  Ptr<const MobilityModel> rxMobility,
178  double txAntennaGain,
179  double rxAntennaGain,
180  double propagationGain,
181  double pathloss);
188 
189  protected:
195 
203  double,
204  double,
205  double,
206  double>
208 
213 
219  double m_maxLossDb;
220 
225 
230 
235 
240 };
241 
242 } // namespace ns3
243 
244 #endif /* SPECTRUM_CHANNEL_H */
Abstract Channel Base Class.
Definition: channel.h:45
Defines the interface for spectrum-aware channel implementations.
void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Add the single-frequency propagation loss model to be used.
TracedCallback< Ptr< SpectrumSignalParameters > > m_txSigParamsTrace
Traced callback for SpectrumSignalParameters in StartTx requests.
virtual void RemoveRx(Ptr< SpectrumPhy > phy)=0
Remove a SpectrumPhy from a channel.
virtual void StartTx(Ptr< SpectrumSignalParameters > params)=0
Used by attached PHY instances to transmit signals on the channel.
void DoDispose() override
Destructor implementation.
void AddSpectrumPropagationLossModel(Ptr< SpectrumPropagationLossModel > loss)
Add the frequency-dependent propagation loss model to be used.
SpectrumChannel()
constructor
void(* LossTracedCallback)(Ptr< const SpectrumPhy > txPhy, Ptr< const SpectrumPhy > rxPhy, double lossDb)
TracedCallback signature for path loss calculation events.
Ptr< PropagationDelayModel > m_propagationDelay
Propagation delay model to be used with this channel.
Ptr< PhasedArraySpectrumPropagationLossModel > GetPhasedArraySpectrumPropagationLossModel()
Get the frequency-dependent propagation loss model that is compatible with the phased antenna arrays ...
Ptr< SpectrumPropagationLossModel > m_spectrumPropagationLoss
Frequency-dependent propagation loss model to be used with this channel.
Ptr< PhasedArraySpectrumPropagationLossModel > m_phasedArraySpectrumPropagationLoss
Frequency-dependent propagation loss model to be used with this channel.
TracedCallback< Ptr< const SpectrumPhy >, Ptr< const SpectrumPhy >, double > m_pathLossTrace
The PathLoss trace source.
Ptr< SpectrumPropagationLossModel > GetSpectrumPropagationLossModel()
Get the frequency-dependent propagation loss model.
TracedCallback< Ptr< const MobilityModel >, Ptr< const MobilityModel >, double, double, double, double > m_gainTrace
The Gain trace source.
void(* GainTracedCallback)(Ptr< const MobilityModel > txMobility, Ptr< const MobilityModel > rxMobility, double txAntennaGain, double rxAntennaGain, double propagationGain, double pathloss)
TracedCallback signature for path loss calculation events.
Ptr< PropagationLossModel > m_propagationLoss
Single-frequency propagation loss model to be used with this channel.
Ptr< PropagationLossModel > GetPropagationLossModel()
Get the propagation loss model.
static TypeId GetTypeId()
Get the type ID.
virtual void AddRx(Ptr< SpectrumPhy > phy)=0
Add a SpectrumPhy to a channel, so it can receive packets.
void(* SignalParametersTracedCallback)(Ptr< SpectrumSignalParameters > params)
TracedCallback signature for Ptr<const SpectrumSignalParameters>.
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used.
double m_maxLossDb
Maximum loss [dB].
void AddPhasedArraySpectrumPropagationLossModel(Ptr< PhasedArraySpectrumPropagationLossModel > loss)
Add the frequency-dependent propagation loss model that is compapatible with the phased antenna array...
~SpectrumChannel() override
destructor
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.
phy
Definition: third.py:82
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.