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
ns3::ChannelCondition::IsLos
bool IsLos() const
Return true if the channel condition is LOS.
Definition: channel-condition-model.cc:84
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::NeverLosVehicleChannelConditionModel::~NeverLosVehicleChannelConditionModel
virtual ~NeverLosVehicleChannelConditionModel()
Destructor.
Definition: channel-condition-model.cc:259
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
ns3::AlwaysLosChannelConditionModel::AlwaysLosChannelConditionModel
AlwaysLosChannelConditionModel()
Constructor.
Definition: channel-condition-model.cc:178
ns3::MakeTimeChecker
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
ns3::AlwaysLosChannelConditionModel::~AlwaysLosChannelConditionModel
virtual ~AlwaysLosChannelConditionModel()
Destructor.
Definition: channel-condition-model.cc:181
min
#define min(a, b)
Definition: 80211b.c:42
ns3::ChannelCondition::m_losCondition
LosConditionValue m_losCondition
contains the information about the LOS state of the channel
Definition: channel-condition-model.h:178
ns3::AlwaysLosChannelConditionModel
Models an always in-LoS condition model.
Definition: channel-condition-model.h:263
ns3::Node::GetId
uint32_t GetId(void) const
Definition: node.cc:109
ns3::ThreeGppChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:283
ns3::AlwaysLosChannelConditionModel::AssignStreams
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Definition: channel-condition-model.cc:197
ns3::Simulator::Now
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ChannelCondition::IsO2o
bool IsO2o() const
Return true if the channel is outdoor-to-outdoor.
Definition: channel-condition-model.cc:108
ns3::ThreeGppChannelConditionModel::m_updatePeriod
Time m_updatePeriod
the update period for the channel condition
Definition: channel-condition-model.h:561
ns3::ChannelConditionModel::ChannelConditionModel
ChannelConditionModel()
Constructor for the ChannelConditionModel class.
Definition: channel-condition-model.cc:157
ns3::ChannelCondition::IsNlosv
bool IsNlosv() const
Return true if the channel condition is NLOSv.
Definition: channel-condition-model.cc:96
ns3::ThreeGppChannelConditionModel::ComputePnlos
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Compute the NLOS probability.
Definition: channel-condition-model.cc:398
ns3::ThreeGppUmiStreetCanyonChannelConditionModel::ComputePlos
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...
Definition: channel-condition-model.cc:574
ns3::NeverLosVehicleChannelConditionModel::AssignStreams
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Definition: channel-condition-model.cc:273
ns3::ThreeGppChannelConditionModel::DoDispose
virtual void DoDispose() override
Destructor implementation.
Definition: channel-condition-model.cc:307
ns3::ChannelCondition::O2O
@ O2O
Outdoor to Outdoor.
Definition: channel-condition-model.h:61
ns3::ThreeGppIndoorOpenOfficeChannelConditionModel::ComputePlos
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...
Definition: channel-condition-model.cc:684
ns3::ThreeGppIndoorMixedOfficeChannelConditionModel
Computes the channel condition for the Indoor Mixed Office scenario.
Definition: channel-condition-model.h:693
ns3::ThreeGppRmaChannelConditionModel
Computes the channel condition for the RMa scenario.
Definition: channel-condition-model.h:573
ns3::ThreeGppUmaChannelConditionModel
Computes the channel condition for the UMa scenario.
Definition: channel-condition-model.h:613
ns3::Node
A network Node.
Definition: node.h:57
NS_LOG_WARN
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
ns3::ThreeGppChannelConditionModel::ComputeChannelCondition
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...
Definition: channel-condition-model.cc:362
ns3::ThreeGppIndoorMixedOfficeChannelConditionModel::ThreeGppIndoorMixedOfficeChannelConditionModel
ThreeGppIndoorMixedOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
Definition: channel-condition-model.cc:619
ns3::ChannelCondition::m_o2iCondition
O2iConditionValue m_o2iCondition
contains the information about the O2I state of the channel
Definition: channel-condition-model.h:179
ns3::ChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:148
ns3::ObjectBase::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
ns3::ThreeGppChannelConditionModel::GetChannelCondition
virtual Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Retrieve the condition of the channel between a and b.
Definition: channel-condition-model.cc:314
ns3::ChannelCondition::LosConditionValue
LosConditionValue
Possible values for Line-of-Sight condition.
Definition: channel-condition-model.h:49
ns3::ChannelCondition::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:36
ns3::ChannelCondition::LOS
@ LOS
Line of Sight.
Definition: channel-condition-model.h:50
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::ChannelCondition::ChannelCondition
ChannelCondition()
Constructor for the ChannelCondition class.
Definition: channel-condition-model.cc:45
ns3::ChannelCondition::O2I
@ O2I
Outdoor to Indoor.
Definition: channel-condition-model.h:62
ns3::DoubleValue
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
ns3::ThreeGppUmaChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:488
ns3::ChannelCondition::I2I
@ I2I
Indoor to Indoor.
Definition: channel-condition-model.h:63
ns3::ChannelCondition::SetLosCondition
void SetLosCondition(LosConditionValue losCondition)
Set the LosConditionValue with the information about the LOS/NLOS state of the channel.
Definition: channel-condition-model.cc:66
ns3::ChannelCondition::IsO2i
bool IsO2i() const
Return true if the channel is outdoor-to-indoor.
Definition: channel-condition-model.cc:102
ns3::ChannelConditionModel::~ChannelConditionModel
virtual ~ChannelConditionModel()
Destructor for the ChannelConditionModel class.
Definition: channel-condition-model.cc:160
ns3::ChannelCondition::IsI2i
bool IsI2i() const
Return true if the channel is indoor-to-indoor.
Definition: channel-condition-model.cc:114
ns3::NeverLosChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:207
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::ThreeGppChannelConditionModel::Item::m_generatedTime
Time m_generatedTime
the time when the condition was generated
Definition: channel-condition-model.h:557
ns3::ThreeGppChannelConditionModel::ComputePlos
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
Compute the LOS probability.
ns3::NeverLosChannelConditionModel::GetChannelCondition
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.
Definition: channel-condition-model.cc:224
ns3::ThreeGppUmiStreetCanyonChannelConditionModel::~ThreeGppUmiStreetCanyonChannelConditionModel
virtual ~ThreeGppUmiStreetCanyonChannelConditionModel() override
Destructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
Definition: channel-condition-model.cc:570
max
#define max(a, b)
Definition: 80211b.c:43
ns3::ThreeGppIndoorOpenOfficeChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:666
ns3::ThreeGppChannelConditionModel::Item::m_condition
Ptr< ChannelCondition > m_condition
the channel condition
Definition: channel-condition-model.h:556
ns3::ThreeGppRmaChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:442
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::Time::IsZero
bool IsZero(void) const
Exactly equivalent to t == 0.
Definition: nstime.h:301
ns3::ThreeGppUmaChannelConditionModel::~ThreeGppUmaChannelConditionModel
virtual ~ThreeGppUmaChannelConditionModel() override
Destructor for the ThreeGppUmaChannelConditionModel class.
Definition: channel-condition-model.cc:502
ns3::NeverLosVehicleChannelConditionModel::NeverLosVehicleChannelConditionModel
NeverLosVehicleChannelConditionModel()
Constructor.
Definition: channel-condition-model.cc:256
ns3::ChannelCondition::GetLosCondition
LosConditionValue GetLosCondition() const
Get the LosConditionValue contaning the information about the LOS/NLOS state of the channel.
Definition: channel-condition-model.cc:60
ns3::ChannelCondition::SetO2iCondition
void SetO2iCondition(O2iConditionValue o2iCondition)
Set the O2iConditionValue contaning the information about the O2I state of the channel.
Definition: channel-condition-model.cc:78
ns3::MilliSeconds
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1297
NS_UNUSED
#define NS_UNUSED(x)
Mark a local variable as unused.
Definition: unused.h:36
ns3::AlwaysLosChannelConditionModel::GetChannelCondition
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.
Definition: channel-condition-model.cc:185
ns3::ThreeGppChannelConditionModel::AssignStreams
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Definition: channel-condition-model.cc:407
ns3::ThreeGppIndoorOpenOfficeChannelConditionModel::ThreeGppIndoorOpenOfficeChannelConditionModel
ThreeGppIndoorOpenOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
Definition: channel-condition-model.cc:676
ns3::ThreeGppUmaChannelConditionModel::ComputePlos
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.
Definition: channel-condition-model.cc:506
ns3::ThreeGppChannelConditionModel::GetKey
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.
Definition: channel-condition-model.cc:424
ns3::ThreeGppRmaChannelConditionModel::~ThreeGppRmaChannelConditionModel
virtual ~ThreeGppRmaChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
Definition: channel-condition-model.cc:456
channel-condition-model.h
ns3::ThreeGppUmiStreetCanyonChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:556
ns3::ThreeGppIndoorMixedOfficeChannelConditionModel::~ThreeGppIndoorMixedOfficeChannelConditionModel
virtual ~ThreeGppIndoorMixedOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
Definition: channel-condition-model.cc:623
ns3::ThreeGppChannelConditionModel::~ThreeGppChannelConditionModel
virtual ~ThreeGppChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
Definition: channel-condition-model.cc:304
ns3::ChannelCondition::GetO2iCondition
O2iConditionValue GetO2iCondition() const
Get the O2iConditionValue contaning the information about the O2I state of the channel.
Definition: channel-condition-model.cc:72
ns3::ChannelCondition::IsNlos
bool IsNlos() const
Return true if the channel condition is NLOS.
Definition: channel-condition-model.cc:90
ns3::ThreeGppRmaChannelConditionModel::ComputePlos
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.
Definition: channel-condition-model.cc:460
ns3::ThreeGppIndoorOpenOfficeChannelConditionModel
Computes the channel condition for the Indoor Open Office scenario.
Definition: channel-condition-model.h:733
ns3::ThreeGppChannelConditionModel::m_channelConditionMap
std::unordered_map< uint32_t, Item > m_channelConditionMap
map to store the channel conditions
Definition: channel-condition-model.h:560
ns3::ChannelCondition::IsEqual
bool IsEqual(Ptr< const ChannelCondition > otherCondition) const
Return true if this instance is equivalent to the one passed as argument.
Definition: channel-condition-model.cc:120
ns3::ChannelCondition::NLOS
@ NLOS
Non Line of Sight.
Definition: channel-condition-model.h:51
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::NeverLosChannelConditionModel::~NeverLosChannelConditionModel
virtual ~NeverLosChannelConditionModel()
Destructor.
Definition: channel-condition-model.cc:220
ns3::ChannelCondition::NLOSv
@ NLOSv
Non Line of Sight due to a vehicle.
Definition: channel-condition-model.h:52
ns3::ChannelConditionModel
Models the channel condition.
Definition: channel-condition-model.h:201
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::ThreeGppIndoorMixedOfficeChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:609
ns3::AlwaysLosChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:168
ns3::NeverLosVehicleChannelConditionModel::GetChannelCondition
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.
Definition: channel-condition-model.cc:263
ns3::TimeValue
AttributeValue implementation for Time.
Definition: nstime.h:1353
sample-rng-plot.x
list x
Definition: sample-rng-plot.py:34
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::ThreeGppChannelConditionModel::ThreeGppChannelConditionModel
ThreeGppChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
Definition: channel-condition-model.cc:296
ns3::ThreeGppIndoorOpenOfficeChannelConditionModel::~ThreeGppIndoorOpenOfficeChannelConditionModel
virtual ~ThreeGppIndoorOpenOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
Definition: channel-condition-model.cc:680
ns3::ChannelCondition::O2iConditionValue
O2iConditionValue
Possible values for Outdoor to Indoor condition.
Definition: channel-condition-model.h:60
ns3::NeverLosChannelConditionModel::NeverLosChannelConditionModel
NeverLosChannelConditionModel()
Constructor.
Definition: channel-condition-model.cc:217
ns3::NeverLosVehicleChannelConditionModel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: channel-condition-model.cc:246
ns3::NeverLosVehicleChannelConditionModel
Models a never in-LoS condition model caused by a blocking vehicle.
Definition: channel-condition-model.h:385
ns3::RandomVariableStream::SetStream
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
Definition: random-variable-stream.cc:100
ns3::ThreeGppIndoorMixedOfficeChannelConditionModel::ComputePlos
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...
Definition: channel-condition-model.cc:627
ns3::ThreeGppUmaChannelConditionModel::ThreeGppUmaChannelConditionModel
ThreeGppUmaChannelConditionModel()
Constructor for the ThreeGppUmaChannelConditionModel class.
Definition: channel-condition-model.cc:498
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
ns3::ThreeGppUmiStreetCanyonChannelConditionModel
Computes the channel condition for the UMi-Street canyon scenario.
Definition: channel-condition-model.h:653
ns3::NeverLosChannelConditionModel
Models a never in-LoS condition model.
Definition: channel-condition-model.h:324
ns3::ChannelCondition::~ChannelCondition
virtual ~ChannelCondition()
Destructor for the ChannelCondition class.
Definition: channel-condition-model.cc:56
ns3::UniformRandomVariable::GetValue
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
Definition: random-variable-stream.cc:182
ns3::ThreeGppRmaChannelConditionModel::ThreeGppRmaChannelConditionModel
ThreeGppRmaChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
Definition: channel-condition-model.cc:452
ns3::NeverLosChannelConditionModel::AssignStreams
virtual int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Definition: channel-condition-model.cc:236
ns3::ThreeGppChannelConditionModel::Calculate2dDistance
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
Definition: channel-condition-model.cc:414
ns3::ThreeGppChannelConditionModel::m_uniformVar
Ptr< UniformRandomVariable > m_uniformVar
uniform random variable
Definition: channel-condition-model.h:512
ns3::ThreeGppChannelConditionModel
Base class for the 3GPP channel condition models.
Definition: channel-condition-model.h:447
ns3::MakeTimeAccessor
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
ns3::ThreeGppUmiStreetCanyonChannelConditionModel::ThreeGppUmiStreetCanyonChannelConditionModel
ThreeGppUmiStreetCanyonChannelConditionModel()
Constructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
Definition: channel-condition-model.cc:566
ns3::ThreeGppChannelConditionModel::Item
Struct to store the channel condition in the m_channelConditionMap.
Definition: channel-condition-model.h:555