sumo 参考:SUMO简单使用教程 - 知乎
三者配合,参考:Veins、OMNeT++、SUMO仿真实验_sunaxp的博客-CSDN博客
omnet 新建项目,参考:Omnet++创建第一个程序_sinat_15102109的博客-CSDN博客
主要问题:
1、omnet 新建项目 后,运行,总是显示:“perhaps its code was not linked in, or the class wasn't registrered with Register_Class(), or in the case of modeules and channels, with Define_Module()/Define_Channel()
解决参考:OMNET问题调试:Error in modeule (cCompoundModule) Tictoc1 (id=1): Class "Txc1" not found -- perhaps its c_butterfly0987的博客-CSDN博客
我的问题是,我一开始新建的项目是 选择了“Empty project with 'src' and 'simulations' folders”,应该选择第一个“Empty project”,选择第一个就没有问题了
2、could not connect toTraCI server
下载veins代码后,在omnet里运行,报这个错。原来是sumo没有运行。用下面的命令运行就行了:
python D:/simulation/veins-5.1/veins-veins-5.1/sumo-launchd.py -vv -c D:/simulation/sumo-win64extra-1.8.0/sumo-1.8.0/bin/sumo.exe
路径自己改,注意要python环境
参考:网络仿真OMNET之车联网VEINS+SUMO联合仿真示例_哔哩哔哩_bilibili