I am using Veins framework with OMNET++ to simulate a highway scenario.
I am using cOutVector
to collect the results from my experiments.
I have more than 1000 nodes (vehicles), and the cOutVector
collects results individually for each module (node). However, I need to collect the overall results.
For example, How many beacons were received by all nodes? Is there anyway of collecting such results?
You can create a static variable and everytime a node receive one beacon you increase the value of this variable.
For example: (on app_name.h)
static int beaconCount; // in protected
int app_name::beaconCount = 0; // in the and of app_name.h, before #endif.
(on app_name.cc)
After this you can print the
beaconCount
in the function finish() or save in save file.In OMNeT++ the output results can be saved in two different types, and thus, file formats:
*.sca
) - contain summary data (mean, sum, count, max, min) for the whole simulation run*.vec
) - contain fine-grained data (in form of time series) for each second of the simulation runThe output file formats are tightly coupled with the
statistic
mechanisms of OMNeT++. The statistics allow you to store different result recording modes, such as: count, sum, mean, vector.In your case you would need to look at the
sum
for each of your nodes.These OMNeT++ mechanism seem complicated in the beginning, but they are rather easy once you wrap your head around. Also, they are very powerful giving insights to many aspects of your simulations.
Unfortunately, it is impossible to provide a "ready-to-use" solution for your case without knowing your code.
Q: Do you mean you want to collect aggregate stats of all nodes?
If so then I suggest you to use R, which provides more functionalities and customization. Though, you'll need time to learn the basic operation. There is tutorial in the omnetpp-resultfile Github page.