SUMO入门(三) - 路网

SUMO入门(三) - 路网

Networks/SUMO Road Networks
SUMO network file 网络文件描述了交通相关的地图、道路和交叉口。

虽然XML文件我们可读,但SUMO网络文件并不是手工编辑的
您可以将SUMO XML描述文件与NETCONVERT一起使用;
您还可以使用NETCONVERT以各种格式转换现有地图;
或使用NETGENERATE生成几何简单的抽象路线图。
要修改现有的 .net.xml 文件,您可以使用NETCONVERT和补丁文件加载它。您也可以使用NETEDIT构建自己的道路网络,或重新处理从NETCONVERT或NETGENERATE获得的道路网络。

注意:从自定义输入数据创建SUMO网络时,建议的方法是创建 plain-xml-files,并使用 NETCONVERT 将这些文件转换为 .net.xml 文件。 试图直接生成 .net.xml 文件充满了危险。


SUMO道路网络被编码为XML文件。 网络使用笛卡尔坐标,其中最左边的节点在 x = 0,而最底部的节点在 y = 0。

Edges and Lanes

Normal Edges

“正常”边缘是两个节点 (“junctions”) 之间的连接。

<edge id="" from="" to="" priority="">
     ... one or more lanes ...
edge>

这里,ID(上例中的< ID >)是网络导入期间读取的ID。 begin和end节点的ID分别在from和to的属性中给出。 优先级是一个抽象序号,用于确定路权规则。 上面的示例中省略了function属性,因为它默认为“normal”,normal表示edge是道路网络的平原部分,如高速公路或连接两条道路的普通街道。

edge属性如下:

Name Type Description
id id (string) The id of the edge
from id (string) The id of the node it starts at
to id (string) The id of the node it ends at
priority integer Indicates how important the road is (optional)
function enum ( “normal”, “internal”, “connector”, “crossing”, “walkingarea” ) An abstract edge purpose (optional with default “normal”)

Lanes

每条边edge包括它所包含的车道lane的定义。 以下示例显示了具有两个车道的单个边。 注意,坐标可以是2D也可以是3D。

<edge id="" from="" to="" priority="">
    <lane id="_0" index="0" speed="" length="" shape="0.00,495.05 248.50,495.05"/>
    <lane id="_1" index="1" speed="" length="" shape="0.00,498.35,2.00 248.50,498.35,3.00"/>
edge>

lane-idedge-ID和一个running number组成,由下划线 “_” 进行分隔。对于最右边的车道,running number从零开始。 “index”属性中也给出了相同的数字。 车道也按此号码排序。

lane属性如下:

Name Type Description
id id (string) The id of the lane
index running number (unsigned int) A running number, starting with zero at the right-most lane
speed float The maximum speed allowed on this lane [m/s]
length float The length of this lane [m]
shape position vector The geometry of the lane, given by a polyline that describes the lane’s centre line

Note:“shape” must not be empty or have less than two positions


Internal Edges

An internal edge lies within an intersection and connects and incoming normal edge with an outgoing normal edge.
Internal edges are not included if the network was built using the --no-internal-links option. An example of an internal edge may look like this:

    <edge id="" function="internal">
        ... one lane ...
    edge>

internal edge的id由以下组成: _
:edge所在节点的ID
:在节点周围顺时针的running number(从北部开始)

Please note that the ID has a ‘:’ as prefix.
If the incoming and outgoing edges connected by the internal edge have multiple lanes, the internal edge has multiple lanes as well (according to the number of connections between these two edges).
In case of multi-lane internal edges, the INDEX jumps by the number of of lanes so that
EDGE_INDEX + LANE_INDEX = CONNECTION_INDEX


internal edge属性如下:

Name Type Description
id id (string) The id of the internal edge
function “internal” Always “internal” for an internal edge

Traffic Light Programs

交通灯程序定义了交通信号灯的相位。

    <tlLogic id="" type="" programID="" offset="">
        <phase duration="" state=""/>
        <phase duration="" state=""/>
        ... further states ...
        <phase duration="" state=""/>
    tlLogic>

有关属性和语义的说明,请参阅Simulation/Traffic Lights。 请注意,通常生成的程序的ID为“0”。


Junctions

Plain Junctions

Junctions交汇处代表不同溪流交叉的区域,包括车辆在穿越交叉路口时必须遵循的道路规则。 一个例子可能是:

    <junction id="" type="" x="" y="" 
              incLanes="" intLanes="" 
              shape="">
        ... requests ...
    junction>

internal edge属性如下:

Name Type Description
id id(string) 交叉口的id; 请注意,控制此交叉口的交通灯必须使用相同的ID
x x-position(real) 交点的x坐标
y y-position(real) 交点的y坐标
z z-position(real) 交叉点的(可选)z坐标
incLanes id list The ids of the lanes that end at the intersection; 顺时针方向排序,方向向上= 0
intLanes id list The IDs of the lanes within the intersection
shape position list 描述交叉点的道路边界的多边形
customShape bool 无论形状是由用户自定义的(因此不应由NETCONVERT或NETEDIT重建),默认为False

Connections

Plain Connections

Plain connections or “links” describe which outgoing lanes can be reached from an incoming lane.
另外,给出了用于通过交叉口的第一车道。 附加信息描述了connection 的方向和“状态”。 如果connection 由交通灯控制,则给出交通灯的名称和在交通灯的相位定义内控制该连接的信号的索引。

<connection from="" to="" fromLane="" toLane="" 
                via="" tl="" linkIndex="12" dir="r" state="o"/>
Name Type Description
from edge id (string) The ID of the incoming edge at which the connection begins
to edge id (string) The ID of the outgoing edge at which the connection ends
fromLane index (unsigned int) The lane of the incoming edge at which the connection begins
toLane index (unsigned int) The lane of the outgoing edge at which the connection ends
via lane id (string) The id of the lane to use to pass this connection across the junction
tl traffic light id (string) The id of the traffic light that controls this connection
linkIndex index (unsigned int) The index of the signal responsible for the connection within the traffic light
dir enum The direction of the connection
state enum The state of the connection

dir:“s” = straight, “t” = turn, “l” = left, “r” = right, “L” = partially left, R = partially right, “invalid” = no direction
state:"-" = dead end, “=” = equal, “m” = minor link, “M” = major link, traffic light only: “O” = controller off, “o” = yellow flashing, “y” = yellow minor link, “Y” = yellow major link, “r” = red, “g” = green minor, “G” green major



你可能感兴趣的:(SUMO)