如何开始构建静脉应用程序 [英] how to get start to build a veins application

查看:56
本文介绍了如何开始构建静脉应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,并且想使用它.我花了时间学习omnetpp和SUMO.现在,我可以成功使用两者.我还下载并安装了静脉,该示例运行良好.

I am new to veins and would like to use it. I have taken my time to learn omnetpp and SUMO. now I can use both successfully. I also downloaded and installed veins and the example works well.

现在我需要使用静脉构建自己的应用程序.简单地,我需要模拟车辆行驶的直线路,并将消息发送到单个RSU.

now I need to build my own application using veins. simply, I need to simulate a straight road where vehicles are moving and send messages to a single RSU.

我找不到关于静脉或其示例的任何文档. 有人可以帮助我知道我应该遵循哪些步骤吗? 例如,应该创建哪些ned文件,如何创建汽车和RSU,如何设置每个节点的应用程序等.

I can't find any documentation for veins or its example. can anybody help me to know what steps should I follow to do this? for example, which ned files should be created, how cars and RSUs are created, how to set the application of each node,etc.

推荐答案

首先,您需要创建对应的SuMO场景(您的路),您可以在示例仿真中使用它,而不是提供的SuMO场景.

First of all, you need to create the corresponding SuMO scenario (your road) which you can use in the example simulation instead of the provided one.

接下来,您必须在OMNeT ++中设置仿真方案.由于示例模拟中已经包含RSU,因此您无需再添加它(将其定位到所选位置).车辆节点是在运行时由静脉中的 TraCI 模块自动创建的.

Next, you have to setup the simulation scenario in OMNeT++. Since the example simulation already contains a RSU, you do not have to add it anymore (except for position it to a location of choice). Vehicle nodes are automatically created on runtime by the TraCI module in Veins.

现在,您已经有了车辆在道路上行驶并能够与RSU通信的场景.但是,示例仿真提供的旧应用程序将在您可能要更改的所有节点上执行.因此,您需要编写自己的应用程序,该应用程序可以在那些节点上执行.

Now you already have your scenario where vehicles are moving on a road and are able to communicate with the RSU. However, the old application provided by the example simulation will be executed on all nodes which you probably want to change. Hence, you need to write your own application which can be executed on those nodes.

要编写自己的应用程序,可以使用 MyVeinsApp 作为起点,只需添加所需的功能.它将已经提供了一些消息的发送(请参见 BaseWaveApplLayer ).还可以查看示例仿真中使用的演示应用程序.

To write your own application, you can use MyVeinsApp as a starting point and simply add the desired functionality. It will already provide sending of some messages (see BaseWaveApplLayer). Also have a look at the demo application used in the example simulation.

编写自己的应用程序后,修改

After you have written your own application, modify omnetpp.ini to use this application on all your nodes.

这篇关于如何开始构建静脉应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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