riebl / artery

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

Code to save results #277

Closed MartinaBarbiFivecomm closed 1 month ago

MartinaBarbiFivecomm commented 1 year ago

Good afternoon,

sorry but I recently started using artery, omnet++ and so on. In artery where is the code meant to save the results? In order to understand what is being saved for each scenario.

Thank you very much,

Martina

awillecke commented 1 year ago

Hi,

in Artery, you can use the result recording features of OMNet++. For example, the CaService can record the station ID and genDeltaTime when receiving a CAM. If it does is determined in the omnetpp.ini of the scenario you run. The example scenario has all recordings disabled by default. On how to enable recordings of all or only specific signals/statistics you are interested in, please refer to the OMNet++ documentation.

Best regards Alex

MartinaBarbiFivecomm commented 1 year ago

Thank you for your reply. However I have few more questions please:

Thanks in advance for your help,

Martina

awillecke commented 1 year ago

I have no experience with the highway-police scenario, but at a first glance it seems that it (or rather its services) does not record anything. That is why the result files are empty, and you cannot find any code for recording. You would need to implement the recording of the measurements you are interested in yourself. Maybe this part of the documentation is helpful.

If you just want to try recording data, you could enable recordings by the channelLoadRecorder in the envmod config section. Adding something like this should work:

*.node[*].channelLoadRecorder[*].ChannelLoad.vector-recording = true
*.node[*].channelLoadRecorder[*].ChannelLoad.scalar-recording = true
*.node[*].channelLoadRecorder[*].ChannelLoad.statistic-recording = true
MartinaBarbiFivecomm commented 1 year ago

I did put these lines .scalar-recording = true and .vector-recording = true in the omnetpp.ini file and it stores some variables when also running the general configuration. However when I plot the data for the four vehicles I get these histograms for the minSNIR and PacketErrorRate, but I actually do not understand what is the x-axis representing? in the minSNIR which units are those values? And in the PacketErrorRate it should be something below 1 as it is usually a percentage right?

SNIR PacketErrorRate

riebl commented 1 year ago

The last time I have been using the OMNeT++ IDE is years ago. Thus, I cannot say what it is plotting there exactly. I assume you can get some details in the "Properties" section in the bottom left corner of your screenshots.

The scalars and vectors you see in the results files are default statistics produced by the INET WLAN model. As long as those are not explicitly disabled, you will find them in the result files. If you look for @statistic in the *.ned files, you will find a vast number of metrics you could record.

My personal favourite for collecting data with OMNeT++ is its SQLite backend. You can have a look at scenarios/car2car-grid/omnetpp.ini where this backend is used. Furthermore, this scenario can serve as an example of how to enable Artery-specific metrics such as LinkLatency. With the SQLite backend, the result files are SQLite databases you can open and process independently of the OMNeT++ IDE. For my thesis, I have used Python a lot for analysing the data and creating plots.