【发布时间】:2019-03-04 22:49:03
【问题描述】:
我已尝试使用以下问题 (How can I get a traffic light that exists in sumo and change its phase in veins?) 中提供的解决方案,但是,当我尝试更改程序时,出现以下错误提示命令“myProgramGreenRed”不存在于 tl“n7”中
红绿灯 id 是 n7、n8 和 n9,给我带来麻烦的代码是:
tl.setProgram("myProgramGreenRed");
tl.setPhaseIndex(1);
tls.tls.xml 文件如下所示
<tls>
<tlLogic id="10" type="static" programID="myProgramRed" offset="0">
<phase duration="999" state="GggGGgrrr"/>
<phase duration="999" state="GggGGgrrr"/>
</tlLogic>
<tlLogic id="10" type="static" programID="myProgramGreen" offset="0">
<phase duration="999" state="rrrrrrGGG"/>
<phase duration="999" state="rrrrrrGGG"/>
</tlLogic>
<tlLogic id="n7" type="static" programID="myProgramGreenRed" offset="0">
<phase duration="999" state="rrrrrrrrr"/>
<phase duration="999" state="rrrrrrrrr"/>
</tlLogic>
<tlLogic id="10" type="static" programID="myProgramGreenRed" offset="0">
<phase duration="999" state="rrrrrrGGG"/>
<phase duration="999" state="GggGGgrrr"/>
</tlLogic>
<tlLogic id="n9" type="static" programID="myProgramCRL" offset="0">
<phase duration="999" state="rrrrrrrrr"/>
<phase duration="999" state="rrrrrrrrr"/>
</tlLogic>
<tlLogic id="n8" type="static" programID="myProgramCRL" offset="0">
<phase duration="999" state="rrrrrrrrr"/>
<phase duration="999" state="rrrrrrrrr"/>
</tlLogic>
<tlLogic id="n7" type="static" programID="myProgramCRL" offset="0">
<phase duration="999" state="rrrrrrrrr"/>
<phase duration="999" state="rrrrrrrrr"/>
</tlLogic>
</tls>
有谁知道我可以做些什么来完成这项工作,或者我是否使用错误的方法来实现交通灯颜色的变化。
提前致谢!
【问题讨论】: