在 SUMO 和 OMNeT++ 中创建交通灯

编程入门 行业动态 更新时间:2024-10-25 18:36:40
本文介绍了在 SUMO 和 OMNeT++ 中创建交通灯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我如何在 OMNeT++ 和 SUMO 中创建交通 灯,我必须创建交通灯并使用静脉示例在 XML 文件中配置该文件.

How I can create traffic light in OMNeT++ and SUMO, i have to create the traffic light and configure in XML file from which file using veins example.

推荐答案

适用于 SUMO 交通灯的 OMNeT++ 代理模块自 Veins 4.7 起可用.

The OMNeT++ proxy modules for SUMO traffic lights are available since Veins 4.7.

如果您的网络包含交通灯,则需要将以下几行添加到您的 omnetpp.ini 文件中:

If you have a network including a traffic light, you need to add the following lines to your omnetpp.ini file:

*.manager.trafficLightModuleType = "org.car2x.veins.nodes.TrafficLight" *.manager.trafficLightModuleName = "trafficLight" *.manager.trafficLightModuleDisplayString = default *.manager.trafficLightFilter = "MYTRAFFICLIGHTID" *.trafficLight[*].mobility.x = 0 *.trafficLight[*].mobility.y = 0 *.trafficLight[*].mobility.z = 3 *.trafficLight[*].applType = "YOURAPPLAYERTYPE" *.trafficLight[*].logicType = "YORUTRAFFICLIGHTLOGIC"

术语 MYTRAFFICLIGHTID 需要替换为您在 SUMO 网络中使用的 ID.如果您要控制多个交通灯,您可以列出用空格分隔的 SUMO ID.

The term MYTRAFFICLIGHTID needs to be replaced with the ID you're using in your SUMO network. If you have multiple traffic lights to control, you can list SUMO IDs separated by spaces.

交通灯由应用程序(YOURAPPLAYERTYPE)和逻辑(YORUTRAFFICLIGHTLOGIC)组成.这两个属性都是必需的,需要在您的 omnetpp.ini 中指定.

A traffic light consists of an application (YOURAPPLAYERTYPE) and a logic (YORUTRAFFICLIGHTLOGIC). Both properties are mandatory and need to be specified in your omnetpp.ini.

在当前的 Veins 主分支中,YOURAPPLAYERTYPE 是一个 OMNeT++ 模块,它使用 DemoBaseApplLayer 作为基础模块.

In the current Veins master branch, the YOURAPPLAYERTYPE is an OMNeT++ module, that uses the DemoBaseApplLayer as a the base module.

class YOURAPPLAYERTYPE: public DemoBaseApplLayer { .... }

YORUTRAFFICLIGHTLOGIC 是一个 OMNeT++ 模块,它使用 TraCITrafficLightAbstractLogic 作为基础模块.

The YORUTRAFFICLIGHTLOGIC is an OMNeT++ module, that uses the TraCITrafficLightAbstractLogic as a the base module.

class YORUTRAFFICLIGHTLOGIC: public TraCITrafficLightAbstractLogic{ .... }

更多推荐

在 SUMO 和 OMNeT++ 中创建交通灯

本文发布于:2023-10-30 11:34:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542735.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:交通灯   SUMO   OMNeT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!