0

In Veins/Omnet++ simulation, how can I determine when two vehicles are in range to exchange data? Suppose, I have three vehicles in a simulation (v1, v2, v3). During simulations these vehicles pass each other a few times. Now suppose v1 and v2 passes each other, each going in opposite directions. The encounter lasts about 5seconds( by encounter, I mean, that these two vehicles exchange data for 5 seconds, or that v1 receives data from v2 during these 5 seconds). My question is: how can I find out for how long has v1 and v2 been in contact each other? Keeping in mind that they might encounter each other several times over the course of simulations. So at the end I can have something like this generated for v1:

 1-  <tstart, tend, #packets exchanged>
 2-  <tstart, tend, #packets exchanged>
 .
 .
 .

where tstart would represent the time v1 started exchanging packets with another vehicle(vx), and tend would represent end of data exchange with that vehicle (vx) and #packets exchanged would show how many packets was exchanged between tstart and tend.

dutu
  • 15
  • 4

1 Answers1

0

Whether two vehicles are able to successfully exchange data depends on many factors, not least on who else is exchanging data at the time.

This means that you will only ever be able to find out who was, indeed, able to exchange data in your simulation. What this gives you is a list of "packet successfully received" events.

How to group these events into consecutive "transmission blocks" is entirely up to you. There are good arguments to be made for pretty much any choice here.

Christoph Sommer
  • 6,413
  • 1
  • 14
  • 34