1

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?

Fariha
  • 497
  • 1
  • 5
  • 13

1 Answers1

0

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.

Julian Heinovski
  • 1,822
  • 3
  • 16
  • 27
  • Thank you again for your reply. I will check everything you told me, but I have a question: I tried to send messages stored in finish() function since every node leaving the simulation execute it. The stored messages are sent but they are not received by the destination, so when I will get the notification as you said how can I force the node to wait until receiving the ACK since it will also send messages and then leaves the simulation and messages will not be received? – Fariha Mar 20 '17 at 20:29
  • 4
    The finish() method is the last method a module/component/node ever executes when the simulation is terminated, so your messages might be send, but handleMessage will never be called for any receiver. You would need to use things like the LifecycleManager to define a life cycle of a node and execute your "send all buffered messages" when the life cycle of a particular node ends. Sending them in finish() is definitely wrong. Only collect final statistics and (possibly) delete running timers inside finish(). – Michael Kirsche Mar 20 '17 at 21:01
  • Thank you for your answer and for this idea. I am trying to search about lifecycle Listner but I did not find examples showing how we can use it. If you know how can I use it with handleMessage() in BaseWaveApplLayer() in Veins or if you know such website with examples, can you send them to me please? This is will help me a lot. – Fariha Mar 21 '17 at 12:59
  • I am not sure if Veins includes the concept of the LifeCycleListener/Manager. It is a concept from INET, where (for example) the status of a node (or an interface) can be tracked. If you do not use Veins with INET, then you probably have to define your own mechanisms, with signals (shutting a node down) and listeners maybe. – Michael Kirsche Mar 21 '17 at 16:21