riebl / artery

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
203 stars 129 forks source link

Dynamic Frame Error Rate Based on Positions #273

Closed buraksenkus closed 1 year ago

buraksenkus commented 1 year ago

Hi,

I want to implement a dynamic frame error rate calculation mechanism based on vehicle positions. I saw that Mac1609_4::handleLowerMsg function uses frameErrorRate variable to decide whether the packet will be dropped or not. Yet, this variable is set in scenario configuration file.

What I want to do is

  1. Get self position,
  2. Get the position of vehicle which generates message,
  3. Set frameErrorRate variable based on a custom algorithm which uses gathered vehicle positions.

How can I access positions of these two vehicles by considering I'm running Artery's example scenario with veins configuration?

I thought that implementing this in Mac1609_4 class would be easier since packet dropping has been already implemented based on frameErrorRate variable. But I'm not sure whether accessing positions of vehicles in Mac1609_4 would be a good practice or not. How can I do this in a clear way?

Thanks in advance!

riebl commented 1 year ago

My understanding of the frameErrorRate parameter is that this should only be used for testing purposes because it is an "artificial drop rate".

Instead, I think you should implement a veins::AnalogueModel. Veins' analogue model operates on Signal objects which also include the positions of the transmitting and receiving antennas (POA). Though the signal contains not the frame error rate but "only" the attenuation, the Decider80211p decides if an AirFrame (carrying a Signal) can be received.

buraksenkus commented 1 year ago

Hi @riebl,

veins::AnalogueModel seems what I need to use. I'll create a custom subclass from it and implement my algorithm. Thanks for your guidance!