sumo - 在examples/sumo/grid.py上模拟,有几个检测器,如何获取数据
问题描述
在示例程序examples/sumo/grid.py
(
在代码文件中,有关于这些探测器的任何代码。
解决方案
关于如何添加检测器,我找到了解决方案:
在代码上:
tl_logic.add("center0", phases=phases, programID=1,detectorGap=1,showDetectors=True,tls_type="actuated")
tl_logic.add("center1", phases=phases, programID=1,detectorGap=1,showDetectors=True,tls_type="actuated")
tl_logic.add("center2", phases=phases, programID=1,detectorGap=1,showDetectors=True,tls_type="actuated")
tl_logic.add("center3", phases=phases, programID=1,detectorGap=1,showDetectors=True,tls_type="actuated")
tl_logic.add("center4", phases=phases, programID=1,detectorGap=1,showDetectors=True,tls_type="actuated")
tl_logic.add("center5", phases=phases, programID=1,detectorGap=1,showDetectors=True,tls_type="actuated")
有一个小问题是关于detectorGap
,关于params.py/TrafficLightParams
,关于detectorGap的描述是:
detectorGap : int, optional
used for actuated traffic lights
determines the time distance between the (automatically generated)
detector and the stop line in seconds (at each lanes maximum
speed), **used for actuated traffic lights**
所以,我设置detectorGap =1,最大速度=35km/h,探测器的距离为:最大速度(km/h?)*detectorGap(s)。我的理解对吗?@nathanlct
推荐阅读
- c - C 预处理器宏扩展 - 使用计算
- react-native - 在 Bare React Native 项目中启用深色主题
- python - 将字符串列表转换为具有类型的熊猫数据框
- windows - Git 符号引用中使用什么字符编码(尤其是在 Windows 上)?
- java - 大表和小表的休眠动态更新性能
- javascript - 代码不能正常工作,而昨晚它工作得很好
- angular - Typescript 错误 ts(2352):如何摆脱对从 proto 文件生成的 gRPC 类型的“未知”类型对话
- python - 无法从“typing_extensions”导入名称“TypeGuard”
- jquery - 声明的函数 ($.fn) 不是函数
- reactjs - NextJS:如何验证动态文件夹中的 ID?