2017-10-19 53 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"); 
     } 
}