omnetpp / omnetpp-resultfiles

Abandoned project.
27 stars 18 forks source link

Make itervar-values contained in sca- and vec-files available to R #16

Open mbyrenh opened 4 years ago

mbyrenh commented 4 years ago

Hi,

the commit in this pull request extends the loadDataset function such that the returned dataframe also includes the "itervar"-entries from the scalar/vector files, making it easier to group different runs by simulation parameter values.

The code added to the processLine-method of the ResultFileManager-class is similar to the code regarding processing of run attributes. One rather subtle change is that I replaced the line PROTECT(dataset = NEW_LIST(9)) at the beginning of the exportDataset-method in loadDataset.cc with PROTECT(dataset = NEW_LIST(datasetColumnsLength)), as to me it seems that the "9" was just a hard-coded version of the number of dataset columns.

I am also not familiar with writing R extensions and I am not sure if the call to UNPROTECT(1) is at the right place or if it should occur just after all the itervar entries have been added to the dataframe.

Kind regards, Martin

avarga commented 4 years ago

Thank you for your contribution, we'll have a look in the next days.

Just as info, we don't actively maintain the R plugin any more, since its creation we became more focused on using Python + Pandas + Matplotlib. We are moving the IDE's Analysis tool to that platform too, i.e. analyses will be programmable in Python. If you are interested, you can find a early demo of it at http://mediaeventi.unipi.it/category/video/Summit-workshop-Omnet-Attila-Torok-September-6-/4fe10ca70f54cde26ebcef44c8782b62/163 , or download OMNeT++ 6.0 previews from omnetpp.org.

mbyrenh commented 4 years ago

Thank you for the information. I will check the presentation from the Summit. Sorry, I just accidentally added another commit to this request, as I forgot to create a separate branch. Anyways, the new commit should fix issue #9.