22 #ifndef THREE_GPP_CHANNEL_H
23 #define THREE_GPP_CHANNEL_H
26 #include "ns3/angles.h"
27 #include <ns3/object.h>
28 #include <ns3/nstime.h>
29 #include <ns3/random-variable-stream.h>
30 #include <ns3/boolean.h>
31 #include <unordered_map>
32 #include <ns3/channel-condition-model.h>
33 #include <ns3/matrix-based-channel-model.h>
145 static std::pair<double, double>
WrapAngles (
double azimuthRad,
double inclinationRad);
237 double dis2D,
double hBS,
double hUT)
const;
258 std::unordered_map<uint32_t, Ptr<ThreeGppChannelMatrix> >
m_channelMap;
double f(double x, void *params)
Class holding the azimuth and inclination angles of spherical coordinates.
This is an interface for a channel model that can be described by a channel matrix,...
std::vector< DoubleVector > Double2DVector
type definition for matrices of doubles
std::vector< double > DoubleVector
type definition for vectors of doubles
std::vector< Double2DVector > Double3DVector
type definition for 3D matrices of doubles
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
Channel Matrix Generation following 3GPP TR 38.901.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
bool m_portraitMode
true if potrait mode, false if landscape
virtual Ptr< const ParamsTable > GetThreeGppTable(Ptr< const ChannelCondition > channelCondition, double hBS, double hUT, double distance2D) const
Get the parameters needed to apply the channel generation procedure.
Ptr< NormalRandomVariable > m_normalRv
normal random variable
static const uint8_t Y_INDEX
index of the Y value in the m_nonSelfBlocking array
bool m_blockage
enables the blockage model A
~ThreeGppChannelModel()
Destructor.
static const uint8_t THETA_INDEX
index of the THETA value in the m_nonSelfBlocking array
static std::pair< double, double > WrapAngles(double azimuthRad, double inclinationRad)
Wrap an (azimuth, inclination) angle pair in a valid range.
ThreeGppChannelModel()
Constructor.
double m_blockerSpeed
the blocker speed
Ptr< const ChannelMatrix > GetChannel(Ptr< const MobilityModel > aMob, Ptr< const MobilityModel > bMob, Ptr< const PhasedArrayModel > aAntenna, Ptr< const PhasedArrayModel > bAntenna) override
Looks for the channel matrix associated to the aMob and bMob pair in m_channelMap.
void SetFrequency(double f)
Sets the center frequency of the model.
Ptr< UniformRandomVariable > m_uniformRv
uniform random variable
void DoDispose() override
Destructor implementation.
void SetScenario(const std::string &scenario)
Sets the propagation scenario.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model.
uint16_t m_numNonSelfBlocking
number of non-self-blocking regions
Ptr< ThreeGppChannelMatrix > GetNewChannel(Vector locUT, Ptr< const ChannelCondition > channelCondition, Ptr< const PhasedArrayModel > sAntenna, Ptr< const PhasedArrayModel > uAntenna, Angles &uAngle, Angles &sAngle, double dis2D, double hBS, double hUT) const
Compute the channel matrix between two devices using the procedure described in 3GPP TR 38....
static const uint8_t PHI_INDEX
index of the PHI value in the m_nonSelfBlocking array
double m_frequency
the operating frequency
Ptr< ChannelConditionModel > GetChannelConditionModel() const
Get the associated channel condition model.
Ptr< ChannelConditionModel > m_channelConditionModel
the channel condition model
std::string m_scenario
the 3GPP scenario
std::string GetScenario(void) const
Returns the propagation scenario.
static const uint8_t R_INDEX
index of the R value in the m_nonSelfBlocking array
double GetFrequency(void) const
Returns the center frequency.
static TypeId GetTypeId()
Get the type ID.
std::unordered_map< uint32_t, Ptr< ThreeGppChannelMatrix > > m_channelMap
map containing the channel realizations
DoubleVector CalcAttenuationOfBlockage(Ptr< ThreeGppChannelMatrix > params, const DoubleVector &clusterAOA, const DoubleVector &clusterZOA) const
Applies the blockage model A described in 3GPP TR 38.901.
bool ChannelMatrixNeedsUpdate(Ptr< const ThreeGppChannelMatrix > channelMatrix, Ptr< const ChannelCondition > channelCondition) const
Check if the channel matrix has to be updated.
void Shuffle(double *first, double *last) const
Shuffle the elements of a simple sequence container of type double.
Time m_updatePeriod
the channel update period
static const uint8_t X_INDEX
index of the X value in the m_nonSelfBlocking array
Ptr< UniformRandomVariable > m_uniformRvShuffle
uniform random variable used to shuffle array in GetNewChannel
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Data structure that stores a channel realization.
Data structure that stores the parameters of 3GPP TR 38.901, Table 7.5-6, for a certain scenario.
double m_perClusterShadowingStd
Extends the struct ChannelMatrix by including information that are used within the class ThreeGppChan...
Vector m_locUT
location of UT
MatrixBasedChannelModel::Double2DVector m_norRvAngles
stores the normal variable for random angles angle[cluster][id] generated for equation (7....
Ptr< const ChannelCondition > m_channelCondition
the channel condition
uint8_t m_numCluster
reduced cluster number;
double m_dis3D
3D distance between tx and rx
MatrixBasedChannelModel::Double2DVector m_nonSelfBlocking
store the blockages
MatrixBasedChannelModel::Double3DVector m_clusterPhase
the initial random phases
double m_dis2D
2D distance between tx and rx
Vector m_preLocUT
location of UT when generating the previous channel