3

I was learning R and came through this package called RInside which provides c++ classes to call an embedded R interpreter. I am able to run some examples given after configuring as per this blogpost and using provided makefile in Omnet++ eclipse IDE. How can we integrate this with say veins (veins already have auto generated makefiles in top directory and src directory)? Rinside needs GCC toolchain which i think is default in OMNeT++.

From what I've learned so far, these are the options:

  1. Omnet++ user manual says we can use custom makefile for some source directory. So keeping RInside code in one source folder and a separate makefile and calling this makefile from veins top level makefile. I tried both of these approaches:
    1. copying some source files from RInside examples and makefile and changed the Build properties in IDE to exclude this folder from build
    2. also used the option custom make file for this directory. But was not successful so far. May be i am not doing correctly.
  2. Implement all functionality using Rinside and make it a library (static/Shared). Use this library in veins.

Has anyone tried to use it with omnet++/veins based project so far? does anyone know if it is worth trying? Any other suggestions are welcome.

I'm using Ubuntu 16.04 LTS 64 bit.

1 Answer 1

2

Do you really want to use R inside of OMNeT++, or are you looking to do result/data analysis?


Result analysis

Could you provide a bit of information about what you're trying to do/why you're trying to use R inside OMNeT++ instead of doing a post-processing step after your simulations are completed? Generally speaking, I'd recommend doing your post-processing separate from your simulations, generating relevant data in the results using the statistics collection libs in OMNeT++, and process these with R. You can find some examples that are used with Plexe, a VEINS-based simulator for CACC applications, in this repository. I personally prefer to use python for the post-processing, but if you're already familiar with R, then I'd recommend having a look at that.


Integrating with VEINS

If you really want to do this, I'd recommend the second approach in your question, i.e., simply dynamically linking to the RInside libraries as system libraries and specify them as a dependency. This is basically the easiest way to get things to work.

However, if for some reason you want to link against the library explicitly, you should be aware that VEINS' build process relies on the configure script included in the distribution. The way it works differently from normal C++ programs is that OMNeT++ simulations should be built using the OMNeT++-provided opp_makemake tool: this is exactly what VEINS' configure script does. If you want to include additional library paths into the build process, the easiest way is to create a makefile using ./configure --include PATH/TO/RINSIDE/HEADERS. Refer to the script source code for more details

3
  • Hi Rens, Thanks for the reply. My Objective is integrating RInside with Veins. For results analysis i use "omnetpp" R Package. My work includes using a machine learning clustering algorithm in the simulation (not on results data so it is basically during simulation). Both python and R already have all the required libraries available and trying to re-implement them is hard and time taking . So i was exploring other available options. Then i came across this RInside package which seems interesting. So i am experimenting with it. I did'nt know about configure. I will try and get back soon.
    – rajeswar
    Feb 15, 2018 at 15:48
  • 1
    So you want to use RInside to do your learning? In that case, the second option is probably best. Don't forget that processing time isn't simulated by VEINS automatically -- if you do expensive computations in vehicles, the computation will be considered as instant in simulation time. That's not an issue for most applications (since adding better hardware is not really hard), but keep this in mind if you're looking at time-critical uses of machine learning. Feb 15, 2018 at 16:09
  • Yeah. I am just experimenting if its possible. I will definitely keep the suggestion about processing time in mind. Once i understand what i need to do may be i can try for c++ implementation for faster processing. Thansk for the help
    – rajeswar
    Feb 16, 2018 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.