A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
spectrum-propagation-loss-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 CTTC
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef SPECTRUM_PROPAGATION_LOSS_MODEL_H
10#define SPECTRUM_PROPAGATION_LOSS_MODEL_H
11
12#include "spectrum-value.h"
13
14#include <ns3/mobility-model.h>
15#include <ns3/object.h>
16
17namespace ns3
18{
19
20struct SpectrumSignalParameters;
21
22/**
23 * @ingroup spectrum
24 *
25 * @brief spectrum-aware propagation loss model
26 *
27 * Interface for propagation loss models to be adopted when
28 * transmissions are modeled with a power spectral density by means of
29 * the SpectrumValue class.
30 *
31 */
33{
34 public:
37
38 /**
39 * @brief Get the type ID.
40 * @return the object TypeId
41 */
42 static TypeId GetTypeId();
43
44 /**
45 * Used to chain various instances of SpectrumPropagationLossModel
46 *
47 * @param next
48 */
50
51 /**
52 * Return the pointer to the next SpectrumPropagationLossModel, if any.
53 *
54 * @return Pointer to the next model, if any.
55 */
57
58 /**
59 * This method is to be called to calculate
60 *
61 * @param params the spectrum signal parameters.
62 * @param a sender mobility
63 * @param b receiver mobility
64 *
65 * @return set of values Vs frequency representing the received
66 * power in the same units used for the txPower parameter.
67 */
71
72 /**
73 * If this loss model uses objects of type RandomVariableStream,
74 * set the stream numbers to the integers starting with the offset
75 * 'stream'. Return the number of streams (possibly zero) that
76 * have been assigned. If there are SpectrumPropagationLossModels chained
77 * together, this method will also assign streams to the
78 * downstream models.
79 *
80 * @param stream the stream index offset start
81 * @return the number of stream indices assigned by this model
82 */
83 int64_t AssignStreams(int64_t stream);
84
85 protected:
86 void DoDispose() override;
87 /**
88 * Assign a fixed random variable stream number to the random variables used by this model.
89 *
90 * Subclasses must implement this; those not using random variables can return zero.
91 *
92 * @param stream first stream index to use
93 * @return the number of stream indices assigned by this model
94 */
95 virtual int64_t DoAssignStreams(int64_t stream) = 0;
96
97 private:
98 /**
99 *
100 * @param params the spectrum signal parameters.
101 * @param a sender mobility
102 * @param b receiver mobility
103 *
104 * @return set of values Vs frequency representing the received
105 * power in the same units used for the txPower parameter.
106 */
110 Ptr<const MobilityModel> b) const = 0;
111
112 Ptr<SpectrumPropagationLossModel> m_next; //!< SpectrumPropagationLossModel chained to this one.
113};
114
115} // namespace ns3
116
117#endif /* SPECTRUM_PROPAGATION_LOSS_MODEL_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
spectrum-aware propagation loss model
Ptr< SpectrumValue > CalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
This method is to be called to calculate.
virtual Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
void SetNext(Ptr< SpectrumPropagationLossModel > next)
Used to chain various instances of SpectrumPropagationLossModel.
Ptr< SpectrumPropagationLossModel > m_next
SpectrumPropagationLossModel chained to this one.
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
Ptr< SpectrumPropagationLossModel > GetNext() const
Return the pointer to the next SpectrumPropagationLossModel, if any.
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
void DoDispose() override
Destructor implementation.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.