问题
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