问题
I use OMNeT++-4.6, sumo-0.22.0 and Veins-4a2.
In my simulation, each node creates a message, stores it in its buffer and after some delay it sends all its messages. I did two timers to specify the delay of created and sent messages. So, the message sent may be receive by an other node or by the destination which is the RSU.
My simulation ends when all nodes reach their destination according to the indicating path in .rou.xml file. Every node leaves the simulation at a specific time.
The goal of my scenario is that every node sends all stored messages when leaving the simulation and they must be received by the destination which are RSU in my case.
Can somebody tell me how can I do this using self-message() or an other solution please?
回答1:
Start looking into TraciScenarioManager and TraciCommandInterface to figure out how the communication with SuMO is done. Then check the TraCI protocol documentation to find out whether and how it is possibility to get notified when a vehicle is at the end of its route or to find out the time when the vehicle will be there so you can schedule a self message at this time. When you get this notification, you can send all messages you stored and then let the simulation continue which should remove the corresponding node.
I don't think there is a method which supports such a notification right now but when you know the necessary parts of the protocol it should be rather straight forward to add this functionality to the modules.
来源:https://stackoverflow.com/questions/42908752/sending-a-message-when-a-vehicle-leaves-the-simulation