更改Omnet ++/Veins,SUMO中的交通信号灯颜色错误 [英] Changing Traffic Light Colour ERROR in Omnet++/Veins, SUMO

查看:122
本文介绍了更改Omnet ++/Veins,SUMO中的交通信号灯颜色错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下问题中提出的解决方案(

I've tried using the solution presented in the following question (How can I get a traffic light that exists in sumo and change its phase in veins?), however, the following error appears about the command "myProgramGreenRed" not existing for tl "n7", when I try to change the program

交通信号灯ID是n7,n8和n9,给我带来麻烦的代码是:

The traffic lights ids are n7, n8, and n9 and the piece of code that gives me trouble is :

tl.setProgram("myProgramGreenRed");
tl.setPhaseIndex(1);

和tls.tls.xml文件如下所示

and the tls.tls.xml file looks like the following

   <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>

有人知道我该怎么做才能完成这项工作,或者我是否使用错误的方法来实现交通信号灯颜色的改变.

Does anybody know what can I do to make this work, or if I'm using the wrong approach to achieve the changing of the traffic lights colours.

提前谢谢!

推荐答案

如果我正确阅读了tls.tls.xml文件,则您的交通信号灯"n7"实际上只有一个程序可供选择.只有交通信号灯"10"有三个程序可供选择.

If I read your tls.tls.xml file right, your traffic light "n7" has, indeed, only one program to choose from. Only traffic light "10" has three programs to choose from.

这篇关于更改Omnet ++/Veins,SUMO中的交通信号灯颜色错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆