首页 > 解决方案 > 如何从 inet 无线电模型获取 omnet++ 上的信号强度 (RSSI)?

问题描述

我正在研究 omnet++ 上的路由协议,我需要获取连接强度或 RSSI 以用于决策目的。如何在节点之间的 omnet++ 模拟中获取无线连接的信号强度?我已经阅读了几个无线电模型的描述,但找不到任何明确的方法来简单地获得连接的强度。我得到的最接近的是无线电模型 ApskScalarRadio 有 minSNIR。

标签: omnet++inet

解决方案


这是我用来在名为“ApskScalarReceiverNotifier”的派生类中记录信号功率的方法“computeIsReceptionPossible”的实现,该派生类扩展了“ApskScalarReceiver”。也许这会引导你朝着一个有帮助的方向前进。

    bool ApskScalarReceiverNotifier::computeIsReceptionPossible(const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part) const
{
    auto apksTransmission = dynamic_cast<const ApskScalarTransmission *>(reception->getTransmission());

    auto castreception = dynamic_cast<const ScalarReception *>(reception);
    auto strength = castreception->getPower();

    cOutVector powerVector;
    powerVector.setName("powerVector");
    powerVector.record(static_cast<double>(strength.get()));

    return apksTransmission && FlatReceiverBase::computeIsReceptionPossible(listening, reception, part);

}

我不是编写 C++ 的专家,但是这种方法非常适合收集统计数据。


推荐阅读