SUMO入門(四) - 需求建模 車輛和路線的定義

SUMO入門(四) - 需求建模 車輛和路線的定義

Demand/Introduction to demand modelling in SUMO

在生成網絡之後,可以使用SUMO-GUI來查看它,但是沒有汽車可以行駛。人們仍然需要對車輛進行某種描述,這稱爲交通需求traffic demand

從現在開始,我們將使用以下術語:
行程 trip 是由起始邊緣,目的地邊緣和出發時間定義的從一個地方到另一個地方的車輛移動。
路線 route 是擴展的行程 trip,這意味着路線定義不僅包含第一個和最後一個邊,而且還包含車輛將通過的所有邊。


SUMO和SUMO-GUI需要路線 route 作爲車輛運動的輸入。有幾種方法可以爲SUMO生成路線 route:

1)Using trip definitions
行程 trip 至少包括起始、結束邊緣以及出發時間。當您想要手動創建需求或編寫自己的腳本以導入自定義數據時,這非常有用。您可以使用DUAROUTER將您的行程trip轉變爲路線route。 DUAROUTER is responsible for importing routes or their definitions from other simulation packages and for computing routes using the shortest-path algorithm by Dijkstra.

2)Using flow definitions
This is mostly the same approach as using trip definitions, but one may join vehicles having the same departure and arrival edge using this method

3)Using OD-matrices
Origin-Destination-Matrices(或OD-matrices)通常可從交通管理部門獲得。必須使用OD2TRIPS將它們轉換爲行程 trip。

4)By hand
You can of course generate route XML-files by hand


Definition of Vehicles, Vehicle Types, and Routes

Definition of Vehicles, Vehicle Types, and Routes

有各種應用程序可用於定義SUMO的車輛需求。 當然,也可以手動定義需求文件。 在開始之前,重要的是要知道SUMO中的車輛由三部分組成:描述車輛物理特性的車輛類型,車輛應走的路線,和車輛本身

Vehicles

最初,我們定義一輛帶有他自己的路線的車輛:

<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>

通過向SUMO(或SUMO-GUI)提供這樣的路徑定義,SUMO將構建一個id爲“0”、類型爲“type1”、紅色(顏色= 1,0,0)的車輛,該車輛在時間0開始。車輛將沿着街道 “beg”, “middle”, “end”,一旦它已經到達邊緣"rend",它將從仿真中移除


該車輛有自己的內部路線,不與其他車輛共用。 也可以使用相同的路線定義兩輛車。 在這種情況下,路線必須“外部化” - 在車輛引用路線之前定義。 此外,路線必須通過一個id來命名。 使用該路線的車輛使用“route”屬性引用它。 如下所示:

<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>

A vehicle may be defined using the following attributes:
在這裏插入圖片描述

Vehicle Types

A vehicle is defined using the vType element as shown below:

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

Having defined this, one can build vehicles of type “type1”. The values used above are the ones most of the examples use. They resemble a standard vehicle as used within the Stefan Krauß’ thesis.

<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>

該定義是初始定義,包括車輛“純物理”參數的定義,例如其長度,顏色或最大速度,以及使用的汽車跟隨模型的參數。
默認的汽車跟隨型號基於Krauß的工作,但也可以選擇其他型號。 通過設置進一步的vType-attribures來完成模型選擇和參數化,如下所示:

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

在這裏插入圖片描述

Vehicle Class

可以使用vClass屬性將SUMO車輛分配爲定義的“抽象車輛類”。 這些類用於車道定義,車道允許/禁止使用某些車輛類型。 人們可能會想到有一條有三條車道的道路,最右邊的道路只能由“出租車”或“公共汽車”使用。 默認車輛類別是乘客(表示普通乘用車)。
在這裏插入圖片描述

Vehicle Class

A color is defined as red,green,blue or red,green,blue,alpha either in a vehicle, route or vType.

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

In the default visualization settings, the vehicle color will be used if define, otherwise the type and finally the route color.


Visualization

可視化。爲了更好地觀察交通,可以通過使用guiShape屬性爲其分配特定形狀來改變車輛的外觀。 當將車輛的繪製模式設置爲簡單形狀時,使用這些形狀。 以下形狀是已知的:
在這裏插入圖片描述

Routes

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

在這裏插入圖片描述

Repeated vehicles (Flows)

It is possible to define repeated vehicle emissions ("flow"s), which have the same parameters as the vehicle except for the departure time.
創建的車輛的id是“flowId.runningNumber”,它們在給定的間隔內平均分配。

<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>

在這裏插入圖片描述

Incomplete Routes (trips and flows)

模擬的需求信息也可以採用起始、目的邊緣的形式,而不是完整的邊緣列表。 在這種情況下,模擬根據交通狀況來執行最快路徑路由。 可選地,可以使用via屬性指定中間邊緣列表。

<vehicles>
  <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"/>
</vehicles>

the following attributes are supported for incomplete routes (trips and flows):
在這裏插入圖片描述



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章