A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
channel-condition-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
3 * University of Padova
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef CHANNEL_CONDITION_MODEL_H
20#define CHANNEL_CONDITION_MODEL_H
21
22#include "ns3/nstime.h"
23#include "ns3/object.h"
24#include "ns3/random-variable-stream.h"
25#include "ns3/vector.h"
26
27#include <map>
28#include <unordered_map>
29
30namespace ns3
31{
32
33class MobilityModel;
34
35/**
36 * \ingroup propagation
37 *
38 * \brief Carries information about the LOS/NLOS channel state
39 *
40 * Additional information about the channel condition can be aggregated to instances of
41 * this class.
42 */
44{
45 public:
46 /**
47 * Possible values for Line-of-Sight condition.
48 */
50 {
51 LOS, //!< Line of Sight
52 NLOS, //!< Non Line of Sight
53 NLOSv, //!< Non Line of Sight due to a vehicle
54 LC_ND //!< Los condition not defined
55 };
56
57 /**
58 * Possible values for Outdoor to Indoor condition.
59 */
61 {
62 O2O, //!< Outdoor to Outdoor
63 O2I, //!< Outdoor to Indoor
64 I2I, //!< Indoor to Indoor
65 O2I_ND //!< Outdoor to Indoor condition not defined
66 };
67
68 /**
69 * Possible values for Low-High Penetration Loss condition.
70 */
72 {
73 LOW, //!< Low Penetration Losses
74 HIGH, //!< High Penetration Losses
75 LH_O2I_ND //!< Low-High Penetration Losses not defined
76 };
77
78 /**
79 * Get the type ID.
80 * \brief Get the type ID.
81 * \return the object TypeId
82 */
83 static TypeId GetTypeId();
84
85 /**
86 * Constructor for the ChannelCondition class
87 */
89
90 /**
91 * Constructor for the ChannelCondition class
92 * \param losCondition the LOS condition value
93 * \param o2iCondition the O2I condition value (by default is set to O2O)
94 * \param o2iLowHighCondition the O2I Low-High Building Penetration loss condition value (by
95 * default is set to LOW)
96 */
98 O2iConditionValue o2iCondition = O2O,
99 O2iLowHighConditionValue o2iLowHighCondition = LOW);
100
101 /**
102 * Destructor for the ChannelCondition class
103 */
104 ~ChannelCondition() override;
105
106 /**
107 * Get the LosConditionValue containing the information about the LOS/NLOS
108 * state of the channel
109 *
110 * \return the LosConditionValue
111 */
113
114 /**
115 * Set the LosConditionValue with the information about the LOS/NLOS
116 * state of the channel
117 *
118 * \param losCondition the LosConditionValue
119 */
120 void SetLosCondition(LosConditionValue losCondition);
121
122 /**
123 * Get the O2iConditionValue containing the information about the O2I
124 * state of the channel
125 *
126 * \return the O2iConditionValue
127 */
129
130 /**
131 * Set the O2iConditionValue containing the information about the O2I
132 * state of the channel
133 *
134 * \param o2iCondition the O2iConditionValue
135 */
136 void SetO2iCondition(O2iConditionValue o2iCondition);
137
138 /**
139 * Get the O2iLowHighConditionValue containing the information about the O2I
140 * building penetration losses (low or high)
141 *
142 * \return the O2iLowHighConditionValue
143 */
145
146 /**
147 * Set the O2iLowHighConditionValue containing the information about the O2I
148 * building penetration losses (low or high)
149 *
150 * \param o2iLowHighCondition the O2iLowHighConditionValue
151 */
152 void SetO2iLowHighCondition(O2iLowHighConditionValue o2iLowHighCondition);
153
154 /**
155 * Return true if the channel condition is LOS
156 *
157 * \return true if the channel condition is LOS
158 */
159 bool IsLos() const;
160
161 /**
162 * Return true if the channel condition is NLOS
163 *
164 * It does not consider the case in which the LOS path is obstructed by a
165 * vehicle. This case is represented as a separate channel condition (NLOSv),
166 * use the method IsNlosv instead.
167 *
168 * \return true if the channel condition is NLOS
169 */
170 bool IsNlos() const;
171
172 /**
173 * Return true if the channel condition is NLOSv
174 *
175 * \return true if the channel condition is NLOSv
176 */
177 bool IsNlosv() const;
178
179 /**
180 * Return true if the channel is outdoor-to-indoor
181 *
182 * \return true if the channel is outdoor-to-indoor
183 */
184 bool IsO2i() const;
185
186 /**
187 * Return true if the channel is outdoor-to-outdoor
188 *
189 * \return true if the channel is outdoor-to-outdoor
190 */
191 bool IsO2o() const;
192
193 /**
194 * Return true if the channel is indoor-to-indoor
195 *
196 * \return true if the channel is indoor-to-indoor
197 */
198 bool IsI2i() const;
199
200 /**
201 * Return true if this instance is equivalent to the one passed as argument
202 *
203 * \param losCondition the LOS condition of the other channel condition instance
204 * \param o2iCondition the 02I condition of the other channel condition instance
205 * \return true if the channel LOS and O2i conditions of the instance are equivalent to those
206 * passed as arguments
207 */
208 bool IsEqual(LosConditionValue losCondition, O2iConditionValue o2iCondition) const;
209
210 private:
212 m_losCondition; //!< contains the information about the LOS state of the channel
214 m_o2iCondition; //!< contains the information about the O2I state of the channel
215 O2iLowHighConditionValue m_o2iLowHighCondition; //!< contains the information about the O2I
216 //!< low-high building penetration losses
217
218 /**
219 * Prints a LosConditionValue to output
220 * \param os the output stream
221 * \param cond the LosConditionValue
222 *
223 * \return a reference to the output stream
224 */
225 friend std::ostream& operator<<(std::ostream& os, LosConditionValue cond);
226};
227
228/**
229 * \ingroup propagation
230 *
231 * \brief Models the channel condition
232 *
233 * Computes the condition of the channel between the transmitter and the
234 * receiver
235 */
237{
238 public:
239 /**
240 * Get the type ID.
241 * \brief Get the type ID.
242 * \return the object TypeId
243 */
244 static TypeId GetTypeId();
245
246 /**
247 * Constructor for the ChannelConditionModel class
248 */
250
251 /**
252 * Destructor for the ChannelConditionModel class
253 */
254 ~ChannelConditionModel() override;
255
256 // Delete copy constructor and assignment operator to avoid misuse
259
260 /**
261 * Computes the condition of the channel between a and b
262 *
263 * \param a mobility model
264 * \param b mobility model
265 * \return the condition of the channel between a and b
266 */
268 Ptr<const MobilityModel> b) const = 0;
269
270 /**
271 * If this model uses objects of type RandomVariableStream,
272 * set the stream numbers to the integers starting with the offset
273 * 'stream'. Return the number of streams (possibly zero) that
274 * have been assigned.
275 *
276 * \param stream the offset used to set the stream numbers
277 * \return the number of stream indices assigned by this model
278 */
279 virtual int64_t AssignStreams(int64_t stream) = 0;
280};
281
282/**
283 * \ingroup propagation
284 *
285 * \brief Models an always in-LoS condition model
286 */
288{
289 public:
290 /**
291 * Get the type ID.
292 * \brief Get the type ID.
293 * \return the object TypeId
294 */
295 static TypeId GetTypeId();
296
297 /**
298 * Constructor
299 */
301
302 /**
303 * Destructor
304 */
306
307 // Delete copy constructor and assignment operator to avoid misuse
310
311 /**
312 * Computes the condition of the channel between a and b, that will be always LoS
313 *
314 * \param a mobility model
315 * \param b mobility model
316 * \return the condition of the channel between a and b, that will be always LoS
317 */
319 Ptr<const MobilityModel> b) const override;
320
321 /**
322 * If this model uses objects of type RandomVariableStream,
323 * set the stream numbers to the integers starting with the offset
324 * 'stream'. Return the number of streams (possibly zero) that
325 * have been assigned.
326 *
327 * \param stream the offset used to set the stream numbers
328 * \return the number of stream indices assigned by this model
329 */
330 int64_t AssignStreams(int64_t stream) override;
331};
332
333/**
334 * \ingroup propagation
335 *
336 * \brief Models a never in-LoS condition model
337 */
339{
340 public:
341 /**
342 * Get the type ID.
343 * \brief Get the type ID.
344 * \return the object TypeId
345 */
346 static TypeId GetTypeId();
347
348 /**
349 * Constructor
350 */
352
353 /**
354 * Destructor
355 */
357
358 // Delete copy constructor and assignment operator to avoid misuse
361
362 /**
363 * Computes the condition of the channel between a and b, that will be always non-LoS
364 *
365 * \param a mobility model
366 * \param b mobility model
367 * \return the condition of the channel between a and b, that will be always non-LoS
368 */
370 Ptr<const MobilityModel> b) const override;
371
372 /**
373 * If this model uses objects of type RandomVariableStream,
374 * set the stream numbers to the integers starting with the offset
375 * 'stream'. Return the number of streams (possibly zero) that
376 * have been assigned.
377 *
378 * \param stream the offset used to set the stream numbers
379 * \return the number of stream indices assigned by this model
380 */
381 int64_t AssignStreams(int64_t stream) override;
382};
383
384/**
385 * \ingroup propagation
386 *
387 * \brief Models a never in-LoS condition model caused by a blocking vehicle
388 */
390{
391 public:
392 /**
393 * Get the type ID.
394 * \brief Get the type ID.
395 * \return the object TypeId
396 */
397 static TypeId GetTypeId();
398
399 /**
400 * Constructor
401 */
403
404 /**
405 * Destructor
406 */
408
409 // Delete copy constructor and assignment operator to avoid misuse
412 delete;
413
414 /**
415 * Computes the condition of the channel between a and b, that will be always NLOSv
416 *
417 * \param a mobility model
418 * \param b mobility model
419 * \return the condition of the channel between a and b, that will be always NLOSv
420 */
422 Ptr<const MobilityModel> b) const override;
423
424 /**
425 * If this model uses objects of type RandomVariableStream,
426 * set the stream numbers to the integers starting with the offset
427 * 'stream'. Return the number of streams (possibly zero) that
428 * have been assigned.
429 *
430 * \param stream the offset used to set the stream numbers
431 * \return the number of stream indices assigned by this model
432 */
433 int64_t AssignStreams(int64_t stream) override;
434};
435
436/**
437 * \ingroup propagation
438 *
439 * \brief Base class for the 3GPP channel condition models
440 *
441 */
443{
444 public:
445 /**
446 * Get the type ID.
447 * \brief Get the type ID.
448 * \return the object TypeId
449 */
450 static TypeId GetTypeId();
451
452 /**
453 * Constructor for the ThreeGppRmaChannelConditionModel class
454 */
456
457 /**
458 * Destructor for the ThreeGppRmaChannelConditionModel class
459 */
461
462 /**
463 * \brief Retrieve the condition of the channel between a and b.
464 *
465 * If the channel condition does not exists, the method computes it by calling
466 * ComputeChannelCondition and stores it in a local cache, that will be updated
467 * following the "UpdatePeriod" parameter.
468 *
469 * \param a mobility model
470 * \param b mobility model
471 * \return the condition of the channel between a and b
472 */
474 Ptr<const MobilityModel> b) const override;
475
476 /**
477 * If this model uses objects of type RandomVariableStream,
478 * set the stream numbers to the integers starting with the offset
479 * 'stream'. Return the number of streams (possibly zero) that
480 * have been assigned.
481 *
482 * \param stream the offset used to set the stream numbers
483 * \return the number of stream indices assigned by this model
484 */
485 int64_t AssignStreams(int64_t stream) override;
486
487 /**
488 * Computes and quantizes the elevation angle to a two-digits integer in [10, 90].
489 * Asserts that the provided mobility models are of the expected type, i.e.,
490 * GeocentricConstantPositionMobilityModel, and that the quantized
491 * angle is in the expected range [10, 90].
492 *
493 * \param a mobility model
494 * \param b mobility model
495 * \return the tuple [elevation angle, quantized elevation angle] between a and b
496 */
497 static std::tuple<double, double> GetQuantizedElevationAngle(Ptr<const MobilityModel> a,
499
500 /**
501 * \brief Computes the 2D distance between two 3D vectors
502 * \param a the first 3D vector
503 * \param b the second 3D vector
504 * \return the 2D distance between a and b
505 */
506 static double Calculate2dDistance(const Vector& a, const Vector& b);
507
508 protected:
509 void DoDispose() override;
510
511 /**
512 * Determine the density of vehicles in a V2V scenario.
513 */
515 {
519 INVALID
520 };
521
522 Ptr<UniformRandomVariable> m_uniformVar; //!< uniform random variable
523
524 private:
525 /**
526 * This method computes the channel condition based on a probabilistic model
527 * that is specific for the scenario of interest
528 *
529 * \param a tx mobility model
530 * \param b rx mobility model
531 * \return the channel condition
532 */
535
536 /**
537 * Compute the LOS probability.
538 *
539 * \param a tx mobility model
540 * \param b rx mobility model
541 * \return the LOS probability
542 */
544
545 /**
546 * Determines whether the channel condition is O2I or O2O
547 *
548 * \param a tx mobility model
549 * \param b rx mobility model
550 * \return the O2I channelcondition
551 */
554
555 /**
556 * Compute the NLOS probability. By default returns 1 - PLOS
557 *
558 * \param a tx mobility model
559 * \param b rx mobility model
560 * \return the LOS probability
561 */
563
564 /**
565 * \brief Returns a unique and reciprocal key for the channel between a and b.
566 * \param a tx mobility model
567 * \param b rx mobility model
568 * \return channel key
569 */
571
572 /**
573 * Struct to store the channel condition in the m_channelConditionMap
574 */
575 struct Item
576 {
577 Ptr<ChannelCondition> m_condition; //!< the channel condition
578 Time m_generatedTime; //!< the time when the condition was generated
579 };
580
581 std::unordered_map<uint32_t, Item>
582 m_channelConditionMap; //!< map to store the channel conditions
583 Time m_updatePeriod; //!< the update period for the channel condition
584
586 0}; //!< the threshold for determining what is the ratio of channels with O2I
587 double m_o2iLowLossThreshold{0}; //!< the threshold for determining what is the ratio of low -
588 //!< high O2I building penetration losses
590 false}; //!< the indicator that determines whether the O2I/O2O condition is determined based
591 //!< on the UE height
592 Ptr<UniformRandomVariable> m_uniformVarO2i; //!< uniform random variable that is used for the
593 //!< generation of the O2i conditions
595 m_uniformO2iLowHighLossVar; //!< a uniform random variable for the calculation of the
596 //!< low/high losses, see TR38.901 Table 7.4.3-2
597};
598
599/**
600 * \ingroup propagation
601 *
602 * \brief Computes the channel condition for the RMa scenario
603 *
604 * Computes the channel condition following the specifications for the RMa
605 * scenario reported in Table 7.4.2-1 of 3GPP TR 38.901
606 */
608{
609 public:
610 /**
611 * Get the type ID.
612 * \brief Get the type ID.
613 * \return the object TypeId
614 */
615 static TypeId GetTypeId();
616
617 /**
618 * Constructor for the ThreeGppRmaChannelConditionModel class
619 */
621
622 /**
623 * Destructor for the ThreeGppRmaChannelConditionModel class
624 */
626
627 private:
628 /**
629 * Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901
630 * for the RMa scenario.
631 *
632 * \param a tx mobility model
633 * \param b rx mobility model
634 * \return the LOS probability
635 */
637};
638
639/**
640 * \ingroup propagation
641 *
642 * \brief Computes the channel condition for the UMa scenario
643 *
644 * Computes the channel condition following the specifications for the UMa
645 * scenario reported in Table 7.4.2-1 of 3GPP TR 38.901
646 */
648{
649 public:
650 /**
651 * Get the type ID.
652 * \brief Get the type ID.
653 * \return the object TypeId
654 */
655 static TypeId GetTypeId();
656
657 /**
658 * Constructor for the ThreeGppUmaChannelConditionModel class
659 */
661
662 /**
663 * Destructor for the ThreeGppUmaChannelConditionModel class
664 */
666
667 private:
668 /**
669 * Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901
670 * for the UMa scenario.
671 *
672 * \param a tx mobility model
673 * \param b rx mobility model
674 * \return the LOS probability
675 */
677};
678
679/**
680 * \ingroup propagation
681 *
682 * \brief Computes the channel condition for the UMi-Street canyon scenario
683 *
684 * Computes the channel condition following the specifications for the
685 * UMi-Street canyon scenario reported in Table 7.4.2-1 of 3GPP TR 38.901
686 */
688{
689 public:
690 /**
691 * Get the type ID.
692 * \brief Get the type ID.
693 * \return the object TypeId
694 */
695 static TypeId GetTypeId();
696
697 /**
698 * Constructor for the ThreeGppUmiStreetCanyonChannelConditionModel class
699 */
701
702 /**
703 * Destructor for the ThreeGppUmiStreetCanyonChannelConditionModel class
704 */
706
707 private:
708 /**
709 * Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901
710 * for the UMi-Street Canyon scenario.
711 *
712 * \param a tx mobility model
713 * \param b rx mobility model
714 * \return the LOS probability
715 */
717};
718
719/**
720 * \ingroup propagation
721 *
722 * \brief Computes the channel condition for the Indoor Mixed Office scenario
723 *
724 * Computes the channel condition following the specifications for the
725 * Indoor Mixed Office scenario reported in Table 7.4.2-1 of 3GPP TR 38.901
726 */
728{
729 public:
730 /**
731 * Get the type ID.
732 * \brief Get the type ID.
733 * \return the object TypeId
734 */
735 static TypeId GetTypeId();
736
737 /**
738 * Constructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class
739 */
741
742 /**
743 * Destructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class
744 */
746
747 private:
748 /**
749 * Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901
750 * for the Indoor Mixed Office scenario.
751 *
752 * \param a tx mobility model
753 * \param b rx mobility model
754 * \return the LOS probability
755 */
757};
758
759/**
760 * \ingroup propagation
761 *
762 * \brief Computes the channel condition for the Indoor Open Office scenario
763 *
764 * Computes the channel condition following the specifications for the
765 * Indoor Open Office scenario reported in Table 7.4.2-1 of 3GPP TR 38.901
766 */
768{
769 public:
770 /**
771 * Get the type ID.
772 * \brief Get the type ID.
773 * \return the object TypeId
774 */
775 static TypeId GetTypeId();
776
777 /**
778 * Constructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class
779 */
781
782 /**
783 * Destructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class
784 */
786
787 private:
788 /**
789 * Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901
790 * for the Indoor Open Office scenario.
791 *
792 * \param a tx mobility model
793 * \param b rx mobility model
794 * \return the LOS probability
795 */
797};
798
799/**
800 * \ingroup propagation
801 *
802 * \brief Computes the channel condition for the NTN Dense Urban Scenario
803 *
804 * Computes the channel condition following the specifications for the
805 * Indoor Mixed Office scenario reported in Table 6.6.1-1 of 3GPP TR 38.811
806 */
808{
809 public:
810 /**
811 * Register this type.
812 * \return The object TypeId.
813 */
814 static TypeId GetTypeId();
815
816 /**
817 * Constructor for the ThreeGppNTNDenseUrbanChannelConditionModel class
818 */
820
821 /**
822 * Destructor for the ThreeGppNTNDenseUrbanChannelConditionModel class
823 */
825
826 private:
827 /**
828 * \copydoc ThreeGppChannelConditionModel::ComputePlos
829 *
830 * Compute the LOS probability as specified in Table 6.6.1-1 of 3GPP TR 38.811
831 * for the NTN Dense Urban scenario.
832 */
834};
835
836/**
837 * \ingroup propagation
838 *
839 * \brief Computes the channel condition for the NTN Urban Scenario
840 *
841 * Computes the channel condition following the specifications for the
842 * Indoor Mixed Office scenario reported in Table 6.6.1-1 of 3GPP TR 38.811
843 */
845{
846 public:
847 /**
848 * Register this type.
849 * \return The object TypeId.
850 */
851 static TypeId GetTypeId();
852
853 /**
854 * Constructor for the ThreeGppNTNUrbanChannelConditionModel class
855 */
857
858 /**
859 * Destructor for the ThreeGppNTNUrbanChannelConditionModel class
860 */
862
863 private:
864 /**
865 * \copydoc ThreeGppChannelConditionModel::ComputePlos
866 *
867 * Compute the LOS probability as specified in Table 6.6.1-1 of 3GPP TR 38.811
868 * for the NTN Urban scenario.
869 */
871};
872
873/**
874 * \ingroup propagation
875 *
876 * \brief Computes the channel condition for the NTN Suburban Scenario
877 *
878 * Computes the channel condition following the specifications for the
879 * Indoor Mixed Office scenario reported in Table 6.6.1-1 of 3GPP TR 38.811
880 */
882{
883 public:
884 /**
885 * Register this type.
886 * \return The object TypeId.
887 */
888 static TypeId GetTypeId();
889
890 /**
891 * Constructor for the ThreeGppNTNSuburbanChannelConditionModel class
892 */
894
895 /**
896 * Destructor for the ThreeGppNTNSuburbanChannelConditionModel class
897 */
899
900 private:
901 /**
902 * \copydoc ThreeGppChannelConditionModel::ComputePlos
903 *
904 * Compute the LOS probability as specified in Table 6.6.1-1 of 3GPP TR 38.811
905 * for the NTN Suburban scenario.
906 */
908};
909
910/**
911 * \ingroup propagation
912 *
913 * \brief Computes the channel condition for the NTN Rural Scenario
914 *
915 * Computes the channel condition following the specifications for the
916 * Indoor Mixed Office scenario reported in Table 6.6.1-1 of 3GPP TR 38.811
917 */
919{
920 public:
921 /**
922 * Register this type.
923 * \return The object TypeId.
924 */
925 static TypeId GetTypeId();
926
927 /**
928 * Constructor for the ThreeGppNTNRuralChannelConditionModel class
929 */
931
932 /**
933 * Destructor for the ThreeGppNTNRuralChannelConditionModel class
934 */
936
937 private:
938 /**
939 * \copydoc ThreeGppChannelConditionModel::ComputePlos
940 *
941 * Compute the LOS probability as specified in Table 6.6.1-1 of 3GPP TR 38.811
942 * for the NTN Rural scenario.
943 */
945};
946
947} // namespace ns3
948
949#endif /* CHANNEL_CONDITION_MODEL_H */
Models an always in-LoS condition model.
AlwaysLosChannelConditionModel & operator=(const AlwaysLosChannelConditionModel &)=delete
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
AlwaysLosChannelConditionModel(const AlwaysLosChannelConditionModel &)=delete
static TypeId GetTypeId()
Get the type ID.
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.
Carries information about the LOS/NLOS channel state.
LosConditionValue m_losCondition
contains the information about the LOS state of the channel
O2iLowHighConditionValue m_o2iLowHighCondition
contains the information about the O2I low-high building penetration losses
bool IsO2i() const
Return true if the channel is outdoor-to-indoor.
ChannelCondition()
Constructor for the ChannelCondition class.
void SetLosCondition(LosConditionValue losCondition)
Set the LosConditionValue with the information about the LOS/NLOS state of the channel.
LosConditionValue GetLosCondition() const
Get the LosConditionValue containing the information about the LOS/NLOS state of the channel.
bool IsNlos() const
Return true if the channel condition is NLOS.
bool IsEqual(LosConditionValue losCondition, O2iConditionValue o2iCondition) const
Return true if this instance is equivalent to the one passed as argument.
O2iConditionValue m_o2iCondition
contains the information about the O2I state of the channel
bool IsNlosv() const
Return true if the channel condition is NLOSv.
bool IsLos() const
Return true if the channel condition is LOS.
void SetO2iCondition(O2iConditionValue o2iCondition)
Set the O2iConditionValue containing the information about the O2I state of the channel.
~ChannelCondition() override
Destructor for the ChannelCondition class.
O2iLowHighConditionValue GetO2iLowHighCondition() const
Get the O2iLowHighConditionValue containing the information about the O2I building penetration losses...
friend std::ostream & operator<<(std::ostream &os, LosConditionValue cond)
Prints a LosConditionValue to output.
bool IsO2o() const
Return true if the channel is outdoor-to-outdoor.
bool IsI2i() const
Return true if the channel is indoor-to-indoor.
static TypeId GetTypeId()
Get the type ID.
O2iConditionValue
Possible values for Outdoor to Indoor condition.
@ O2I_ND
Outdoor to Indoor condition not defined.
@ O2O
Outdoor to Outdoor.
O2iLowHighConditionValue
Possible values for Low-High Penetration Loss condition.
@ LOW
Low Penetration Losses.
@ LH_O2I_ND
Low-High Penetration Losses not defined.
@ HIGH
High Penetration Losses.
void SetO2iLowHighCondition(O2iLowHighConditionValue o2iLowHighCondition)
Set the O2iLowHighConditionValue containing the information about the O2I building penetration losses...
O2iConditionValue GetO2iCondition() const
Get the O2iConditionValue containing the information about the O2I state of the channel.
LosConditionValue
Possible values for Line-of-Sight condition.
@ NLOSv
Non Line of Sight due to a vehicle.
@ LC_ND
Los condition not defined.
Models the channel condition.
static TypeId GetTypeId()
Get the type ID.
virtual int64_t AssignStreams(int64_t stream)=0
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
ChannelConditionModel(const ChannelConditionModel &)=delete
ChannelConditionModel & operator=(const ChannelConditionModel &)=delete
ChannelConditionModel()
Constructor for the ChannelConditionModel class.
virtual Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
Computes the condition of the channel between a and b.
~ChannelConditionModel() override
Destructor for the ChannelConditionModel class.
Models a never in-LoS condition model.
static TypeId GetTypeId()
Get the type ID.
~NeverLosChannelConditionModel() override
Destructor.
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.
NeverLosChannelConditionModel(const NeverLosChannelConditionModel &)=delete
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
NeverLosChannelConditionModel & operator=(const NeverLosChannelConditionModel &)=delete
Models a never in-LoS condition model caused by a blocking vehicle.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
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 NLOSv.
NeverLosVehicleChannelConditionModel(const NeverLosVehicleChannelConditionModel &)=delete
NeverLosVehicleChannelConditionModel & operator=(const NeverLosVehicleChannelConditionModel &)=delete
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Base class for the 3GPP channel condition models.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
void DoDispose() override
Destructor implementation.
Ptr< UniformRandomVariable > m_uniformVarO2i
uniform random variable that is used for the generation of the O2i conditions
virtual ChannelCondition::O2iConditionValue ComputeO2i(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Determines whether the channel condition is O2I or O2O.
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.
Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Retrieve the condition of the channel between a and b.
~ThreeGppChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
Ptr< UniformRandomVariable > m_uniformO2iLowHighLossVar
a uniform random variable for the calculation of the low/high losses, see TR38.901 Table 7....
VehicleDensity
Determine the density of vehicles in a V2V scenario.
double m_o2iLowLossThreshold
the threshold for determining what is the ratio of low - high O2I building penetration losses
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Compute the NLOS probability.
double m_o2iThreshold
the threshold for determining what is the ratio of channels with O2I
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
Compute the LOS probability.
std::unordered_map< uint32_t, Item > m_channelConditionMap
map to store the channel conditions
Ptr< UniformRandomVariable > m_uniformVar
uniform random variable
static std::tuple< double, double > GetQuantizedElevationAngle(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
Computes and quantizes the elevation angle to a two-digits integer in [10, 90].
ThreeGppChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
Ptr< ChannelCondition > ComputeChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
This method computes the channel condition based on a probabilistic model that is specific for the sc...
bool m_linkO2iConditionToAntennaHeight
the indicator that determines whether the O2I/O2O condition is determined based on the UE height
Time m_updatePeriod
the update period for the channel condition
static TypeId GetTypeId()
Get the type ID.
Computes the channel condition for the Indoor Mixed Office scenario.
ThreeGppIndoorMixedOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
~ThreeGppIndoorMixedOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
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...
Computes the channel condition for the Indoor Open Office scenario.
ThreeGppIndoorOpenOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
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...
~ThreeGppIndoorOpenOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
Computes the channel condition for the NTN Dense Urban Scenario.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
ThreeGppNTNDenseUrbanChannelConditionModel()=default
Constructor for the ThreeGppNTNDenseUrbanChannelConditionModel class.
~ThreeGppNTNDenseUrbanChannelConditionModel() override=default
Destructor for the ThreeGppNTNDenseUrbanChannelConditionModel class.
Computes the channel condition for the NTN Rural Scenario.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
static TypeId GetTypeId()
Register this type.
~ThreeGppNTNRuralChannelConditionModel() override=default
Destructor for the ThreeGppNTNRuralChannelConditionModel class.
ThreeGppNTNRuralChannelConditionModel()=default
Constructor for the ThreeGppNTNRuralChannelConditionModel class.
Computes the channel condition for the NTN Suburban Scenario.
ThreeGppNTNSuburbanChannelConditionModel()=default
Constructor for the ThreeGppNTNSuburbanChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
~ThreeGppNTNSuburbanChannelConditionModel() override=default
Destructor for the ThreeGppNTNSuburbanChannelConditionModel class.
Computes the channel condition for the NTN Urban Scenario.
static TypeId GetTypeId()
Register this type.
~ThreeGppNTNUrbanChannelConditionModel() override=default
Destructor for the ThreeGppNTNUrbanChannelConditionModel class.
ThreeGppNTNUrbanChannelConditionModel()=default
Constructor for the ThreeGppNTNUrbanChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
Computes the channel condition for the RMa scenario.
~ThreeGppRmaChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
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.
ThreeGppRmaChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
static TypeId GetTypeId()
Get the type ID.
Computes the channel condition for the UMa scenario.
static TypeId GetTypeId()
Get the type ID.
ThreeGppUmaChannelConditionModel()
Constructor for the ThreeGppUmaChannelConditionModel class.
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.
~ThreeGppUmaChannelConditionModel() override
Destructor for the ThreeGppUmaChannelConditionModel class.
Computes the channel condition for the UMi-Street canyon scenario.
ThreeGppUmiStreetCanyonChannelConditionModel()
Constructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
~ThreeGppUmiStreetCanyonChannelConditionModel() override
Destructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
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...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Struct to store the channel condition in the m_channelConditionMap.
Ptr< ChannelCondition > m_condition
the channel condition
Time m_generatedTime
the time when the condition was generated