22 #include <ns3/double.h> 23 #include <ns3/pointer.h> 57 .SetGroupName (
"Spectrum")
58 .AddAttribute (
"MaxLossDb",
59 "If a single-frequency PropagationLossModel is used, " 60 "this value represents the maximum loss in dB for which " 61 "transmissions will be passed to the receiving PHY. " 62 "Signals for which the PropagationLossModel returns " 63 "a loss bigger than this value will not be propagated " 64 "to the receiver. This parameter is to be used to reduce " 65 "the computational load by not propagating signals " 66 "that are far beyond the interference range. Note that " 67 "the default value corresponds to considering all signals " 68 "for reception. Tune this value with care. ",
71 MakeDoubleChecker<double> ())
73 .AddAttribute (
"PropagationLossModel",
74 "A pointer to the propagation loss model attached to this channel.",
77 MakePointerChecker<PropagationLossModel> ())
79 .AddTraceSource (
"Gain",
80 "This trace is fired whenever a new path loss value " 81 "is calculated. The parameters to this trace are : " 82 "Pointer to the mobility model of the transmitter" 83 "Pointer to the mobility model of the receiver" 89 "ns3::SpectrumChannel::GainTracedCallback")
91 .AddTraceSource (
"PathLoss",
92 "This trace is fired whenever a new path loss value " 93 "is calculated. The first and second parameters " 94 "to the trace are pointers respectively to the TX and " 95 "RX SpectrumPhy instances, whereas the third parameters " 96 "is the loss value in dB. Note that the loss value " 97 "reported by this trace is the single-frequency loss " 98 "value obtained by evaluating only the TX and RX " 99 "AntennaModels and the PropagationLossModel. " 100 "In particular, note that SpectrumPropagationLossModel " 101 "(even if present) is never used to evaluate the " 102 "loss value reported in this trace. ",
104 "ns3::SpectrumChannel::LossTracedCallback")
106 .AddTraceSource (
"TxSigParams",
107 "This trace is fired whenever a signal is transmitted." 108 "The sole parameter is a pointer to a copy of the " 109 "SpectrumSignalParameters provided by the transmitter.",
111 "ns3::SpectrumChannel::SignalParametersTracedCallback")
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual ~SpectrumChannel()
destructor
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void SetNext(Ptr< PropagationLossModel > next)
Enables a chain of loss models to act on the signal.
TracedCallback< Ptr< const SpectrumPhy >, Ptr< const SpectrumPhy >, double > m_pathLossTrace
The PathLoss trace source.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
double m_maxLossDb
Maximum loss [dB].
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Abstract Channel Base Class.
void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Add the single-frequency propagation loss model to be used.
void AddSpectrumPropagationLossModel(Ptr< SpectrumPropagationLossModel > loss)
Add the frequency-dependent propagation loss model to be used.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static TypeId GetTypeId(void)
Get the type ID.
Ptr< SpectrumPropagationLossModel > m_spectrumPropagationLoss
Frequency-dependent propagation loss model to be used with this channel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr<T>.
SpectrumChannel()
constructor
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Ptr< PropagationLossModel > m_propagationLoss
Single-frequency propagation loss model to be used with this channel.
TracedCallback< Ptr< SpectrumSignalParameters > > m_txSigParamsTrace
Traced callback for SpectrumSignalParameters in StartTx requests.
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used.
Ptr< PropagationDelayModel > m_propagationDelay
Propagation delay model to be used with this channel.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
a unique identifier for an interface.
TracedCallback< Ptr< const MobilityModel >, Ptr< const MobilityModel >, double, double, double, double > m_gainTrace
The Gain trace source.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual void DoDispose(void)
Destructor implementation.
Ptr< SpectrumPropagationLossModel > GetSpectrumPropagationLossModel(void)
Get the frequency-dependent propagation loss model.