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
.