Disable/remove Veins中某车的网卡模块

Disable/remove the NIC module of some vehicle in Veins

尊敬的 OMNeT++/SUMO/Veins 社区,

There is a correct way to disable/remove the NIC module for some vehicle in the Veins?

我的场景中有很多车辆,我只想设置其中一部分带有通信模块,例如 50 %。为此,我创建了一种方法,将一半的车辆设置为启动 sendBeacon,另一种方法是将 beacon/data 设置为一半(与未启动 sendBeacon 相同的一半)车辆。我已经看到这个 question.

我认为有一个正确的方法来做到这一点,因为在我的代码中所有车辆都有通信模块,只是不使用或忽略到达的包裹。

如有任何帮助,我将不胜感激。

如果只想让一部分车辆参与网络仿真,可以将https://github.com/sommer/veins/blob/veins-4.4/src/veins/modules/mobility/traci/TraCIScenarioManagerLaunchd.ned#L58中的渗透率参数设置为小于1的值。

比如你设置渗透率为0.5,只有一半的车会参与网络模拟(但还是在道路交通模拟中),这样就形成了一个一半的车没有配备的网络采用 VANET 技术。