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")
61 "BuildingsChannelConditionModel only works with MobilityBuildingInfo");
65 bool isAIndoor = a1->IsIndoor ();
66 bool isBIndoor = b1->IsIndoor ();
69 if (!isAIndoor && !isBIndoor)
77 cond->SetLosCondition (ChannelCondition::LosConditionValue::LOS);
81 cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOS);
85 else if (isAIndoor && isBIndoor)
89 if (a1->GetBuilding () == b1->GetBuilding ())
91 cond->SetLosCondition (ChannelCondition::LosConditionValue::LOS);
95 cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOS);
100 cond->SetLosCondition (ChannelCondition::LosConditionValue::NLOS);
111 if ((*bit)->IsIntersect (l1, l2))
Smart pointer class similar to boost::intrusive_ptr.
Models the channel condition.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_UNUSED(x)
Mark a local variable as unused.
static Iterator End(void)
static Iterator Begin(void)
static TypeId GetTypeId(void)
Get the type ID.
std::vector< Ptr< Building > >::const_iterator Iterator
Determines the channel condition based on the buildings deployed in the scenario. ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.
mobility buildings information (to be used by mobility models)
virtual ~BuildingsChannelConditionModel() override
Destructor for the BuildingsChannelConditionModel class.
BuildingsChannelConditionModel()
Constructor for the BuildingsChannelConditionModel class.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.