propagation模块
ns-3 木块中有propagation模块,其model中有propagation-loss-model.cc以及propagation-loss-model.h文件。
模型propagation-loss-model.h
class PropagationLossModel : public Object
{
public:
static TypeId GetTypeId (void);
PropagationLossModel ();
virtual ~PropagationLossModel ();
void SetNext (Ptr<PropagationLossModel> next);
Ptr<PropagationLossModel> GetNext ();
//该函数返回接收功率(dBm),将所有的PropagatinLossModel(s)考虑到;
//a为源的移动模型,b为目的移动模型;
double CalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const;
int64_t AssignStreams (int64_t stream);
private:
PropagationLossModel (const PropagationLossModel &);
PropagationLossModel &operator = (const PropagationLossModel &);
//返回接收功率(dBm)仅考虑特定的propagatinlossmodel;
//a为源的移动模型,b为目的移动模型;
//该基类中的纯虚函数,在子类中实现;
virtual double DoCalcRxPower (double txPowerDbm,
Ptr<MobilityModel> a,
Ptr<MobilityModel> b) const = 0;
virtual int64_t DoAssignStreams (int64_t stream) = 0;
Ptr<PropagationLossModel> m_next;
};
选择其中一个派生类RangePropagationLossModel来进行深入分析:
class RangePropagationLossModel:public PropagationLossModel
{
public