问题描述
我想在 Ubuntu 20.04 中将 OMNeT++ 与 Veins 5.1、Sumo 1.8 一起使用,但我不断收到涉及 setApiVersion 的错误,建议使用 Sumo 0.32 或 Sumo 1.0.1。有没有办法克服这个问题并使用更高版本的相扑?
void TraCICommandInterface::setApiVersion(uint32_t apiVersion)
{
try {
versionConfig = versionConfigs.at(apiVersion);
TraCIBuffer::setTimeType(versionConfig.timeType);
}
catch (std::out_of_range const& exc) {
throw cRuntimeError(std::string("TraCI server reports unsupported TraCI API version: " + std::to_string(apiVersion) + ". We recommend using Sumo version 1.0.1 or 0.32.0").c_str());
}
}
解决方法
就我而言,代码是为早期版本的 SUMO 和 Veins 编写的。 cc 文件使用了不同的命名空间声明,使用驼峰式大小写而不是小写。更改为小写后,代码在 Sumo 1.8 和 Veins 5.1 中正常工作。