20#include "ns3/mobility-model.h"
21#include "ns3/net-device.h"
23#include "ns3/object.h"
24#include "ns3/packet.h"
25#include "ns3/pointer.h"
26#include "ns3/simulator.h"
27#include "ns3/string.h"
43 .AddAttribute(
"PropagationModel",
44 "A pointer to the propagation model.",
48 .AddAttribute(
"NoiseModel",
49 "A pointer to the model of the channel ambient noise.",
144 if (src == i->second)
146 senderMobility = i->first->GetNode()->GetObject<
MobilityModel>();
155 if (src != i->second)
157 NS_LOG_DEBUG(
"Scheduling " << i->first->GetMac()->GetAddress());
159 Time delay =
m_prop->GetDelay(senderMobility, rcvrMobility, txMode);
160 UanPdp pdp =
m_prop->GetPdp(senderMobility, rcvrMobility, txMode);
162 txPowerDb -
m_prop->GetPathLossDb(senderMobility, rcvrMobility, txMode);
165 << txPowerDb <<
"dB, rxPowerDb=" << rxPowerDb <<
"dB, distance="
166 << senderMobility->GetDistanceFrom(rcvrMobility) <<
"m, delay=" << delay);
168 uint32_t dstNodeId = i->first->GetNode()->GetId();
195 m_devList[i].second->Receive(packet, rxPowerDb, txMode, pdp);
202 double noise =
m_noise->GetNoiseDbHz(fKhz);
Abstract Channel Base Class.
Keep track of the current position and velocity of an object.
virtual void DoDispose()
Destructor implementation.
Smart pointer class similar to boost::intrusive_ptr.
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Channel class used by UAN devices.
void SetNoiseModel(Ptr< UanNoiseModel > noise)
Set the noise model this channel will use to determine ambient channel noise.
double GetNoiseDbHz(double fKhz)
Get the noise level on the channel.
void AddDevice(Ptr< UanNetDevice > dev, Ptr< UanTransducer > trans)
Adds device to receiver list for this channel.
Ptr< UanPropModel > m_prop
The propagation model.
static TypeId GetTypeId()
Register this type.
Ptr< UanNoiseModel > m_noise
The noise model.
~UanChannel() override
Dummy destructor, see DoDispose.
void DoDispose() override
Destructor implementation.
virtual void TxPacket(Ptr< UanTransducer > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txmode)
Send a packet out on the channel.
std::size_t GetNDevices() const override
bool m_cleared
Has Clear ever been called on the channel.
Ptr< NetDevice > GetDevice(std::size_t i) const override
UanDeviceList m_devList
The list of devices on this channel.
void SendUp(uint32_t i, Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
Send a packet up to the receiving UanTransducer.
void Clear()
Clear all pointer references.
void SetPropagationModel(Ptr< UanPropModel > prop)
Set the propagation model this channel will use for path loss/propagation delay.
The power delay profile returned by propagation models.
Abstraction of packet modulation information.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
#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_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.