A Discrete-Event Network Simulator
API
channel-condition-model.cc
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 
20 
21 #include "ns3/boolean.h"
22 #include "ns3/double.h"
23 #include "ns3/log.h"
24 #include "ns3/mobility-model.h"
25 #include "ns3/node.h"
26 #include "ns3/simulator.h"
27 #include "ns3/string.h"
28 
29 #include <cmath>
30 
31 namespace ns3
32 {
33 
34 NS_LOG_COMPONENT_DEFINE("ChannelConditionModel");
35 
36 NS_OBJECT_ENSURE_REGISTERED(ChannelCondition);
37 
38 TypeId
40 {
41  static TypeId tid =
42  TypeId("ns3::ChannelCondition").SetParent<Object>().SetGroupName("Propagation");
43  return tid;
44 }
45 
47  : m_losCondition(LosConditionValue::LC_ND),
48  m_o2iCondition(O2iConditionValue::O2I_ND),
49  m_o2iLowHighCondition(O2iLowHighConditionValue::LH_O2I_ND)
50 {
51 }
52 
56 {
57  m_losCondition = losCondition;
58  m_o2iCondition = o2iCondition;
59  m_o2iLowHighCondition = o2iLowHighCondition;
60 }
61 
63 {
64 }
65 
68 {
69  return m_losCondition;
70 }
71 
72 void
74 {
75  m_losCondition = cond;
76 }
77 
80 {
81  return m_o2iCondition;
82 }
83 
84 void
86 {
87  m_o2iCondition = o2iCondition;
88 }
89 
92 {
93  return m_o2iLowHighCondition;
94 }
95 
96 void
98 {
99  m_o2iLowHighCondition = o2iLowHighCondition;
100 }
101 
102 bool
104 {
106 }
107 
108 bool
110 {
112 }
113 
114 bool
116 {
118 }
119 
120 bool
122 {
124 }
125 
126 bool
128 {
130 }
131 
132 bool
134 {
136 }
137 
138 bool
140 {
141  return m_losCondition == losCondition && m_o2iCondition == o2iCondition;
142 }
143 
144 std::ostream&
145 operator<<(std::ostream& os, ChannelCondition::LosConditionValue cond)
146 {
147  if (cond == ChannelCondition::LosConditionValue::LOS)
148  {
149  os << "LOS";
150  }
151  else if (cond == ChannelCondition::LosConditionValue::NLOS)
152  {
153  os << "NLOS";
154  }
155  else if (cond == ChannelCondition::LosConditionValue::NLOSv)
156  {
157  os << "NLOSv";
158  }
159 
160  return os;
161 }
162 
163 // ------------------------------------------------------------------------- //
164 
166 
167 TypeId
169 {
170  static TypeId tid =
171  TypeId("ns3::ChannelConditionModel").SetParent<Object>().SetGroupName("Propagation");
172  return tid;
173 }
174 
176 {
177 }
178 
180 {
181 }
182 
183 // ------------------------------------------------------------------------- //
184 
186 
187 TypeId
189 {
190  static TypeId tid = TypeId("ns3::AlwaysLosChannelConditionModel")
191  .SetParent<Object>()
192  .SetGroupName("Propagation")
193  .AddConstructor<AlwaysLosChannelConditionModel>();
194  return tid;
195 }
196 
198 {
199 }
200 
202 {
203 }
204 
207  Ptr<const MobilityModel> /* b */) const
208 {
209  Ptr<ChannelCondition> c = CreateObject<ChannelCondition>(ChannelCondition::LOS);
210 
211  return c;
212 }
213 
214 int64_t
216 {
217  return 0;
218 }
219 
220 // ------------------------------------------------------------------------- //
221 
223 
224 TypeId
226 {
227  static TypeId tid = TypeId("ns3::NeverLosChannelConditionModel")
228  .SetParent<Object>()
229  .SetGroupName("Propagation")
230  .AddConstructor<NeverLosChannelConditionModel>();
231  return tid;
232 }
233 
235 {
236 }
237 
239 {
240 }
241 
244  Ptr<const MobilityModel> /* b */) const
245 {
246  Ptr<ChannelCondition> c = CreateObject<ChannelCondition>(ChannelCondition::NLOS);
247 
248  return c;
249 }
250 
251 int64_t
253 {
254  return 0;
255 }
256 
257 // ------------------------------------------------------------------------- //
258 
260 
261 TypeId
263 {
264  static TypeId tid = TypeId("ns3::NeverLosVehicleChannelConditionModel")
266  .SetGroupName("Propagation")
267  .AddConstructor<NeverLosVehicleChannelConditionModel>();
268  return tid;
269 }
270 
272 {
273 }
274 
276 {
277 }
278 
281  Ptr<const MobilityModel> /* b */) const
282 {
283  Ptr<ChannelCondition> c = CreateObject<ChannelCondition>(ChannelCondition::NLOSv);
284 
285  return c;
286 }
287 
288 int64_t
290 {
291  return 0;
292 }
293 
294 // ------------------------------------------------------------------------- //
295 
297 
298 TypeId
300 {
301  static TypeId tid =
302  TypeId("ns3::ThreeGppChannelConditionModel")
304  .SetGroupName("Propagation")
305  .AddAttribute(
306  "UpdatePeriod",
307  "Specifies the time period after which the channel "
308  "condition is recomputed. If set to 0, the channel condition is never updated.",
311  MakeTimeChecker())
312  .AddAttribute("O2iThreshold",
313  "Specifies what will be the ratio of O2I channel "
314  "conditions. Default value is 0 that corresponds to 0 O2I losses.",
315  DoubleValue(0.0),
317  MakeDoubleChecker<double>(0, 1))
318  .AddAttribute("O2iLowLossThreshold",
319  "Specifies what will be the ratio of O2I "
320  "low - high penetration losses. Default value is 1.0 meaning that"
321  "all losses will be low",
322  DoubleValue(1.0),
324  MakeDoubleChecker<double>(0, 1))
325  .AddAttribute("LinkO2iConditionToAntennaHeight",
326  "Specifies whether the O2I condition will "
327  "be determined based on the UE height, i.e. if the UE height is 1.5 then "
328  "it is O2O, "
329  "otherwise it is O2I.",
330  BooleanValue(false),
334  return tid;
335 }
336 
339 {
340  m_uniformVar = CreateObject<UniformRandomVariable>();
343 
344  m_uniformVarO2i = CreateObject<UniformRandomVariable>();
345  m_uniformO2iLowHighLossVar = CreateObject<UniformRandomVariable>();
346 }
347 
349 {
350 }
351 
352 void
354 {
355  m_channelConditionMap.clear();
356  m_updatePeriod = Seconds(0.0);
357 }
358 
361  Ptr<const MobilityModel> b) const
362 {
364 
365  // get the key for this channel
366  uint32_t key = GetKey(a, b);
367 
368  bool notFound = false; // indicates if the channel condition is not present in the map
369  bool update = false; // indicates if the channel condition has to be updated
370 
371  // look for the channel condition in m_channelConditionMap
372  auto mapItem = m_channelConditionMap.find(key);
373  if (mapItem != m_channelConditionMap.end())
374  {
375  NS_LOG_DEBUG("found the channel condition in the map");
376  cond = mapItem->second.m_condition;
377 
378  // check if it has to be updated
379  if (!m_updatePeriod.IsZero() &&
380  Simulator::Now() - mapItem->second.m_generatedTime > m_updatePeriod)
381  {
382  NS_LOG_DEBUG("it has to be updated");
383  update = true;
384  }
385  }
386  else
387  {
388  NS_LOG_DEBUG("channel condition not found");
389  notFound = true;
390  }
391 
392  // if the channel condition was not found or if it has to be updated
393  // generate a new channel condition
394  if (notFound || update)
395  {
396  cond = ComputeChannelCondition(a, b);
397  // store the channel condition in m_channelConditionMap, used as cache.
398  // For this reason you see a const_cast.
399  Item mapItem;
400  mapItem.m_condition = cond;
401  mapItem.m_generatedTime = Simulator::Now();
402  const_cast<ThreeGppChannelConditionModel*>(this)->m_channelConditionMap[key] = mapItem;
403  }
404 
405  return cond;
406 }
407 
410  Ptr<const MobilityModel> b) const
411 {
412  double o2iProb = m_uniformVarO2i->GetValue(0, 1);
413 
415  {
416  if (std::min(a->GetPosition().z, b->GetPosition().z) == 1.5)
417  {
418  return ChannelCondition::O2iConditionValue::O2O;
419  }
420  else
421  {
422  return ChannelCondition::O2iConditionValue::O2I;
423  }
424  }
425  else
426  {
427  if (o2iProb < m_o2iThreshold)
428  {
429  NS_LOG_INFO("Return O2i condition ....");
430  return ChannelCondition::O2iConditionValue::O2I;
431  }
432  else
433  {
434  NS_LOG_INFO("Return O2o condition ....");
435  return ChannelCondition::O2iConditionValue::O2O;
436  }
437  }
438 }
439 
442  Ptr<const MobilityModel> b) const
443 {
444  NS_LOG_FUNCTION(this << a << b);
445  Ptr<ChannelCondition> cond = CreateObject<ChannelCondition>();
446 
447  // compute the LOS probability
448  double pLos = ComputePlos(a, b);
449  double pNlos = ComputePnlos(a, b);
450 
451  // draw a random value
452  double pRef = m_uniformVar->GetValue();
453 
454  NS_LOG_DEBUG("pRef " << pRef << " pLos " << pLos << " pNlos " << pNlos);
455 
456  // get the channel condition
457  if (pRef <= pLos)
458  {
459  // LOS
460  cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
461  }
462  else if (pRef <= pLos + pNlos)
463  {
464  // NLOS
465  cond->SetLosCondition(ChannelCondition::LosConditionValue::NLOS);
466  }
467  else
468  {
469  // NLOSv (added to support vehicular scenarios)
470  cond->SetLosCondition(ChannelCondition::LosConditionValue::NLOSv);
471  }
472 
473  cond->SetO2iCondition(ComputeO2i(a, b));
474 
475  if (cond->GetO2iCondition() == ChannelCondition::O2iConditionValue::O2I)
476  {
477  // Since we have O2I penetration losses, we should choose based on the
478  // threshold if it will be low or high penetration losses
479  // (see TR38.901 Table 7.4.3)
480  double o2iLowHighLossProb = m_uniformO2iLowHighLossVar->GetValue(0, 1);
481  ChannelCondition::O2iLowHighConditionValue lowHighLossCondition;
482 
483  if (o2iLowHighLossProb < m_o2iLowLossThreshold)
484  {
486  }
487  else
488  {
490  }
491  cond->SetO2iLowHighCondition(lowHighLossCondition);
492  }
493 
494  return cond;
495 }
496 
497 double
499  Ptr<const MobilityModel> b) const
500 {
501  NS_LOG_FUNCTION(this << a << b);
502  // by default returns 1 - PLOS
503  return (1 - ComputePlos(a, b));
504 }
505 
506 int64_t
508 {
509  m_uniformVar->SetStream(stream);
510  m_uniformVarO2i->SetStream(stream + 1);
512 
513  return 3;
514 }
515 
516 double
517 ThreeGppChannelConditionModel::Calculate2dDistance(const Vector& a, const Vector& b)
518 {
519  double x = a.x - b.x;
520  double y = a.y - b.y;
521  double distance2D = sqrt(x * x + y * y);
522 
523  return distance2D;
524 }
525 
526 uint32_t
528 {
529  // use the nodes ids to obtain a unique key for the channel between a and b
530  // sort the nodes ids so that the key is reciprocal
531  uint32_t x1 = std::min(a->GetObject<Node>()->GetId(), b->GetObject<Node>()->GetId());
532  uint32_t x2 = std::max(a->GetObject<Node>()->GetId(), b->GetObject<Node>()->GetId());
533 
534  // use the cantor function to obtain the key
535  uint32_t key = (((x1 + x2) * (x1 + x2 + 1)) / 2) + x2;
536 
537  return key;
538 }
539 
540 // ------------------------------------------------------------------------- //
541 
543 
544 TypeId
546 {
547  static TypeId tid = TypeId("ns3::ThreeGppRmaChannelConditionModel")
549  .SetGroupName("Propagation")
550  .AddConstructor<ThreeGppRmaChannelConditionModel>();
551  return tid;
552 }
553 
556 {
557 }
558 
560 {
561 }
562 
563 double
565  Ptr<const MobilityModel> b) const
566 {
567  // compute the 2D distance between a and b
568  double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
569 
570  // NOTE: no indication is given about the heights of the BS and the UT used
571  // to derive the LOS probability
572 
573  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
574  double pLos = 0.0;
575  if (distance2D <= 10.0)
576  {
577  pLos = 1.0;
578  }
579  else
580  {
581  pLos = exp(-(distance2D - 10.0) / 1000.0);
582  }
583 
584  return pLos;
585 }
586 
587 // ------------------------------------------------------------------------- //
588 
590 
591 TypeId
593 {
594  static TypeId tid = TypeId("ns3::ThreeGppUmaChannelConditionModel")
596  .SetGroupName("Propagation")
597  .AddConstructor<ThreeGppUmaChannelConditionModel>();
598  return tid;
599 }
600 
603 {
604 }
605 
607 {
608 }
609 
610 double
612  Ptr<const MobilityModel> b) const
613 {
614  // compute the 2D distance between a and b
615  double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
616 
617  // retrieve h_UT, it should be smaller than 23 m
618  double h_UT = std::min(a->GetPosition().z, b->GetPosition().z);
619  if (h_UT > 23.0)
620  {
621  NS_LOG_WARN(
622  "The height of the UT should be smaller than 23 m (see TR 38.901, Table 7.4.2-1)");
623  }
624 
625  // retrieve h_BS, it should be equal to 25 m
626  double h_BS = std::max(a->GetPosition().z, b->GetPosition().z);
627  if (h_BS != 25.0)
628  {
629  NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 25 m (see TR "
630  "38.901, Table 7.4.2-1)");
631  }
632 
633  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
634  double pLos = 0.0;
635  if (distance2D <= 18.0)
636  {
637  pLos = 1.0;
638  }
639  else
640  {
641  // compute C'(h_UT)
642  double c = 0.0;
643  if (h_UT <= 13.0)
644  {
645  c = 0;
646  }
647  else
648  {
649  c = pow((h_UT - 13.0) / 10.0, 1.5);
650  }
651 
652  pLos = (18.0 / distance2D + exp(-distance2D / 63.0) * (1.0 - 18.0 / distance2D)) *
653  (1.0 + c * 5.0 / 4.0 * pow(distance2D / 100.0, 3.0) * exp(-distance2D / 150.0));
654  }
655 
656  return pLos;
657 }
658 
659 // ------------------------------------------------------------------------- //
660 
662 
663 TypeId
665 {
666  static TypeId tid = TypeId("ns3::ThreeGppUmiStreetCanyonChannelConditionModel")
668  .SetGroupName("Propagation")
670  return tid;
671 }
672 
675 {
676 }
677 
679 {
680 }
681 
682 double
684  Ptr<const MobilityModel> b) const
685 {
686  // compute the 2D distance between a and b
687  double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
688 
689  // NOTE: no indication is given about the UT height used to derive the
690  // LOS probability
691 
692  // h_BS should be equal to 10 m. We check if at least one of the two
693  // nodes has height equal to 10 m
694  if (a->GetPosition().z != 10.0 && b->GetPosition().z != 10.0)
695  {
696  NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 10 m (see TR "
697  "38.901, Table 7.4.2-1)");
698  }
699 
700  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
701  double pLos = 0.0;
702  if (distance2D <= 18.0)
703  {
704  pLos = 1.0;
705  }
706  else
707  {
708  pLos = 18.0 / distance2D + exp(-distance2D / 36.0) * (1.0 - 18.0 / distance2D);
709  }
710 
711  return pLos;
712 }
713 
714 // ------------------------------------------------------------------------- //
715 
717 
718 TypeId
720 {
721  static TypeId tid = TypeId("ns3::ThreeGppIndoorMixedOfficeChannelConditionModel")
723  .SetGroupName("Propagation")
725  return tid;
726 }
727 
730 {
731 }
732 
734 {
735 }
736 
737 double
739  Ptr<const MobilityModel> b) const
740 {
741  // compute the 2D distance between a and b
742  double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
743 
744  // NOTE: no indication is given about the UT height used to derive the
745  // LOS probability
746 
747  // retrieve h_BS, it should be equal to 3 m
748  double h_BS = std::max(a->GetPosition().z, b->GetPosition().z);
749  if (h_BS != 3.0)
750  {
751  NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 3 m (see TR "
752  "38.901, Table 7.4.2-1)");
753  }
754 
755  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
756  double pLos = 0.0;
757  if (distance2D <= 1.2)
758  {
759  pLos = 1.0;
760  }
761  else if (distance2D > 1.2 && distance2D < 6.5)
762  {
763  pLos = exp(-(distance2D - 1.2) / 4.7);
764  }
765  else
766  {
767  pLos = exp(-(distance2D - 6.5) / 32.6) * 0.32;
768  }
769 
770  return pLos;
771 }
772 
773 // ------------------------------------------------------------------------- //
774 
776 
777 TypeId
779 {
780  static TypeId tid = TypeId("ns3::ThreeGppIndoorOpenOfficeChannelConditionModel")
782  .SetGroupName("Propagation")
784  return tid;
785 }
786 
789 {
790 }
791 
793 {
794 }
795 
796 double
798  Ptr<const MobilityModel> b) const
799 {
800  // compute the 2D distance between a and b
801  double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
802 
803  // NOTE: no indication is given about the UT height used to derive the
804  // LOS probability
805 
806  // retrieve h_BS, it should be equal to 3 m
807  double h_BS = std::max(a->GetPosition().z, b->GetPosition().z);
808  if (h_BS != 3.0)
809  {
810  NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 3 m (see TR "
811  "38.901, Table 7.4.2-1)");
812  }
813 
814  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
815  double pLos = 0.0;
816  if (distance2D <= 5.0)
817  {
818  pLos = 1.0;
819  }
820  else if (distance2D > 5.0 && distance2D <= 49.0)
821  {
822  pLos = exp(-(distance2D - 5.0) / 70.8);
823  }
824  else
825  {
826  pLos = exp(-(distance2D - 49.0) / 211.7) * 0.54;
827  }
828 
829  return pLos;
830 }
831 
832 } // end namespace ns3
#define min(a, b)
Definition: 80211b.c:41
#define max(a, b)
Definition: 80211b.c:42
Models an always in-LoS condition model.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
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.
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...
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.
@ O2O
Outdoor to Outdoor.
O2iLowHighConditionValue
Possible values for Low-High Penetration Loss condition.
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.
Models the channel condition.
static TypeId GetTypeId()
Get the type ID.
ChannelConditionModel()
Constructor for the ChannelConditionModel class.
~ChannelConditionModel() override
Destructor for the ChannelConditionModel class.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
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.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
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.
A network Node.
Definition: node.h:57
uint32_t GetId() const
Definition: node.cc:117
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:204
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
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
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....
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
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 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...
bool IsZero() const
Exactly equivalent to t == 0.
Definition: nstime.h:315
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
double GetValue(double min, double max)
Get the next random value drawn from the distribution.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:261
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition: boolean.cc:124
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1414
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition: boolean.h:86
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Definition: double.h:43
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159
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