是否可以在omnet ++/Veins项目中使用RInside来受益于丰富的R功能 [英] Is it possible to use RInside in omnet++/Veins project to benefit from rich R features

查看:106
本文介绍了是否可以在omnet ++/Veins项目中使用RInside来受益于丰富的R功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习R,并通过了名为 RInside 此博客文章进行配置并在Omnet ++ Eclipse IDE.我们如何将其与诸如静脉(静脉在顶层目录和src目录中已经自动生成的makefile)集成起来? Rinside需要GCC工具链,我认为这是OMNeT ++中的默认工具.

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 ++用户手册说,我们可以对某些源目录使用自定义makefile.因此,将RInside代码保存在一个源文件夹和一个单独的makefile中,然后从顶层顶层makefile调用此makefile.我尝试了这两种方法:
  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. 从RInside示例和makefile复制一些源文件,并更改IDE中的Build属性以将该文件夹从构建中排除
  2. 还为此目录使用了选项自定义生成文件.但是到目前为止还没有成功.可能是我做得不正确.

  • 使用Rinside实现所有功能,并使其成为一个库(静态/共享).静脉使用此库.
  • 到目前为止,是否有人尝试将其与基于omnet ++/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.

    我正在使用64位Ubuntu 16.04 LTS.

    I'm using Ubuntu 16.04 LTS 64 bit.

    推荐答案

    您是否真的要在OMNeT ++中使用R,还是要进行结果/数据分析?

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

    您能否提供一些有关您要做什么的信息/为什么要在OMNeT ++中使用R而不是在完成模拟后进行后处理步骤?一般来说,建议您与仿真分开进行后期处理,使用OMNeT ++中的统计信息收集库在结果中生成相关数据,并使用R进行处理.您可以找到与 Plexe ,它是

    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.

    如果您确实想这样做,我建议您在问题中使用第二种方法,即简单地将RInside库动态链接为系统库,并将它们指定为依赖项.基本上,这是使事情正常工作的最简单方法.

    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.

    但是,如果出于某种原因要明确链接到库,则应注意VEINS的构建过程依赖于

    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

    这篇关于是否可以在omnet ++/Veins项目中使用RInside来受益于丰富的R功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆