Wave服务广告(WSA)实施 [英] Wave Service Advertisement (WSA) implementation
问题描述
我正在使用OMNET ++&来实现以下方案的实现VEINS模拟器.
I am working on the implementation of the following scenario using OMNET++ & VEINS simulators.
- 每个RSU都会广播一次WSA(Wave Service Advertise)信标 每秒. (即I2V通信).
- 每辆过往车辆都将存储这些WSA. (即缓存)
- 对WSA感兴趣的车辆会查询附近的车辆. (IE. 搜索WSA)(即V2V通信).
- 收到查询的车辆将对查询做出响应(如果 所需的WSA位于车辆缓存中). (即V2V通信)
- Every RSU will broadcast WSA (Wave Service Advertisement) Beacon once per second. (i.e. I2V communication).
- Every passing vehicle would store these WSAs. (i.e. Caching)
- Vehicles interested in a WSA, would query nearby vehicles. (i.e. Searching for WSA) (i.e. V2V communication).
- Vehicles after receiving the query, would response to the query (if the required WSA is inside the vehicle cache). (i.e. V2V communication)
有关实施的问题:
- 是否需要为上述每个阶段定义一个新的.msg文件
(用于RSU广播,用于车辆查询和用于车辆响应)?
还是只需要修改
WaveShortMessage.msg
文件? - 我是否需要为RSU和CAR定义自己的
.cc
,.h
,.ned
文件,还是 可以修改(静脉)曲奇的例子.
- Do I need to define a new .msg files for each of the above phases
(for RSU broadcast, for vehicles query, and for vehicles responding) ?
or I need to amend the
WaveShortMessage.msg
file only ? - Do I need to define my own
.cc
,.h
,.ned
files for RSU and CAR or I can amend the traci examples (of Veins).
推荐答案
是否需要为上述每个阶段定义一个新的.msg文件(对于 RSU广播,车辆查询和车辆响应)?或者我 仅需要修改WaveShortMessage.msg文件?
Do I need to define a new .msg files for each of the above phases (for RSU broadcast, for vehicles query, and for vehicles responding) ? or I need to amend the WaveShortMessage.msg file only ?
强烈建议您为特定应用程序创建常规消息类型.您可以扩展WaveShortMessage.msg
,然后在消息中添加type
字段,该字段代表应用程序的不同类型的消息:RSUbroadcast
,VehicleQueryFrame
,依此类推.最终的决定归结为您的选择.但是,尽可能指定消息(对某些任务保持原子性)是一种很好的做法.
It is highly recommended that you create a general message type for your specific application. You could extend the WaveShortMessage.msg
, and then add a type
field in your message, which would represent different types of messages for the application: RSUbroadcast
, VehicleQueryFrame
and so on. The decision in the end boils down to your choice. But having messages as specified as possible (keeping them atomic for a certain task) is good practice.
cplusplus {{
#include "veins/modules/heterogeneous/messages/WaveShortMessage_m.h" // include the base message
#define RSU_BROADCAST_FRAMETYPE 50
#define VEHICLE_QUERY_FRAMETYPE 51
}}
class WaveShortMessage; // Making the C++ Declarations Available
message MyAppGeneralMessage extends WaveShortMessage
{
int frameType;
}
具有不同的类型将使您可以基于不同的消息类型来控制应用程序的行为.
Having the different types will allow you control over the behaviour of the application based on the different message type.
if(msg->getType() == foo)
{
/* do smth for foo */
}
我是否需要为RSU和CAR定义自己的.cc,.h,.ned文件,还是可以修改(静脉的)traci示例.
Do I need to define my own .cc, .h, .ned files for RSU and CAR or I can amend the traci examples (of Veins).
通常是.您可能需要为要在RSU和Car上运行的应用定义.ned
,.cc
,.h
,而不必为重新定义RSU和汽车真的是.
In general yes. You will probably need to define .ned
, .cc
, .h
for the application(s) which you want to run on the RSU and the Car, but not for redefining what a RSU and a Car really is.
如果您不愿意,可以先查看静脉内的演示文件和示例.
If you are reluctant you can start of by looking and the demo files and examples inside Veins.
这篇关于Wave服务广告(WSA)实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!