Sumo 需求建模_Vehicles, Vehicle Types, and Routes 的定义

Sumo 中的一个车辆由三部分组成:

  • 描述车辆物理性能的车辆类型
  • 车辆走过的路径
  • 车辆本身

Vehicles and Routes

私有路径的一辆车:

<routes>
    <vType id="type1" accel="0.8" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>

    <vehicle id="0" type="type1" depart="0" color="1,0,0">
      <route edges="beg middle end rend"/>
    </vehicle>

</routes>

两辆车共用一条路径:

<routes>
    <vType id="type1" accel="0.8" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>

    <route id="route0" color="1,1,0" edges="beg middle end rend"/>

    <vehicle id="0" type="type1" route="route0" depart="0" color="1,0,0"/>
    <vehicle id="1" type="type1" route="route0" depart="0" color="0,1,0"/>

</routes>

Repeated vehicles (Flows)

<flow id="type1" color="1,1,0"  begin="0" end= "7200" period="900" type="BUS">
    <route edges="beg middle end rend"/>
    <stop busStop="station1" duration="30"/>
</flow>

flow 的加载车流有3个可用属性: vehsPerHour,period,probability。三个不能同时使用,一个 flow 加载车流只能使用三者之一。

Routes

编辑 routes 时,需要注意:

  • routes 的 edge 必须是连接的。如果您希望看到车辆只是在当前边缘的末端停止,并且可能在等待一段时间后“传送”到下一个边缘的行为,请使用选项 --ignore-route-errors
  • routes 至少包含一个 edge
  • routes 必须按开始时间排序。事实上,只有当你定义了很多路线或者在出发时间之间有很大的间隙时,这才有意义。
    以上前两个条件可以被 <SUMO_HOME>/tools/route/routecheck.py 检查,第三个可以被 <SUMO_HOME>/tools/route/sort_routes.py 维修。

Incomplete Routes (trips and flows)

在这种情况下,模拟基于出发/流量开始时网络中发现的流量条件执行最快的 routes。

<routes>
  <trip id="t" depart="0" from="beg" to="end"/>
  <flow id="f" begin="0" end="100" number="23" from="beg" to="end"/>
  <flow id="f2" begin="0" end="100" number="23" from="beg" to="end" via="e1 e23 e7"/>
</routes>
Traffic assignment zones (TAZ)

也可以让车辆离开和到达交通分配区域(TAZ)(交通小区)

<routes>
  <trip id="t" depart="0" fromTaz="taz1" toTaz="taz2"/>
</routes>
<additional>
  <taz id="<TAZ_ID>" edges="<EDGE_ID> <EDGE_ID> ..."/>
  ...
</additional>

A Vehicle’s depart and arrival parameter

departSpeed

插入的车辆速度的确定,maxSpeed = MIN(speedLimit * speedFactor, vTypeMaxSpeed)

  • ≥0: 车辆试图用给定的速度插入,如果速度不安全,车辆的到达将会延误。
  • random”: 采用 0 到 maxSpeed 之间的随机速度,速度将会被调整以保证与前车的安全距离。
  • max”: 使用的最大速度,为了确保与前车保持安全距离,速度将会被调整。
  • desired”: 使用 maxSpeed。如果这个速度不安全,到达将会延迟。
  • speedLimit”: 使用车道的限制速度。如果这个速度不安全,到达将会延迟。

Vehicle Types

使用 vType 元素定义一个车辆:

<routes>
    <vType id="type1" accel="2.6" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>
</routes>

有了这个定义,你就可以定义车辆类型 “type1” 。上面使用的值大多数实例使用的值。

<routes>
    <vType id="type1" accel="2.6" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>
    <vehicle id="veh1" type="type1" depart="0">
        <route edges="edge1 edge2 edge3"/>
    </vehicle>
</routes>
<routes>
    <vType id="type1" length="5" maxSpeed="70" carFollowModel="Krauss" accel="2.6" decel="4.5" sigma="0.5"/>
</routes>

Speed Distributions

车队中不同车辆的行驶速度是不同的。在 Sumo 中,通过使用 speedFactor 或 speedDev 属性的速度分布来建模的。

Vehicle class specific defaults

将使用以下默认速度偏差。

  • passenger (default vClass): 0.1
  • pedestrian: 0.1
  • bicycle: 0.1
  • truck, trailer, coach, delivery, taxi: 0.05
  • tram, rail_urban, rail, rail_electric, rail_fast: 0
  • emergency: 0
  • everything else: 0.1
Global Configuration

sumo-option --default.speeddev 可以用来设置全局的默认值。

Defining speed limit violations explicitly

每辆车都有一个独立的 speed factor,它与 speed limit (edge speed) 相乘确定期望的驾驶速度,speed factor 的默认值为 1.0。speed factor 为1.2的车辆比 speed limit 高20%,而 speed factor 为 0.8 的车辆则总是比 speed limit 低20%。通过如下所示设置属性 speedFactor 和 speedDev,一种类型 (type) 的所有车辆的 speed factor 可以设置为一个固定值。

<vType id="example" speedFactor="1.2" speedDev="0">
Defining a normal distribution for vehicle speeds

车队中不同车辆的期望行驶速度是不同的。
参数可以被指定为 “norm(mean, dev)” or “normc(mean, dev, min, max)”.
使用 speedFactor=“normc(1,0.1,0.2,2)” 将会得到一个车速分布,这个车速分布为 95% 的车辆的行驶速度在限制速度的 80% 到 120% 之间。

Defining a normal distribution (old style)

指定速度分布的另一种方法是为 speedFactor 和 speedDev 使用数值。
在这种情况下,speedFactor 定义了期望值,而 speedDev 定义了偏差。
当使用这种格式时,不能控制封顶,车速将总是默认为20%和200%。

Different distributions for cars and trucks

在一些道路上,cars 和 trucks 可能会有不同的速度限制。
注意,给定的 type id 指的是 edge type 而不是 vehicle type 。

<type id="a" priority="3" numLanes="3" speed="38.89"/>
   <restriction vClass="truck" speed="27.89"/>
</type>
Additional remarks on speed distributions

当用于行人时,speedFactor属性将直接应用于vType的最大速度,因为速度限制不适用于行人
如果车辆指定的 departSpeed 超过了速度限制,而它的 vType 有 speedFactor deviation > 0,则个别选择的 speed multiplier 至少足够高,以适应规定的离车速度。

Vehicle Length

length-attribute 描述车辆本身的长度.
minGap-attribute 描述在遇到堵塞时与前车的偏移量。
在模拟中,每辆车都需要——当忽略安全间隙时——length+minGap。但是只有道路的长度应该被标记为被占用

Abstract Vehicle Class

Sumo 中一辆车可以被指定为一个 “abstract vehicle class”,使用属性vClass定义。
这些 class 用于车道定义,允许/不允许某些车辆使用车道。
人们可能会想到有一条三车道的道路,其中最右边的车道可能只供“taxis”或“buses”使用。
默认的车辆类是passenger(表示普通的乘用车)。
注意
由于车辆 vClass 和道路许可之间的不匹配,路由或插入可能失败。这可以在 sumo-gui 中根据高亮 edge 诊断其权限。

Vehicle Emission Classes

emission 类代表一个特定的 emission 类。它是使用 emissionClassattribute 定义的。

Visualization

为了更好地显示交通,可以通过使用 guiShape attribute 为车辆指定一个特定的形状来改变车辆类型的外观。已知的形状如下:

  • “pedestrian”
  • “bicycle”
  • “motorcycle”
  • “passenger”
  • “delivery”
  • “truck”
  • “truck/trailer”
  • “bus”
  • “rail” (24.5)
  • “evehicle”
  • “ship”
    更多的的参数可用于实现单个列车车厢的可视化。
<vType id="rail">
    <param key="carriageLength" value="20"/>
    <param key="carriageGap" value="1"/>
    <param key="locomotiveLength" value="25"/>   
</vType>

Car-Following Models

要选择一个汽车跟随模型,应该使用以下语法:

<vType id="idmAlternative" length="5" minGap="2" carFollowModel="IDM" tau="1.0" .../>
Default Krauss Model Description

实现的模型遵循与 Krauß 相同的思路,即:在保持完美安全的同时,让车辆尽可能快地行驶。

Lane-Changing Models

在 中设置如下参数:

<vType id="myType" lcStrategic="0.5" lcCooperative="0.0"/>

Junction Model Parameters

在 中设置如下参数:

<vType id="ambulance" jmDriveAfterRedTime="300" jmDriveAfterRedSpeed="5.56"/>

Default Vehicle Type

如果车辆 type attribute 没有被设置为它的默认值 "DEFAULT_VEHTYPE". 通过用这个 id 定义车辆类型 (<vType id="DEFAULT_VEHTYPE" ..../>)可以更改没有显式定义类型的车辆的默认参数。
默认车辆类型的更改需要在对该类型进行任何引用之前发生,所以基本上是在定义任何车辆或车辆类型之前。所以它应该总是在第一个路由文件的顶部。

Route and vehicle type distributions

sumo 可以在运行时从给定的 distribution 中选择它们,而不是为车辆显式地定义 routes 和vtype。为了使用这个特性,只需要将 distributions 定义如下:

Vehicle Type Distributions

<routes>
    <vTypeDistribution id="typedist1">
        <vType id="type1" accel="0.8" length="5" maxSpeed="70" probability="0.9"/>
        <vType id="type2" accel="1.8" length="15" maxSpeed="50" probability="0.1"/>
    </vTypeDistribution>
</routes>
Using existing types
<routes>
    <vType id="type1" accel="0.8" length="5" maxSpeed="70" probability="0.9"/>
    <vType id="type2" accel="1.8" length="15" maxSpeed="50" probability="0.1"/>
    <vTypeDistribution id="typedist1" vTypes="type1 type2"/>
</routes>

Route Distributions

<routes>
    <routeDistribution id="routedist1">
        <route id="route0" color="1,1,0" edges="beg middle end rend" probability="0.9"/>
        <route id="route1" color="1,2,0" edges="beg middle end" probability="0.1"/>
    </routeDistribution>
</routes>

A distribution can be used just as using individual types and routes:

<routes>
    <vehicle id="0" type="typedist1" route="routedist1" depart="0" color="1,0,0"/>
</routes>

Stops

车辆可在规定的时间内被强制停车或等待行人,方法是将停车元素作为路线的一部分或车辆定义如下:

<routes>
    <route id="route0" edges="beg middle end rend">
        <stop lane="middle_0" endPos="50" duration="20"/>
    </route>
    <vehicle id="v0" route="route0" depart="0">
        <stop lane="end_0" endPos="10" until="50"/>
    </vehicle>
</routes>

Colors

在 vehicle、route 或 vType 中,颜色被定义为红色、绿色、蓝色。

<route id="r0" color="0,255,255"/>
<type id="t0" color="0,0,255"/>
<vehicle id="v0" color="255,0,0,0"/>

默认情况下,颜色组件应该是 (0,255) 范围内的整数,但也支持其他定义:

color="0.5, 0.5, 1.0"
color="#FF0000"
color="red"

Devices

车辆设备用于建模和配置不同的方面,如 output (device.fcd)或 behavior (device. rerrouting)。

Automatic assignment

一些设备被自动的指派。加载到模拟中的每一个 <trip> 都自动配备了一个重新路由设备来执行初始路由计算。

其他的设备,例如 fcd 将在 option –fcd-output 被设置时,自动分配。

Assignment by generic parameters

为车辆类型和单个车辆分配设备的另一个 option 是使用泛型(generic)参数。这可以通过以下方式为车辆或车辆类型定义它们来实现:

<routes>
    <vehicle id="v0" route="route0" depart="0">
        <param key="has.<DEVICENAME>.device" value="true"/>
    </vehicle>

    <vType id="t1">
        <param key="has.<DEVICENAME>.device" value="true"/>
    </vType>

    <vehicle id="v1" route="route0" depart="0" type="t1"/>
</routes>
SUMO(Simulation of Urban MObility)是一种交通模拟工具,用于对城市交通系统进行建模和仿真。而OSM(OpenStreetMap)是一种开放源码的地图数据项目,由志愿者共同创建和维护。 在进行SUMO路网建模时,可以使用OSM作为基础数据源。首先,通过OSM可以获取到真实世界中的道路网络数据,包括道路的形状、长度、连接关系以及车道数等信息。使用SUMO的OSM2SUMO工具,可以将OSM数据转换为SUMO所能识别的格式。这样,就可以在SUMO环境中使用这些道路网络数据。 借助OSM数据进行SUMO路网建模,可以有效地模拟城市交通系统,从而进行交通流量、交通拥堵、交通信号灯以及交通规划等方面的仿真研究。通过将现实世界中的道路网络数据导入SUMO,可以在SUMO中设置车辆流量、车辆速度、路口信号灯、车辆行为等参数,并通过仿真模拟不同交通状况下的车辆运行情况。 SUMO路网建模可以帮助交通规划者和决策者更好地了解城市交通系统的运行机理,评估交通政策和规划对交通状况的影响,优化交通路网布局、信号灯配时等,以提高交通效率和减少拥堵问题。 综上所述,SUMO可以通过使用OSM的地图数据进行交通路网建模,从而进行城市交通系统的仿真研究和交通规划优化。使用OSM提供的道路网络数据,可以帮助SUMO模拟真实世界中的交通状况,并为相关决策提供可靠的依据。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LouHerGetUp

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值