2017-10-19 89 views
0

我正在使用AODV协议(作为INET库的一部分实现)在omnet ++(ubuntu 16.04,x64版本5.1.1)中模拟无线通信的教程。 我用下面的代码:使用RandomWPMobility,omnet ++仿真环境时出错

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

运行的代码时,我得到一个错误:

Cannot schedule message (omnetpp::cMessage)move to the past, t=-9.22337e+06 -- in module (inet::RandomWPMobility) Basic.hostA.mobility (id=39), during network initialization

能有人帮我这个错误?

回答

0

我在本教程中遇到了同样的错误。我不知道到底来自何方,但这里是我找到了解决办法:

[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

omnetpp.ini:我希望这将有助于你

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