|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/buildings-channel-condition-model.h"
23 #include "ns3/mobility-model.h"
24 #include "ns3/mobility-building-info.h"
25 #include "ns3/building-list.h"
37 static TypeId tid =
TypeId (
"ns3::BuildingsChannelConditionModel")
39 .SetGroupName (
"Buildings")
62 "BuildingsChannelConditionModel only works with MobilityBuildingInfo");
66 bool isAIndoor = a1->IsIndoor ();
67 bool isBIndoor = b1->IsIndoor ();
70 if (!isAIndoor && !isBIndoor)
72 cond->SetO2iCondition (ChannelCondition::O2iConditionValue::O2O);
78 NS_LOG_DEBUG (
"a and b are outdoor, blocked " << blocked);
82 cond->SetLosCondition (ChannelCondition::LosConditionValue::LOS);
86 cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOS);
89 else if (isAIndoor && isBIndoor)
91 cond->SetO2iCondition (ChannelCondition::O2iConditionValue::I2I);
95 if (a1->GetBuilding () == b1->GetBuilding ())
97 NS_LOG_DEBUG (
"a and b are indoor in the same building");
98 cond->SetLosCondition (ChannelCondition::LosConditionValue::LOS);
102 NS_LOG_DEBUG (
"a and b are indoor in different buildings");
103 cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOS);
108 cond->SetO2iCondition (ChannelCondition::O2iConditionValue::O2I);
110 NS_LOG_DEBUG (
"a is indoor and b outdoor or viceversa");
111 cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOS);
122 if ((*bit)->IsIntersect (l1, l2))
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static Iterator Begin(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static Iterator End(void)
TypeId SetParent(TypeId tid)
Set the parent TypeId.
BuildingsChannelConditionModel()
Constructor for the BuildingsChannelConditionModel class.
Smart pointer class similar to boost::intrusive_ptr.
std::vector< Ptr< Building > >::const_iterator Iterator
mobility buildings information (to be used by mobility models)
#define NS_UNUSED(x)
Mark a local variable as unused.
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 Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the condition of the channel between a and b.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
bool IsLineOfSightBlocked(const Vector &l1, const Vector &l2) const
Checks if the line of sight between position l1 and position l2 is blocked by a building.
virtual ~BuildingsChannelConditionModel() override
Destructor for the BuildingsChannelConditionModel class.
Determines the channel condition based on the buildings deployed in the scenario.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Models the channel condition.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
static TypeId GetTypeId(void)
Get the type ID.