使用RandomWPMobility,omnet ++模拟环境时出错

问题描述 投票:0回答:1

我正在使用AODV协议(作为INET库的一部分实现),在omnet ++(版本5.1.1,在ubuntu 16.04,x64上)上模拟无线通信的教程。我使用了以下代码:

*.host*.mobilityType = "RandomWPMobility"
*.host*.mobility.waitTime= uniform (100s,500s)
*.host*.mobility.speed = uniform(1mps, 10mps)
*.host*.mobility.updateInterval = 0.1s

运行代码时出现错误:

在网络初始化期间,无法调度消息(omnetpp :: cMessage)移动到过去,t = -9.22337e + 06 - 在模块(inet :: RandomWPMobility)Basic.hostA.mobility(id = 39)中

有人可以帮我解决这个错误吗?

c++ omnet++ inet
1个回答
0
投票

我在本教程中遇到了同样的错误。我不知道它究竟来自哪里,但这里是我找到的解决方案:

omn​​etpp.ini

[Config TestRandomWPMobility2]
network = MobileNetwork

*.host[0].udpApp[0].typename = "UDPBasicApp" # Protocole de communication
*.host[1].udpApp[0].typename = "UDPSink"    # hostMobB = jette les messages recus
*.host*.wlan[0].typename = "IdealWirelessNic"

**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m
**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 600m
**.constraintAreaMaxY = 400m
**.constraintAreaMaxZ = 0m
**.updateInterval = 0.1s # test with 0s too, and let getCurrentPosition update the display string from a test module

*.numHosts = 5
**.host*.mobilityType = "RandomWPMobility"
**.host[0].mobility.speed = 10*uniform(20mps,50mps)
**.host*.mobility.speed = uniform(20mps,50mps)
**.host*.mobility.waitTime = uniform(3s,8s)

MobileNetwork.ned:

network MobileNetwork
{
    parameters:
        int numHosts;
        @display("bgb=600,400");
    submodules:
        host[numHosts]: MobileHost {
            parameters:
                @display("p=400+50*numHosts,300+50*numHosts;r=,,#707070");
        }
}

我希望这能帮到您。

© www.soinside.com 2019 - 2024. All rights reserved.