【问题标题】:Changing Traffic Light Colour ERROR in Omnet++/Veins, SUMO在 Omnet++/Veins、SUMO 中更改交通灯颜色错误
【发布时间】: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>

有谁知道我可以做些什么来完成这项工作,或者我是否使用错误的方法来实现交通灯颜色的变化。

提前致谢!

【问题讨论】:

    标签: omnet++ veins sumo


    【解决方案1】:

    如果我正确阅读了您的 tls.tls.xml 文件,您的红绿灯“n7”确实只有一个程序可供选择。只有红绿灯“10”有三个程序可供选择。

    【讨论】:

    • 感谢@Cristoph Sommer 的快速回复,很抱歉,我提供了一个过时的 xml 文件,我已经对其进行了编辑,所以现在它应该是它应该的样子,但是发生同样的错误
    猜你喜欢
    • 1970-01-01
    • 2021-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-19
    • 1970-01-01
    相关资源
    最近更新 更多