如何使用 jtrrouter 在 Sumo 中定义车辆最大速度

How to define vehicle maximum speed in Sumo using jtrrouter

我通过转向概率在 Sumo 中使用 jtrrouter 生成了车辆。我先定义一个车流和转弯概率如下:

<routes>
  <flow id="0" from="e1" begin="0" end="1200" number="180"/>
  <flow id="1" from="e3" begin="0" end="1200" number="180"/>
  <flow id="3" from="e5" begin="0" end="1200" number="180"/>
  <flow id="4" from="e7" begin="0" end="1200" number="180"/>
</routes>

<turns>
    <interval begin="0" end="1200">
        <fromEdge id="e3">
            <toEdge id="e6" probability="0.2"/>
            <toEdge id="e8" probability="0.4"/>
            <toEdge id="e2" probability="0.4"/>
        </fromEdge>

        <fromEdge id="e1">
            <toEdge id="e4" probability="0.3"/>
            <toEdge id="e6" probability="0.2"/>
            <toEdge id="e8" probability="0.5"/>
        </fromEdge>

        <fromEdge id="e7">
            <toEdge id="e2" probability="0.28"/>
            <toEdge id="e4" probability="0.55"/>
            <toEdge id="e6" probability="0.17"/>
        </fromEdge>

        <fromEdge id="e5">
            <toEdge id="e8" probability="0.06"/>
            <toEdge id="e2" probability="0.69"/>
            <toEdge id="e4" probability="0.25"/>
        </fromEdge>


    </interval>
</turns>

然后会生成s个这样的车辆序列:

<routes>
    <vehicle id="0.0" depart="0.00" departSpeed="10">
        <route edges="e1 e8"/>
    </vehicle>
    <vehicle id="1.0" depart="0.00" departSpeed="10">
        <route edges="e3 e8"/>
    </vehicle>
    <vehicle id="3.0" depart="0.00" departSpeed="10">
        <route edges="e5 e2"/>
    </vehicle>
    .
    .
    .
<routes>

但是如果我们想使用这种方法来定义此类车辆的最大速度,我们应该怎么做呢?我们需要在哪里包括速度。谢谢

最大速度是 属性 车辆类型定义 vType。我建议您创建一个文件 my_vType_definition.add.xml,其中您使用 maxSpeed 创建 vType。它看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>

<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd">
    <vType id="my_vtype"  vClass="passenger" carFollowModel="IDM" maxSpeed="13.9" speedDev="0.1">
    <!-- maxSpeed is in m/s so 13.9 ~= 50 km/h -->
    </vType>
</additional>

那么您的 flow 定义可以包括这样的车辆类型:

<routes>
  <flow id="0" type="my_vType" from="e1" begin="0" end="1200" number="180"/>
  <!-- ... -->
</routes>

需要将带有新 vType 的文件作为附加文件添加到您的配置文件 (sumocfg) 中。可能还需要使用 -d <FILE>--additional-files <FILE> 参数将其添加到 jtrouter

然后jtrrouter应该生成最大速度的车辆。