casting - 使用 INet 在 Omnet++ 上检查和投射错误
问题描述
我正在尝试通过 AP 和路由器将 Udp 消息从 WirelessHost(Host1)发送到 StandardHost(Host3),但是当我运行模拟时收到此错误消息(我将我的网络称为“poi”):
check_and_cast(): 无法将 'inet::physicallayer::INoise*' 类型转换为 'const inet::physicallayer::NarrowbandNoiseBase *' -- 在模块 (inet::physicallayer::Ieee80211Radio) poi.router.wlan[0] .radio (id=80),在网络初始化期间
几天前,我开始使用带有 Inet 的 omnet++,并且我的代码基于教程和文档,但我找不到解决此错误的方法。有什么经验或解决办法吗?谢谢
这是 .ned 代码,没有导入:
network poi {
parameters:
@display("bgb=514,316;bgg=100,1,grey95");
@figure[title](type=label; pos=0,-1; anchor=sw; color=darkblue);
@figure[rcvdPkText](type=indicatorText; pos=380,20; anchor=w; font=,18; textFormat="packets received: %g"; initialValue=0);
@statistic[packetReceived](source=host3.app[0].packetReceived; record=figure(count); targetFigure=rcvdPkText);
submodules:
host1: WirelessHost {
@display("p=403,224");
numWlanInterfaces = 1;
numApps = 1;
}
router: Router {
@display("p=193,224");
numWlanInterfaces = 2;
numEthInterfaces = 2;
numApps = 4;
}
accessPoint: AccessPoint {
@display("p=303,217;r=2000");
}
host3: StandardHost {
@display("p=73,224");
numEthInterfaces = 1;
numApps = 1;
}
integratedCanvasVisualizer: IntegratedCanvasVisualizer {
@display("p=379,57");
}
configurator: Ipv4NetworkConfigurator {
@display("p=104,35");
}
unitDiskRadioMedium: UnitDiskRadioMedium {
@display("p=216,100;r=10000");
}
connections:
accessPoint.ethg++ <--> Eth10G { @display("ls=,0"); } <--> router.ethg[0];
router.ethg[1] <--> Eth10G { @display("ls=,0"); } <--> host3.ethg[0];
}
和 .ini 文件:
[General]
network = poi
*.host*.ipv4.arp.typename = "GlobalArp"
*.router.ipv4.arp.typename = "GlobalArp"
*.router.app[*].typename = "UdpBasicApp"
*.host1.app[0].typename = "UdpBasicApp"
*.host1.app[0].destAddresses = "accessPoint"
*.host1.app[0].messageLength = 500B
*.host1.app[0].sendInterval = uniform(1ms,10ms)
*.host1.app[0].packetName = "UDPData"
*.host1.wlan[*].radio.radioMediumModule = "unitDiskRadioMedium"
*.router.wlan[*].radio.radioMediumModule = "unitDiskRadioMedium"
*.accessPoint.wlan[*].radio.radioMediumModule = "unitDiskRadioMedium"
*.host*.wlan[*].radio.receiver.ignoreInterference = true
*.host3.app[*].typename = "UdpBasicApp"
*.host*.wlan[0].typename = "AckingWirelessInterface"
*.host*.wlan[0].mac.useAck = false
*.host*.wlan[0].mac.fullDuplex = true
*.host*.wlan[0].radio.transmitter.communicationRange = 500m
*.host*.wlan[0].mac.headerLength = 1B
*.host*.**.bitrate = 1Gbps
解决方案
添加到您的 ini 文件中:
**.wlan[*].radio.typename = "UnitDiskRadio"
除此之外,您还可以在 ini 中设置未分配的参数,例如:
**.app[0].destPort = 4000
**.app[0].messageLength= 100B
**.app[0].sendInterval= 1s
**.transmitter.communicationRange = 500m
推荐阅读
- reactjs - 隐藏组件时如何捕捉?
- mysql - 使用jsp在mysql数据库中插入引导日期选择器日期
- angular - 如何在数据表中添加输入字段
- c# - 如何使用 Watson Unity SDK 制作语音到文本的自定义模型?
- acumatica - 为对话框面板上的自定义字段赋值(分配)
- wordpress - SSL 绿色挂锁不显示
- javascript - 如何通过 jQuery 在字段集中获取选定的单选按钮值?
- wordpress - 自定义
tag for all pages and posts on a WordPress website</h1> <div id="body"><p>I have been researching a problem that I have and came across this discussion:</p> <p><a href="https://gtranslate.io/forum/how-not-transl - javascript - 一个
可能只有一个子元素 - reactjs - 使用 reactjs 删除验证码上的警告