18#include "ns3/mobility-model.h"
20#include "ns3/pointer.h"
21#include "ns3/propagation-delay-model.h"
22#include "ns3/propagation-loss-model.h"
23#include "ns3/simulator.h"
36 TypeId(
"ns3::YansWifiChannel")
40 .AddAttribute(
"PropagationLossModel",
41 "A pointer to the propagation loss model attached to this channel.",
45 .AddAttribute(
"PropagationDelayModel",
46 "A pointer to the propagation delay model attached to this channel.",
89 if ((*i)->GetChannelNumber() !=
sender->GetChannelNumber())
100 <<
"m, delay=" << delay);
127 phy->TraceSignalArrival(ppdu,
totalRxPower, ppdu->GetTxDuration());
131 const auto txWidth = ppdu->GetTxChannelWidth();
141 phy->StartReceivePreamble(ppdu,
rxPowerW, ppdu->GetTxDuration());
Abstract Channel Base Class.
Keep track of the current position and velocity of an object.
AttributeValue implementation for Pointer.
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.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
a channel to interconnect ns3::YansWifiPhy objects.
void SetPropagationLossModel(const Ptr< PropagationLossModel > loss)
Ptr< PropagationDelayModel > m_delay
Propagation delay model.
static void Receive(Ptr< YansWifiPhy > receiver, Ptr< const WifiPpdu > ppdu, dBm_u txPower)
This method is scheduled by Send for each associated YansWifiPhy.
~YansWifiChannel() override
static TypeId GetTypeId()
Get the type ID.
Ptr< NetDevice > GetDevice(std::size_t i) const override
PhyList m_phyList
List of YansWifiPhys connected to this YansWifiChannel.
Ptr< PropagationLossModel > m_loss
Propagation loss model.
std::size_t GetNDevices() const override
void Send(Ptr< YansWifiPhy > sender, Ptr< const WifiPpdu > ppdu, dBm_u txPower) const
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void SetPropagationDelayModel(const Ptr< PropagationDelayModel > delay)
void Add(Ptr< YansWifiPhy > phy)
Adds the given YansWifiPhy to the PHY list.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#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_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
dB_u RatioToDb(double ratio)
Convert from ratio to dB.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
std::map< WifiSpectrumBandInfo, Watt_u > RxPowerWattPerChannelBand
A map of the received power for each band.
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.