SUMO入门(三) - 使用XML定义网络

本文档介绍了如何使用XML来定义SUMO网络,包括节点描述、边描述、车道特定定义、边类型描述、连接描述和交通信号灯程序定义。通过示例详细解释了XML文件中的各项参数和用法。
摘要由CSDN通过智能技术生成

SUMO入门(三) - 使用XML定义网络

Networks/PlainXML
SUMO-Networks有两种表示形式:
– 一组 plain-xml 文件,描述网络拓扑和几何
– 加载到模拟中的 .net.xml 文件。 这包含许多生成的信息,例如交叉点内的结构和路权逻辑。


要定义网络,至少需要两个文件:一个用于node的文件,另一个用于它们之间的edge。Besides defining the nodes and edges, you can also join edge attributes by type and set explicit connections between edges or lanes。运行NETCONVERT来构建网络。

netconvert --node-files=MyNodes.nod.xml --edge-files=MyEdges.edg.xml
–output-file=MySUMONet.net.xml

netconvert --node-files=MyNodes.nod.xml --edge-files=MyEdges.edg.xml
–connection-files=MyConnections.con.xml --type-files=MyTypes.typ.xml
–output-file=MySUMONet.net.xml


Node Descriptions

在nodes-files中,通常具有扩展名 .nod.xml,每个节点都在一行中描述,如下所示:

<node id =<STRING> x =<FLOAT> y =<FLOAT> [type =<TYPE>] />

直括号(’[‘和’]’)表示参数type是可选的。
在这里插入图片描述
tlType
static: Each phase of the traffic light will last for a fixed duration
actuated: Green phases may be prolonged depending on traffic measurements from automatically added induction loops

type
priority:低优先级边缘的车辆必须等到高优先级边缘的车辆通过交叉点。
traffic_light:交叉点由交通灯控制。(如果冲突的链路同时绿灯,则使用优先级规则来避免冲突)。

traffic_light_unregulated:交叉点由交通信号灯控制,没有任何进一步的规则。如果使用不安全的信号规则,这可能会导致冲突。请注意,交叉点内的冲突不会检测到。

traffic_light_right_on_red:交叉点由交通灯控制,类型为traffic_light。此外,右转车辆可以在安全的情况下(在停止一次之后)在任何阶段行驶。此行为称为 right-turn-on-red。

//SUMO_HOME\docs\examples\netconvert\types\cross_notypes\input_nodes.nod.xml
<nodes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/nodes_file.xsd">
   <node id="0" x="0.0" y="0.0" type="traffic_light"/>

   <node id="1" x="-500.0" y="0.0" type="priority"/>
   <node id="2" x="+500.0" y="0.0" type="priority"/>
   <node id="3" x="0.0" y="-500.0" type="priority"/>
   <node id="4" x="0.0" y="+500.0" type="priority"/>

   <node id="m1" x="-250.0" y="0.0" type="priority"/>
   <node id="m2" x="+250.0" y="0.0" type="priority"/>
   <node id="m3" x="0.0" y="-250.0" type="priority"/>
   <node id="m4" x="0.0" y="+250.0" type="priority"/>
</nodes
  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值