omnet++ - 如何从 inet 无线电模型获取 omnet++ 上的信号强度 (RSSI)?
问题描述
我正在研究 omnet++ 上的路由协议,我需要获取连接强度或 RSSI 以用于决策目的。如何在节点之间的 omnet++ 模拟中获取无线连接的信号强度?我已经阅读了几个无线电模型的描述,但找不到任何明确的方法来简单地获得连接的强度。我得到的最接近的是无线电模型 ApskScalarRadio 有 minSNIR。
解决方案
这是我用来在名为“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++ 的专家,但是这种方法非常适合收集统计数据。
推荐阅读
- ios - 冗余约束'Self':'AnyObject'
- azure - 防止 Azure SQL 数据仓库中重复数据的策略
- kubernetes - 如何用 Helm 管理 200 多个微服务?
- javascript - Multer 未按要求创建文件
- .htaccess - htaccess 中的重定向问题
- javascript - Angular 发出多个 http 请求,但要等待每个请求完成,然后再发出一个新请求
- ubuntu - Python Flask Api - 图片上传和显示网址
- hyperledger-fabric - 无法使用 Fabric Java SDK 基于事务 id 获取 BlockInfo
- javascript - 如何阅读以下箭头功能
- c - 使用gcc直接编译成机器码,无需链接