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))
std::vector< Ptr< Building > >::const_iterator Iterator
Const Iterator.
static Iterator End(void)
static Iterator Begin(void)
Determines the channel condition based on the buildings deployed in the scenario.
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.
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.
BuildingsChannelConditionModel()
Constructor for the BuildingsChannelConditionModel class.
static TypeId GetTypeId(void)
Get the type ID.
virtual ~BuildingsChannelConditionModel() override
Destructor for the BuildingsChannelConditionModel class.
Models the channel condition.
mobility buildings information (to be used by mobility models)
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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.