#include <multi-model-spectrum-channel.h>
Public Member Functions | |
MultiModelSpectrumChannel () | |
virtual void | AddPropagationLossModel (Ptr< PropagationLossModel > loss) |
virtual void | AddRx (Ptr< SpectrumPhy > phy) |
add a SpectrumPhy to a channel, so it can receive packets | |
virtual void | AddSpectrumPropagationLossModel (Ptr< SpectrumPropagationLossModel > loss) |
virtual Ptr< NetDevice > | GetDevice (uint32_t i) const |
virtual uint32_t | GetNDevices (void) const |
virtual Ptr < SpectrumPropagationLossModel > | GetSpectrumPropagationLossModel (void) |
virtual void | SetPropagationDelayModel (Ptr< PropagationDelayModel > delay) |
virtual void | StartTx (Ptr< SpectrumSignalParameters > params) |
![]() | |
virtual | ~SpectrumChannel () |
![]() | |
Channel () | |
virtual | ~Channel () |
uint32_t | GetId (void) const |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::MultiModelSpectrumChannel. |
Protected Member Functions | |
void | DoDispose () |
Private Member Functions | |
void | CheckAddRxSpectrumModel (Ptr< SpectrumPhy > rxPhy, Ptr< const SpectrumModel > rxSpectrumModel) |
TxSpectrumModelInfoMap_t::const_iterator | FindAndEventuallyAddTxSpectrumModel (Ptr< const SpectrumModel > txSpectrumModel) |
virtual void | StartRx (Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver) |
Private Attributes | |
double | m_maxLossDb |
TracedCallback< Ptr < SpectrumPhy >, Ptr < SpectrumPhy >, double > | m_pathLossTrace |
std::vector< Ptr< SpectrumPhy > > | m_phyVector |
Ptr< PropagationDelayModel > | m_propagationDelay |
Ptr< PropagationLossModel > | m_propagationLoss |
RxSpectrumModelInfoMap_t | m_rxSpectrumModelInfoMap |
Ptr< SpectrumPropagationLossModel > | m_spectrumPropagationLoss |
TxSpectrumModelInfoMap_t | m_txSpectrumModelInfoMap |
This SpectrumChannel implementation can handle the presence of SpectrumPhy instances which can use different spectrum models, i.e., different SpectrumModel. The only requirement is that every SpectrumPhy instance uses the same SpectrumModel for the whole simulation.
Definition at line 82 of file multi-model-spectrum-channel.h.
ns3::MultiModelSpectrumChannel::MultiModelSpectrumChannel | ( | ) |
Definition at line 80 of file multi-model-spectrum-channel.cc.
References NS_LOG_FUNCTION.
|
virtual |
set the single-frequency propagation loss model to be used
loss | a pointer to the propagation loss model to be used. |
Implements ns3::SpectrumChannel.
Definition at line 381 of file multi-model-spectrum-channel.cc.
References m_propagationLoss, NS_ASSERT, and NS_LOG_FUNCTION.
|
virtual |
add a SpectrumPhy to a channel, so it can receive packets
This method is used to attach a SpectrumPhy instance to a SpectrumChannel instance, so that the SpectrumPhy can receive packets sent on that channel. Note that a SpectrumPhy that only transmits (without receiveing ever) does not need to be added to the channel.
This method is to be implemented by all classes inheriting from SpectrumChannel.
phy | the SpectrumPhy instance to be added to the channel as a receiver. |
Implements ns3::SpectrumChannel.
Definition at line 133 of file multi-model-spectrum-channel.cc.
References ns3::SpectrumPhy::GetRxSpectrumModel(), ns3::SpectrumModel::GetUid(), m_phyVector, m_rxSpectrumModelInfoMap, m_txSpectrumModelInfoMap, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
virtual |
set the frequency-dependent propagation loss model to be used
loss | a pointer to the propagation loss model to be used. |
Implements ns3::SpectrumChannel.
Definition at line 389 of file multi-model-spectrum-channel.cc.
References m_spectrumPropagationLoss, and NS_ASSERT.
|
private |
make sure that there are SpectrumConverters from any SpectrumPhy being used for TX to the given SpectrumModel being used for RX
rxPhy | the RXing SpectrumPhy |
rxSpectrumModel | the SpectrumModel used for RX by rxPhy |
|
protectedvirtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
It is safe to call GetObject from within this method.
Reimplemented from ns3::Object.
Definition at line 86 of file multi-model-spectrum-channel.cc.
References m_phyVector, m_propagationDelay, m_propagationLoss, m_rxSpectrumModelInfoMap, m_spectrumPropagationLoss, m_txSpectrumModelInfoMap, and NS_LOG_FUNCTION.
|
private |
this method checks if m_rxSpectrumModelInfoMap contains an entry for the given TX SpectrumModel. If such entry exists, it returns an interator pointing to it. If not, it creates a new entry in m_txSpectrumMpodelInfoMap, and returns an iterator to it.
txSpectrumModel | the TX SpectrumModel being considered |
Definition at line 186 of file multi-model-spectrum-channel.cc.
References ns3::SpectrumModel::GetUid(), m_rxSpectrumModelInfoMap, m_txSpectrumModelInfoMap, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by StartTx().
i | index of NetDevice to retrieve |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 373 of file multi-model-spectrum-channel.cc.
References m_phyVector.
|
virtual |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 365 of file multi-model-spectrum-channel.cc.
References m_phyVector.
|
virtual |
Definition at line 403 of file multi-model-spectrum-channel.cc.
References m_spectrumPropagationLoss, and NS_LOG_FUNCTION.
|
static |
This method returns the TypeId associated to ns3::MultiModelSpectrumChannel.
Attributes defined for this type:
Attributes defined in parent class ns3::Channel:
TraceSources defined for this type:
Reimplemented from ns3::SpectrumChannel.
Definition at line 99 of file multi-model-spectrum-channel.cc.
References m_maxLossDb, m_pathLossTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
|
virtual |
set the propagation delay model to be used
delay | Ptr to the propagation delay model to be used. |
Implements ns3::SpectrumChannel.
Definition at line 396 of file multi-model-spectrum-channel.cc.
References m_propagationDelay, and NS_ASSERT.
|
privatevirtual |
used internally to reschedule transmission after the propagation delay
params | |
receiver |
Definition at line 356 of file multi-model-spectrum-channel.cc.
References NS_LOG_FUNCTION, and ns3::SpectrumPhy::StartRx().
Referenced by StartTx().
|
virtual |
Used by attached PHY instances to transmit signals on the channel
params | the parameters of the signals being transmitted |
Implements ns3::SpectrumChannel.
Definition at line 229 of file multi-model-spectrum-channel.cc.
References ns3::PropagationLossModel::CalcRxPower(), ns3::SpectrumPropagationLossModel::CalcRxPowerSpectralDensity(), FindAndEventuallyAddTxSpectrumModel(), ns3::PropagationDelayModel::GetDelay(), ns3::AntennaModel::GetGainDb(), ns3::Node::GetId(), ns3::NetDevice::GetNode(), ns3::MobilityModel::GetPosition(), list, m_maxLossDb, m_pathLossTrace, m_propagationDelay, m_propagationLoss, m_rxSpectrumModelInfoMap, m_spectrumPropagationLoss, m_txSpectrumModelInfoMap, ns3::MicroSeconds(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleWithContext(), and StartRx().
|
private |
Definition at line 188 of file multi-model-spectrum-channel.h.
Referenced by GetTypeId(), and StartTx().
|
private |
Definition at line 190 of file multi-model-spectrum-channel.h.
Referenced by GetTypeId(), and StartTx().
|
private |
this is only used to provide a straighforward implementation of GetNDevices() and GetDevice()
Definition at line 185 of file multi-model-spectrum-channel.h.
Referenced by AddRx(), DoDispose(), GetDevice(), and GetNDevices().
|
private |
propagation delay model to be used with this channel
Definition at line 149 of file multi-model-spectrum-channel.h.
Referenced by DoDispose(), SetPropagationDelayModel(), and StartTx().
|
private |
single-frequency propagation loss model to be used with this channel
Definition at line 155 of file multi-model-spectrum-channel.h.
Referenced by AddPropagationLossModel(), DoDispose(), and StartTx().
|
private |
data structure holding, for each RX spectrum model, all the corresponding SpectrumPhy instances.
Definition at line 178 of file multi-model-spectrum-channel.h.
Referenced by AddRx(), DoDispose(), FindAndEventuallyAddTxSpectrumModel(), and StartTx().
|
private |
frequency-dependent propagation loss model to be used with this channel
Definition at line 161 of file multi-model-spectrum-channel.h.
Referenced by AddSpectrumPropagationLossModel(), DoDispose(), GetSpectrumPropagationLossModel(), and StartTx().
|
private |
data structure holding, for each TX SpectrumModel, all the converters to any RX SpectrumModel, and all the corresponding SpectrumPhy instances.
Definition at line 170 of file multi-model-spectrum-channel.h.
Referenced by AddRx(), DoDispose(), FindAndEventuallyAddTxSpectrumModel(), and StartTx().