如何解决使用INet在Omnet ++上检查并投射错误
我正在尝试通过AP和路由器从WirelessHost(Host1)向StandardHost(Host3)发送Udp消息,但是在运行模拟时会收到此错误消息(我称我的网络为“ 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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。