来自BaseWaveApplLayer.cc(VEINS,OMNET ++)的RoadId() [英] RoadId() from the BaseWaveApplLayer.cc (VEINS, OMNET++)
本文介绍了来自BaseWaveApplLayer.cc(VEINS,OMNET ++)的RoadId()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何获取信息,例如roadid,以便将其用作新字段,例如来自BaseWaveApplLayer.cc的信标消息中?
how can i get information such as roadid in order to use it as a new field for example in beacon messages from BaseWaveApplLayer.cc?
最好, 帕夫洛斯
推荐答案
There is the class TraCICommandInterface
which provides access methods for such data like getRoadId()
.
在类 TraCIDemo11p
,您将找到一个获取此信息的示例.基本上可以归结为执行以下步骤:
In the class TraCIDemo11p
you can find an example how to get this information. It basically boilds down to performing the following steps:
TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule());
TraCICommandInterface* traci = mobility->getCommandInterface();
TraCICommandInterface::Vehicle* traciVehicle = mobility->getVehicleCommandInterface();
traciVehicle->getRoadId();
这篇关于来自BaseWaveApplLayer.cc(VEINS,OMNET ++)的RoadId()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文