16#include "ns3/assert.h"
17#include "ns3/callback.h"
18#include "ns3/cost231-propagation-loss-model.h"
19#include "ns3/event-id.h"
20#include "ns3/mobility-model.h"
21#include "ns3/net-device.h"
23#include "ns3/nstime.h"
24#include "ns3/simulator.h"
47 static TypeId tid =
TypeId(
"ns3::SimpleOfdmWimaxChannel")
49 .SetGroupName(
"Wimax")
124 return (*iter)->GetDevice();
145 double rxPowerDbm = 0;
148 senderMobility = phy->GetDevice()->GetNode()->GetObject<
MobilityModel>();
156 receiverMobility = (*iter)->GetDevice()->GetNode()->GetObject<
MobilityModel>();
157 if (receiverMobility && senderMobility &&
m_loss)
159 distance = senderMobility->GetDistanceFrom(receiverMobility);
160 delay =
Seconds(distance / 300000000.0);
161 rxPowerDbm =
m_loss->CalcRxPower(txPowerDbm, senderMobility, receiverMobility);
175 dstNode = 0xffffffff;
179 dstNode = dstNetDevice->GetObject<
NetDevice>()->GetNode()->GetId();
207 int64_t currentStream = stream;
211 currentStream += simpleOfdm->AssignStreams(currentStream);
213 return (currentStream - stream);
Keep track of the current position and velocity of an object.
Network layer to device interface.
Smart pointer class similar to boost::intrusive_ptr.
SimpleOfdmSendParam class.
uint8_t GetDirection() const
WimaxPhy::ModulationType GetModulationType()
uint64_t GetFrequency() const
uint32_t GetBurstSize() const
Ptr< PacketBurst > GetBurst()
double GetRxPowerDbm() const
bool GetIsFirstBlock() const
SimpleOfdmWimaxChannel class.
~SimpleOfdmWimaxChannel() override
Ptr< PropagationLossModel > m_loss
loss
void SetPropagationModel(PropModel propModel)
sets the propagation model
void DoAttach(Ptr< WimaxPhy > phy) override
Attach function.
std::size_t DoGetNDevices() const override
Get number of devices function.
static TypeId GetTypeId()
Register this type.
std::list< Ptr< SimpleOfdmWimaxPhy > > m_phyList
phy list
void EndSendDummyBlock(Ptr< SimpleOfdmWimaxPhy > rxphy, SimpleOfdmSendParam *param)
End send dummy block function.
Ptr< NetDevice > DoGetDevice(std::size_t i) const override
Get device function.
void Send(Time BlockTime, uint32_t burstSize, Ptr< WimaxPhy > phy, bool isFirstBlock, bool isLastBlock, uint64_t frequency, WimaxPhy::ModulationType modulationType, uint8_t direction, double txPowerDbm, Ptr< PacketBurst > burst)
Sends a dummy fec block to all connected physical devices.
PropModel
PropModel enumeration.
@ LOG_DISTANCE_PROPAGATION
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
SimpleOfdmWimaxPhy class.
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
The channel object to attach Wimax NetDevices.
ModulationType
ModulationType enumeration.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.