A Discrete-Event Network Simulator
API
channel-condition-model.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
4  * University of Padova
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 
20 #ifndef CHANNEL_CONDITION_MODEL_H
21 #define CHANNEL_CONDITION_MODEL_H
22 
23 #include "ns3/object.h"
24 #include "ns3/random-variable-stream.h"
25 #include "ns3/vector.h"
26 #include "ns3/nstime.h"
27 #include <unordered_map>
28 
29 namespace ns3 {
30 
31 class MobilityModel;
32 
41 class ChannelCondition : public Object
42 {
43 
44 public:
49  {
50  LOS,
52  };
53 
59  static TypeId GetTypeId (void);
60 
65 
69  virtual ~ChannelCondition ();
70 
78 
85  void SetLosCondition (LosConditionValue losCondition);
86 
87 private:
89 
90 };
91 
101 {
102 public:
108  static TypeId GetTypeId (void);
109 
114 
118  virtual ~ChannelConditionModel ();
119 
129 
139  virtual int64_t AssignStreams (int64_t stream) = 0;
140 
147 
155 };
156 
163 {
164 public:
170  static TypeId GetTypeId (void);
171 
176 
181 
190 
197 
205 
215  virtual int64_t AssignStreams (int64_t stream) override;
216 };
217 
224 {
225 public:
231  static TypeId GetTypeId (void);
232 
237 
242 
251 
258 
266 
276  virtual int64_t AssignStreams (int64_t stream) override;
277 };
278 
286 {
287 public:
293  static TypeId GetTypeId (void);
294 
299 
303  virtual ~ThreeGppChannelConditionModel () override;
304 
317 
327  virtual int64_t AssignStreams (int64_t stream) override;
328 
329 protected:
330  virtual void DoDispose () override;
331 
338  static double Calculate2dDistance (const Vector &a, const Vector &b);
339 
340 private:
348  virtual double ComputePlos (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const = 0;
349 
357 
361  struct Item
362  {
365  };
366 
367  std::unordered_map<uint32_t, Item> m_channelConditionMap;
370 };
371 
381 {
382 public:
388  static TypeId GetTypeId (void);
389 
394 
398  virtual ~ThreeGppRmaChannelConditionModel () override;
399 
400 private:
409  virtual double ComputePlos (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const override;
410 };
411 
421 {
422 public:
428  static TypeId GetTypeId (void);
429 
434 
438  virtual ~ThreeGppUmaChannelConditionModel () override;
439 
440 private:
449  virtual double ComputePlos (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const override;
450 };
451 
461 {
462 public:
468  static TypeId GetTypeId (void);
469 
474 
479 
480 private:
489  virtual double ComputePlos (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const override;
490 };
491 
501 {
502 public:
508  static TypeId GetTypeId (void);
509 
514 
519 
520 private:
529  virtual double ComputePlos (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const override;
530 };
531 
541 {
542 public:
548  static TypeId GetTypeId (void);
549 
554 
559 
560 private:
569  virtual double ComputePlos (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const override;
570 };
571 
572 } // end ns3 namespace
573 
574 #endif /* CHANNEL_CONDITION_MODEL_H */
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Models the channel condition.
virtual ~ThreeGppIndoorOpenOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
LosConditionValue m_losCondition
contains the information about the LOS/NLOS state of the channel
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the UMi-Street Canyon...
Struct to store the channel condition in the m_channelConditionMap.
ThreeGppChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
static TypeId GetTypeId(void)
Get the type ID.
virtual Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the condition of the channel between a and b, that will be always non-LoS.
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
std::unordered_map< uint32_t, Item > m_channelConditionMap
map to store the channel conditions
virtual ~ChannelConditionModel()
Destructor for the ChannelConditionModel class.
ThreeGppUmiStreetCanyonChannelConditionModel()
Constructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
LosConditionValue GetLosCondition() const
Get the LosConditionValue contaning the information about the LOS/NLOS state of the channel...
Ptr< UniformRandomVariable > m_uniformVar
uniform random variable
ThreeGppIndoorOpenOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
ChannelConditionModel & operator=(const ChannelConditionModel &)=delete
Copy constructor.
static uint32_t GetKey(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
Returns a unique and reciprocal key for the channel between a and b.
virtual ~ThreeGppIndoorMixedOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
ThreeGppUmaChannelConditionModel()
Constructor for the ThreeGppUmaChannelConditionModel class.
static TypeId GetTypeId(void)
Get the type ID.
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
virtual ~AlwaysLosChannelConditionModel()
Destructor for the ChannelConditionModel class.
virtual ~ThreeGppUmiStreetCanyonChannelConditionModel() override
Destructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
Ptr< ChannelCondition > m_condition
the channel condition
static TypeId GetTypeId(void)
Get the type ID.
ThreeGppIndoorMixedOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
virtual int64_t AssignStreams(int64_t stream)=0
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Base class for the 3GPP channel condition models.
AlwaysLosChannelConditionModel & operator=(const AlwaysLosChannelConditionModel &)=delete
Copy constructor.
Computes the channel condition for the RMa scenario.
Computes the channel condition for the UMa scenario.
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the RMa scenario...
virtual ~ThreeGppRmaChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
virtual Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the condition of the channel between a and b, that will be always LoS.
Computes the channel condition for the Indoor Mixed Office scenario.
virtual Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
Computes the condition of the channel between a and b.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the Indoor Mixed Offi...
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the Indoor Open Offic...
Computes the channel condition for the Indoor Open Office scenario.
virtual Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Retrieve the condition of the channel between a and b.
static TypeId GetTypeId(void)
Get the type ID.
virtual ~ChannelCondition()
Destructor for the ChannelCondition class.
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoDispose() override
Destructor implementation.
static TypeId GetTypeId(void)
Get the type ID.
Carries information about the LOS/NLOS channel state.
NeverLosChannelConditionModel & operator=(const NeverLosChannelConditionModel &)=delete
Copy constructor.
ChannelConditionModel()
Constructor for the ChannelConditionModel class.
Time m_updatePeriod
the update period for the channel condition
ThreeGppRmaChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
virtual ~NeverLosChannelConditionModel()
Destructor for the ChannelConditionModel class.
void SetLosCondition(LosConditionValue losCondition)
Set the LosConditionValue with the information about the LOS/NLOS state of the channel.
NeverLosChannelConditionModel()
Constructor for the ChannelConditionModel class.
Models a never in-LoS condition model.
virtual ~ThreeGppChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
virtual ~ThreeGppUmaChannelConditionModel() override
Destructor for the ThreeGppUmaChannelConditionModel class.
static TypeId GetTypeId(void)
Get the type ID.
Time m_generatedTime
the time when the condition was generated
Models an always in-LoS condition model.
A base class which provides memory management and object aggregation.
Definition: object.h:87
LosConditionValue
Possible values for Line-of-Sight condition.
ChannelCondition()
Constructor for the ChannelCondition class.
Computes the channel condition for the UMi-Street canyon scenario.
a unique identifier for an interface.
Definition: type-id.h:58
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
AlwaysLosChannelConditionModel()
Constructor for the ChannelConditionModel class.
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the UMa scenario...