A Discrete-Event Network Simulator
API
channel-condition-model.cc
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 
21 #include "ns3/log.h"
22 #include "ns3/double.h"
23 #include "ns3/mobility-model.h"
24 #include <cmath>
25 #include "ns3/node.h"
26 #include "ns3/simulator.h"
27 #include "ns3/string.h"
28 
29 namespace ns3 {
30 
31 NS_LOG_COMPONENT_DEFINE ("ChannelConditionModel");
32 
33 NS_OBJECT_ENSURE_REGISTERED (ChannelCondition);
34 
35 TypeId
37 {
38  static TypeId tid = TypeId ("ns3::ChannelCondition")
39  .SetParent<Object> ()
40  .SetGroupName ("Propagation")
41  ;
42  return tid;
43 }
44 
46  : m_losCondition (LosConditionValue::LC_ND),
47  m_o2iCondition (O2iConditionValue::O2I_ND)
48 {}
49 
51 {
52  m_losCondition = losCondition;
53  m_o2iCondition = o2iCondition;
54 }
55 
57 {}
58 
61 {
62  return m_losCondition;
63 }
64 
65 void
67 {
68  m_losCondition = cond;
69 }
70 
73 {
74  return m_o2iCondition;
75 }
76 
77 void
79 {
80  m_o2iCondition = o2iCondition;
81 }
82 
83 bool
85 {
87 }
88 
89 bool
91 {
93 }
94 
95 bool
97 {
99 }
100 
101 bool
103 {
105 }
106 
107 bool
109 {
111 }
112 
113 bool
115 {
117 }
118 
119 bool
121 {
122  return (m_o2iCondition == otherCondition->GetO2iCondition ()
123  && m_losCondition == otherCondition->GetLosCondition ());
124 }
125 
126 std::ostream& operator<< (std::ostream& os, ChannelCondition::LosConditionValue cond)
127 {
128  if (cond == ChannelCondition::LosConditionValue::LOS)
129  {
130  os << "LOS";
131  }
132  else if (cond == ChannelCondition::LosConditionValue::NLOS)
133  {
134  os << "NLOS";
135  }
136  else if (cond == ChannelCondition::LosConditionValue::NLOSv)
137  {
138  os << "NLOSv";
139  }
140 
141  return os;
142 }
143 // ------------------------------------------------------------------------- //
144 
145 NS_OBJECT_ENSURE_REGISTERED (ChannelConditionModel);
146 
147 TypeId
149 {
150  static TypeId tid = TypeId ("ns3::ChannelConditionModel")
151  .SetParent<Object> ()
152  .SetGroupName ("Propagation")
153  ;
154  return tid;
155 }
156 
158 {}
159 
161 {}
162 
163 // ------------------------------------------------------------------------- //
164 
166 
167 TypeId
169 {
170  static TypeId tid = TypeId ("ns3::AlwaysLosChannelConditionModel")
171  .SetParent<Object> ()
172  .SetGroupName ("Propagation")
173  .AddConstructor<AlwaysLosChannelConditionModel> ()
174  ;
175  return tid;
176 }
177 
179 {}
180 
182 {}
183 
186  Ptr<const MobilityModel> b) const
187 {
188  NS_UNUSED (a);
189  NS_UNUSED (b);
190 
191  Ptr<ChannelCondition> c = CreateObject<ChannelCondition> (ChannelCondition::LOS);
192 
193  return c;
194 }
195 
196 int64_t
198 {
199  return 0;
200 }
201 
202 // ------------------------------------------------------------------------- //
203 
205 
206 TypeId
208 {
209  static TypeId tid = TypeId ("ns3::NeverLosChannelConditionModel")
210  .SetParent<Object> ()
211  .SetGroupName ("Propagation")
212  .AddConstructor<NeverLosChannelConditionModel> ()
213  ;
214  return tid;
215 }
216 
218 {}
219 
221 {}
222 
225  Ptr<const MobilityModel> b) const
226 {
227  NS_UNUSED (a);
228  NS_UNUSED (b);
229 
230  Ptr<ChannelCondition> c = CreateObject<ChannelCondition> (ChannelCondition::NLOS);
231 
232  return c;
233 }
234 
235 int64_t
237 {
238  return 0;
239 }
240 
241 // ------------------------------------------------------------------------- //
242 
244 
245 TypeId
247 {
248  static TypeId tid = TypeId ("ns3::NeverLosVehicleChannelConditionModel")
250  .SetGroupName ("Propagation")
251  .AddConstructor<NeverLosVehicleChannelConditionModel> ()
252  ;
253  return tid;
254 }
255 
257 {}
258 
260 {}
261 
264  Ptr<const MobilityModel> /* b */) const
265 {
266 
267  Ptr<ChannelCondition> c = CreateObject<ChannelCondition> (ChannelCondition::NLOSv);
268 
269  return c;
270 }
271 
272 int64_t
274 {
275  return 0;
276 }
277 
278 // ------------------------------------------------------------------------- //
279 
281 
282 TypeId
284 {
285  static TypeId tid = TypeId ("ns3::ThreeGppChannelConditionModel")
287  .SetGroupName ("Propagation")
288  .AddAttribute ("UpdatePeriod", "Specifies the time period after which the channel condition is recomputed. If set to 0, the channel condition is never updated.",
289  TimeValue (MilliSeconds (0)),
291  MakeTimeChecker ())
292  ;
293  return tid;
294 }
295 
298 {
299  m_uniformVar = CreateObject<UniformRandomVariable> ();
300  m_uniformVar->SetAttribute ("Min", DoubleValue (0));
301  m_uniformVar->SetAttribute ("Max", DoubleValue (1));
302 }
303 
305 {}
306 
308 {
309  m_channelConditionMap.clear ();
310  m_updatePeriod = Seconds (0.0);
311 }
312 
315  Ptr<const MobilityModel> b) const
316 {
318 
319  // get the key for this channel
320  uint32_t key = GetKey (a, b);
321 
322  bool notFound = false; // indicates if the channel condition is not present in the map
323  bool update = false; // indicates if the channel condition has to be updated
324 
325  // look for the channel condition in m_channelConditionMap
326  auto mapItem = m_channelConditionMap.find (key);
327  if (mapItem != m_channelConditionMap.end ())
328  {
329  NS_LOG_DEBUG ("found the channel condition in the map");
330  cond = mapItem->second.m_condition;
331 
332  // check if it has to be updated
333  if (!m_updatePeriod.IsZero () && Simulator::Now () - mapItem->second.m_generatedTime > m_updatePeriod)
334  {
335  NS_LOG_DEBUG ("it has to be updated");
336  update = true;
337  }
338  }
339  else
340  {
341  NS_LOG_DEBUG ("channel condition not found");
342  notFound = true;
343  }
344 
345  // if the channel condition was not found or if it has to be updated
346  // generate a new channel condition
347  if (notFound || update)
348  {
349  cond = ComputeChannelCondition (a, b);
350  // store the channel condition in m_channelConditionMap, used as cache.
351  // For this reason you see a const_cast.
352  Item mapItem;
353  mapItem.m_condition = cond;
354  mapItem.m_generatedTime = Simulator::Now ();
355  const_cast<ThreeGppChannelConditionModel*> (this)->m_channelConditionMap [key] = mapItem;
356  }
357 
358  return cond;
359 }
360 
363  Ptr<const MobilityModel> b) const
364 {
365  NS_LOG_FUNCTION (this << a << b);
366  Ptr<ChannelCondition> cond = CreateObject<ChannelCondition> ();
367 
368  // compute the LOS probability
369  double pLos = ComputePlos (a, b);
370  double pNlos = ComputePnlos (a, b);
371 
372  // draw a random value
373  double pRef = m_uniformVar->GetValue ();
374 
375  NS_LOG_DEBUG ("pRef " << pRef << " pLos " << pLos << " pNlos " << pNlos);
376 
377  // get the channel condition
378  if (pRef <= pLos)
379  {
380  // LOS
381  cond->SetLosCondition (ChannelCondition::LosConditionValue::LOS);
382  }
383  else if (pRef <= pLos + pNlos)
384  {
385  // NLOS
386  cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOS);
387  }
388  else
389  {
390  // NLOSv (added to support vehicular scenarios)
391  cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOSv);
392  }
393 
394  return cond;
395 }
396 
397 double
399  Ptr<const MobilityModel> b) const
400 {
401  NS_LOG_FUNCTION (this << a << b);
402  // by default returns 1 - PLOS
403  return (1 - ComputePlos (a, b));
404 }
405 
406 int64_t
408 {
409  m_uniformVar->SetStream (stream);
410  return 1;
411 }
412 
413 double
414 ThreeGppChannelConditionModel::Calculate2dDistance (const Vector &a, const Vector &b)
415 {
416  double x = a.x - b.x;
417  double y = a.y - b.y;
418  double distance2D = sqrt (x * x + y * y);
419 
420  return distance2D;
421 }
422 
423 uint32_t
425 {
426  // use the nodes ids to obtain a unique key for the channel between a and b
427  // sort the nodes ids so that the key is reciprocal
428  uint32_t x1 = std::min (a->GetObject<Node> ()->GetId (), b->GetObject<Node> ()->GetId ());
429  uint32_t x2 = std::max (a->GetObject<Node> ()->GetId (), b->GetObject<Node> ()->GetId ());
430 
431  // use the cantor function to obtain the key
432  uint32_t key = (((x1 + x2) * (x1 + x2 + 1)) / 2) + x2;
433 
434  return key;
435 }
436 
437 // ------------------------------------------------------------------------- //
438 
440 
441 TypeId
443 {
444  static TypeId tid = TypeId ("ns3::ThreeGppRmaChannelConditionModel")
446  .SetGroupName ("Propagation")
447  .AddConstructor<ThreeGppRmaChannelConditionModel> ()
448  ;
449  return tid;
450 }
451 
454 {}
455 
457 {}
458 
459 double
461  Ptr<const MobilityModel> b) const
462 {
463  // compute the 2D distance between a and b
464  double distance2D = Calculate2dDistance (a->GetPosition (), b->GetPosition ());
465 
466  // NOTE: no indication is given about the heights of the BS and the UT used
467  // to derive the LOS probability
468 
469  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
470  double pLos = 0.0;
471  if (distance2D <= 10.0)
472  {
473  pLos = 1.0;
474  }
475  else
476  {
477  pLos = exp (-(distance2D - 10.0) / 1000.0);
478  }
479 
480  return pLos;
481 }
482 
483 // ------------------------------------------------------------------------- //
484 
486 
487 TypeId
489 {
490  static TypeId tid = TypeId ("ns3::ThreeGppUmaChannelConditionModel")
492  .SetGroupName ("Propagation")
493  .AddConstructor<ThreeGppUmaChannelConditionModel> ()
494  ;
495  return tid;
496 }
497 
500 {}
501 
503 {}
504 
505 double
507  Ptr<const MobilityModel> b) const
508 {
509  // compute the 2D distance between a and b
510  double distance2D = Calculate2dDistance (a->GetPosition (), b->GetPosition ());
511 
512  // retrieve h_UT, it should be smaller than 23 m
513  double h_UT = std::min (a->GetPosition ().z, b->GetPosition ().z);
514  if (h_UT > 23.0)
515  {
516  NS_LOG_WARN ("The height of the UT should be smaller than 23 m (see TR 38.901, Table 7.4.2-1)");
517  }
518 
519  // retrieve h_BS, it should be equal to 25 m
520  double h_BS = std::max (a->GetPosition ().z, b->GetPosition ().z);
521  if (h_BS != 25.0)
522  {
523  NS_LOG_WARN ("The LOS probability was derived assuming BS antenna heights of 25 m (see TR 38.901, Table 7.4.2-1)");
524  }
525 
526  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
527  double pLos = 0.0;
528  if (distance2D <= 18.0)
529  {
530  pLos = 1.0;
531  }
532  else
533  {
534  // compute C'(h_UT)
535  double c = 0.0;
536  if (h_UT <= 13.0)
537  {
538  c = 0;
539  }
540  else
541  {
542  c = pow ((h_UT - 13.0) / 10.0, 1.5);
543  }
544 
545  pLos = (18.0 / distance2D + exp (-distance2D / 63.0) * (1.0 - 18.0 / distance2D)) * (1.0 + c * 5.0 / 4.0 * pow (distance2D / 100.0, 3.0) * exp (-distance2D / 150.0));
546  }
547 
548  return pLos;
549 }
550 
551 // ------------------------------------------------------------------------- //
552 
554 
555 TypeId
557 {
558  static TypeId tid = TypeId ("ns3::ThreeGppUmiStreetCanyonChannelConditionModel")
560  .SetGroupName ("Propagation")
562  ;
563  return tid;
564 }
565 
568 {}
569 
571 {}
572 
573 double
575  Ptr<const MobilityModel> b) const
576 {
577  // compute the 2D distance between a and b
578  double distance2D = Calculate2dDistance (a->GetPosition (), b->GetPosition ());
579 
580  // NOTE: no idication is given about the UT height used to derive the
581  // LOS probability
582 
583  // h_BS should be equal to 10 m. We check if at least one of the two
584  // nodes has height equal to 10 m
585  if (a->GetPosition ().z != 10.0 && b->GetPosition ().z != 10.0)
586  {
587  NS_LOG_WARN ("The LOS probability was derived assuming BS antenna heights of 10 m (see TR 38.901, Table 7.4.2-1)");
588  }
589 
590  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
591  double pLos = 0.0;
592  if (distance2D <= 18.0)
593  {
594  pLos = 1.0;
595  }
596  else
597  {
598  pLos = 18.0 / distance2D + exp (-distance2D / 36.0) * (1.0 - 18.0 / distance2D);
599  }
600 
601  return pLos;
602 }
603 
604 // ------------------------------------------------------------------------- //
605 
607 
608 TypeId
610 {
611  static TypeId tid = TypeId ("ns3::ThreeGppIndoorMixedOfficeChannelConditionModel")
613  .SetGroupName ("Propagation")
615  ;
616  return tid;
617 }
618 
621 {}
622 
624 {}
625 
626 double
628  Ptr<const MobilityModel> b) const
629 {
630  // compute the 2D distance between a and b
631  double distance2D = Calculate2dDistance (a->GetPosition (), b->GetPosition ());
632 
633  // NOTE: no idication is given about the UT height used to derive the
634  // LOS probability
635 
636  // retrieve h_BS, it should be equal to 3 m
637  double h_BS = std::max (a->GetPosition ().z, b->GetPosition ().z);
638  if (h_BS != 3.0)
639  {
640  NS_LOG_WARN ("The LOS probability was derived assuming BS antenna heights of 3 m (see TR 38.901, Table 7.4.2-1)");
641  }
642 
643  // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
644  double pLos = 0.0;
645  if (distance2D <= 1.2)
646  {
647  pLos = 1.0;
648  }
649  else if (distance2D > 1.2 && distance2D < 6.5)
650  {
651  pLos = exp (-(distance2D - 1.2) / 4.7);
652  }
653  else
654  {
655  pLos = exp (-(distance2D - 6.5) / 32.6) * 0.32;
656  }
657 
658  return pLos;
659 }
660 
661 // ------------------------------------------------------------------------- //
662 
664 
665 TypeId
667 {
668  static TypeId tid = TypeId ("ns3::ThreeGppIndoorOpenOfficeChannelConditionModel")
670  .SetGroupName ("Propagation")
672  ;
673  return tid;
674 }
675 
678 {}
679 
681 {}
682 
683 double
685  Ptr<const MobilityModel> b) const
686 {
687  // compute the 2D distance between a and b
688  double distance2D = Calculate2dDistance (a->GetPosition (), b->GetPosition ());
689 
690  // NOTE: no idication is given about the UT height used to derive the
691  // LOS probability
692 
693  // retrieve h_BS, it should be equal to 3 m
694  double h_BS = std::max (a->GetPosition ().z, b->GetPosition ().z);
695  if (h_BS != 3.0)
696  {
697  NS_LOG_WARN ("The LOS probability was derived assuming BS antenna heights of 3 m (see TR 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 <= 5.0)
703  {
704  pLos = 1.0;
705  }
706  else if (distance2D > 5.0 && distance2D <= 49.0)
707  {
708  pLos = exp (-(distance2D - 5.0) / 70.8);
709  }
710  else
711  {
712  pLos = exp (-(distance2D - 49.0) / 211.7) * 0.54;
713  }
714 
715  return pLos;
716 }
717 
718 } // end namespace ns3
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
Compute the LOS probability.
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
bool IsO2i() const
Return true if the channel is outdoor-to-indoor.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
Models the channel condition.
uint32_t GetId(void) const
Definition: node.cc:109
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
virtual ~ThreeGppIndoorOpenOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
LosConditionValue m_losCondition
contains the information about the LOS state of the channel
#define min(a, b)
Definition: 80211b.c:42
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.
void SetO2iCondition(O2iConditionValue o2iCondition)
Set the O2iConditionValue contaning the information about the O2I state of the channel.
static TypeId GetTypeId(void)
Get the type ID.
bool IsLos() const
Return true if the channel condition is LOS.
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.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1297
std::unordered_map< uint32_t, Item > m_channelConditionMap
map to store the channel conditions
virtual ~ChannelConditionModel()
Destructor for the ChannelConditionModel class.
#define NS_UNUSED(x)
Mark a local variable as unused.
Definition: unused.h:36
bool IsNlosv() const
Return true if the channel condition is NLOSv.
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.
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.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
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...
#define max(a, b)
Definition: 80211b.c:43
bool IsZero(void) const
Exactly equivalent to t == 0.
Definition: nstime.h:301
virtual ~ThreeGppUmiStreetCanyonChannelConditionModel() override
Destructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
AttributeValue implementation for Time.
Definition: nstime.h:1353
Ptr< ChannelCondition > m_condition
the channel condition
static TypeId GetTypeId(void)
Get the type ID.
ThreeGppIndoorMixedOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
Base class for the 3GPP channel condition models.
bool IsNlos() const
Return true if the channel condition is NLOS.
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.
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.
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
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.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: nstime.h:1354
static TypeId GetTypeId(void)
Get the type ID.
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Compute the NLOS probability.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
bool IsEqual(Ptr< const ChannelCondition > otherCondition) const
Return true if this instance is equivalent to the one passed as argument.
ChannelConditionModel()
Constructor for the ChannelConditionModel class.
Time m_updatePeriod
the update period for the channel condition
ThreeGppRmaChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
O2iConditionValue
Possible values for Outdoor to Indoor condition.
virtual ~NeverLosChannelConditionModel()
Destructor.
void SetLosCondition(LosConditionValue losCondition)
Set the LosConditionValue with the information about the LOS/NLOS state of the channel.
Models a never in-LoS condition model.
virtual ~ThreeGppChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
virtual ~ThreeGppUmaChannelConditionModel() override
Destructor for the ThreeGppUmaChannelConditionModel class.
static TypeId GetTypeId(void)
Get the type ID.
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...
Time m_generatedTime
the time when the condition was generated
A network Node.
Definition: node.h:56
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
bool IsO2o() const
Return true if the channel is outdoor-to-outdoor.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
Models a never in-LoS condition model caused by a blocking vehicle.
O2iConditionValue m_o2iCondition
contains the information about the O2I state of the channel
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
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 NLOSv. ...
O2iConditionValue GetO2iCondition() const
Get the O2iConditionValue contaning the information about the O2I state of the channel.
Models an always in-LoS condition model.
A base class which provides memory management and object aggregation.
Definition: object.h:87
bool IsI2i() const
Return true if the channel is indoor-to-indoor.
LosConditionValue
Possible values for Line-of-Sight condition.
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
ChannelCondition()
Constructor for the ChannelCondition class.
Computes the channel condition for the UMi-Street canyon scenario.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Non Line of Sight due to a vehicle.
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 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...