Wait for receiving an ACK in finish() function in Veins

别等时光非礼了梦想. 提交于 2019-12-14 03:34:34

问题


I use OMNeT++-4.6, sumo-0.22.0 and Veins-4a2.

In my simulation, I need that all nodes send their messages when leaving the simulation to their destination which are RSU in my case. The problem that all nodes send their messages in finish() function but they are not receiving by RSU since every node should wait before it can access the channel and then it will be destroyed.

I need to make every node when leaving the simulation waits until receiving an ACK from the destination. Then, when it receives all ACK for all sending messages it can be destroyed.

So, how can I force every node in finish() function to wait for ACK? I need a help please to do this scenario.


回答1:


According to OMNeT++ Simulation Manual:

finish() is called for all modules at the end of the simulation.

A message sending in finish() cannot be received by any module because the simulation is ending and handleMessage() will not be called.

I suggest introducing a selfmessage which (at specified moment) will involve actions you want to do.



来源:https://stackoverflow.com/questions/42887375/wait-for-receiving-an-ack-in-finish-function-in-veins

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!