SUMO应用工具:SUMO

本文详细介绍SUMO交通仿真系统的使用方法,包括参数配置、输入输出选项、时间控制及处理方式等内容。此外还介绍了不同仿真模式下的特殊设置,以及如何在仿真过程中处理各种设备和通信情况。

1、From 30.000 feet(相当于概览,不懂怎么翻译)

SUMO本事就是仿真的程序,它是微观的、空间上的连续、时间离散的交通流仿真。

目的:仿真一个定义好的脚本文件

系统:Linux/windows已经测试了;在命令行下运行;

输入(强制的)

Ø  道路网络,由netconvert或者netgenerate生成,具体可以查看页面: Building Networks

Ø  一系列路由,由daurouter、jtrrouter、dfrouter或者activitygen生成,具体可以参考:Definition of Vehicles, Vehicle Types, and Routes

输入(可选的):交通灯、变速标志、输出检测器等的附加定义。

输出:有多种生成文件的类型,具体可以参考SUMO-GUI

编程语言:C++

2、用法描述

2.1参数选项

你可能用到相应的xml验证文件用来设置配置文件: sumoConfiguration.xsd

2.1.1配置

Option选项

Description描述

-c <FILE>
--configuration-file <FILE>

Loads the named config on startup

在运行开始前加载配置文件

--save-configuration <FILE>

Saves current configuration into FILE

保存目前的配置到文件

--save-template <FILE>

Saves a configuration template (empty) into FILE

保存一个配置模板到文件

--save-schema <FILE>

Saves the configuration schema into FILE

保存配置验证到文件

--save-commented <BOOL>

Adds comments to saved template, configuration, or schema; default: false

增加评论到模板、配置文件或者验证文件。

2.1.2输入

Option

Description

-n <FILE>
--net-file <FILE>

Load road network description from FILE

从文件中加载道路路网描述

-r <FILE>
--route-files <FILE>

Load routes descriptions from FILE(s)

从文件中加载路由描述

-a <FILE>
--additional-files <FILE>

Load further descriptions from FILE(s)

从问价中加载更多的描述

-w <FILE>
--weight-files <FILE>

Load edge/lane weights for online rerouting from FILE

从文件中加载用于在线重路由的道路或者车道的权重

-x <STRING>
--weight-attribute <STRING>

Name of the xml attribute which gives the edge weight;default: traveltime

--load-state <FILE>

Loads a network state from FILE

从问价中加载网络状态

--load-state.offset <TIME>

Shifts all times loaded from a saved state by the given offset; default: 0

2.1.3输出

Option

Description

--output-prefix <STRING>

Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time.

应用于所有输出文件的前缀。特殊的符号“TIME”被当前的时间所代替。

--netstate-dump <FILE>

Save complete network states into FILE

保存完整的网络状态到文件。

--netstate-dump.empty-edges <BOOL>

Write also empty edges completely when dumping;default: false

当输出时,也写入空的道路(默认为false)

--netstate-dump.precision <INT>

Write positions and speeds with the given precision (default 2); default: 2

使用给定的精度写入位置和速度(默认为2)

--emission-output <FILE>

Save the emission values of each vehicle

保存每辆车的排放值。

--emission-output.precision <INT>

Write emission values with the given precision (default 2); default: 2

使用给定的精度写入排放值(默认为2)

--battery-output <FILE>

Save the battery values of each vehicle

保存每辆车的电量值。

--battery-output.precision <INT>

Write battery values with the given precision (default 2); default: 2

使用给定的精度写入电池电量

--fcd-output <FILE>

Save the Floating Car Data

保存浮动车数据

--fcd-output.geo <BOOL>

Save the Floating Car Data using geo-coordinates (lon/lat); default: false

使用地理坐标保存浮动车数据

--fcd-output.signals <BOOL>

Add the vehicle signal state to the FCD output (brake lights etc.); default: false

增加车辆的信号状态到FCD输出文件(刹车信号灯)默认为false

--full-output <FILE>

Save a lot of information for each timestep (very redundant)

保存每一个时间步长的信息(冗余信息)

--queue-output <FILE>

Save the vehicle queues at the junctions (experimental)

保存在节点的车辆队列(实验性质的)

--vtk-output <FILE>

Save complete vehicle positions inclusive speed values in the VTK Format (usage: /path/out will produce /path/out_$TIMESTEP$.vtp files)

保存完整的车辆位置,包括速度值。使用VTK格式。

--amitran-output <FILE>

Save the vehicle trajectories in the Amitran format

使用Amitran格式保存车辆的轨迹信息

--summary-output <FILE>

Save aggregated vehicle departure info into FILE

将汇总的车辆进入【翻译不准确,待实验】信息保存到文件中

--tripinfo-output <FILE>

Save single vehicle trip info into FILE

保存单辆车的轨迹信息

--tripinfo-output.write-unfinished <BOOL>

Write tripinfo output for vehicles which have not arrived at simulation end; default: false

当车辆没有仿真结束时,写入车辆的轨迹信息。

--vehroute-output <FILE>

Save single vehicle route info into FILE

保存单辆车的路由信息到文件。

--vehroute-output.exit-times <BOOL>

Write the exit times for all edges; default: false

写入所有道路的推出时间,默认为false

--vehroute-output.last-route <BOOL>

Write the last route only; default: false

写入最后一个路由。默认为false

--vehroute-output.sorted <BOOL>

Sorts the output by departure time; default: false

按照离开时间排序。默认为false

--vehroute-output.dua <BOOL>

Write the output in the duarouter alternatives style;default: false

使用duarouter格式输出

--vehroute-output.intended-depart <BOOL>

Write the output with the intended instead of the real departure time; default: false

输出预期的离开时间而不是真实的时间。

--vehroute-output.route-length <BOOL>

Include total route length in the output; default: false

在输出文件中包含了全部的路由长度

--vehroute-output.write-unfinished <BOOL>

Write vehroute output for vehicles which have not arrived at simulation end; default: false

输出在仿真结束仍没到达的车辆。默认为false

--link-output <FILE>

Save links states into FILE

保存连接状态到文件

--bt-output <FILE>

Save bluetooth visibilities into FILE (in conjunction with device.btreceiver and device.btsender)

保存蓝牙可见的到文件(结合device.btreceiver和device.btsender)

--lanechange-output <FILE>

Record lane changes and their motivations for all vehicles into FILE

记录所有车辆的车道变化和他们的运动到文件

--save-state.times {{DT_INT[]}}

Use INT[] as times at which a network state written

网络状态被写入,使用INT[]作为时间

--save-state.period <TIME>

save state repeatedly after TIME period; default: -1

反复保存时间周期的状态

--save-state.prefix <FILE>

Prefix for network states; default: state

网络状态的前缀

--save-state.suffix <FILE>

Suffix for network states (.sbx or .xml); default: .sbx

网络状态的后缀

--save-state.files <FILE>

Files for network states

网络状态的文件

 

2.1.4时间

Option

Description

-b <TIME>
--begin <TIME>

Defines the begin time in seconds; The simulation starts at this time; default: 0

设置启动时间,秒为单位。默认为0

-e <TIME>
--end <TIME>

Defines the end time in seconds; The simulation ends at this time; default: -1

设置结束时间,秒为单位。默认为0.

--step-length <TIME>

Defines the step duration in seconds; default: 1

定义步骤时间,秒为单位。默认为1.

 

2.1.5处理

Option

Description

--step-method.ballistic <BOOL>

Whether to use ballistic method for the positional update of vehicles (default is a semi-implicit Euler method).; default: false

是否使用弹道方法应用于车辆位置的更新(默认是semi-implicit Euler方法),默认为false

--lateral-resolution <FLOAT>

Defines the resolution in m when handling lateral positioning within a lane (with -1 all vehicles drive at the center of their lane; default: -1

在处理一个车道内的横向定位时定义m的分辨率,当是-1时,所有车辆均在车道的正中间行驶。

-s <TIME>
--route-steps <TIME>

Load routes for the next number of seconds ahead;default: 200

加载未来几秒的时间的路由,默认为200

--no-internal-links <BOOL>

Disable (junction) internal links; default: false

节点内部车道被禁用。默认为false

--ignore-junction-blocker <TIME>

Ignore vehicles which block the junction after they have been standing for SECONDS (-1 means never ignore);default: -1

在他们占用了几秒的时间后,忽视在节点拥堵的车辆。默认为-1,即从来不忽略。

--ignore-route-errors <BOOL>

Do not check whether routes are connected; default:false

不检查是否路由是连接的。默认false

--ignore-accidents <BOOL>

Do not check whether accidents occur; default: false

不检查是否事故发生,默认为false

--collision.action <STRING>

How to deal with collisions:[none,warn,teleport,remove]; default: teleport

如何解决碰撞[none,warn,teleport,remove]

--collision.check-junctions <BOOL>

Enables collisions checks on junctions; default: false

在节点处的碰撞检查。

--max-num-vehicles <INT>

Delay vehicle insertion to stay within the given maximum number; default: -1

延迟车辆的进入,给定最大值。默认为-1

--scale <FLOAT>

Scale demand by the given factor (by discarding or duplicating vehicles); default: 1

通过给定因素确定的规模需求。

--time-to-teleport <TIME>

Specify how long a vehicle may wait until being teleported, defaults to 300, non-positive values disable teleporting; default: 300

知道车辆被传送需要等待的时间,设置为负值的话,那么不能被传送。默认为300

--time-to-teleport.highways <TIME>

The waiting time after which vehicles on a fast road (speed > 69m/s) are teleported if they are on a non-continuing lane; default: 0

如果车辆在一个不连续的车道,车辆在快速道路(速度大于69m/s)的等待时间。默认值为0

--waiting-time-memory <TIME>

Length of time interval, over which accumulated waiting time is taken into account; default: 100

--max-depart-delay <TIME>

How long vehicles wait for departure before being skipped, defaults to -1 which means vehicles are never skipped; default: -1

--sloppy-insert <BOOL>

Whether insertion on an edge shall not be repeated in same step once failed; default: false

--eager-insert <BOOL>

Whether each vehicle is checked separately for insertion on an edge; default: false

--random-depart-offset <TIME>

Each vehicle receives a random offset to its depart value drawn uniformly from [0, TIME]; default: 0

--lanechange.duration <TIME>

Duration of a lane change maneuver (default 0);default: 0

--lanechange.overtake-right <BOOL>

Whether overtaking on the right on motorways is permitted; default: false

--tls.all-off <BOOL>

Switches off all traffic lights.; default: false

--pedestrian.model <STRING>

Select among pedestrian models ['nonInteracting', 'striping']; default: striping

选择行人的模型[“无相互作用的”,”条纹”],默认为条纹

--pedestrian.striping.stripe-width <FLOAT>

Width of parallel stripes for segmenting a sidewalk (meters) for use with model 'striping'; default: 0.65

隔离开来用于人行道的宽度,默认值为0.65米

--pedestrian.striping.dawdling <FLOAT>

factor for random slow-downs [0,1] for use with model 'striping'; default: 0.2

--pedestrian.striping.jamtime <TIME>

Time in seconds after which pedestrians start squeezing through a jam when using model 'striping' (non-positive values disable squeezing); default: 300

 

2.1.6路由

Option

Description

--routing-algorithm <STRING>

Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']; default: dijkstra

选取路由算法[“迪杰斯特拉”,”astar”,”CH”,”CHWrapper”],默认为迪杰斯特拉

--weights.random-factor <FLOAT>

Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT);default: 1

--device.rerouting.probability <FLOAT>

The probability for a vehicle to have a 'rerouting' device; default: 0

--device.rerouting.explicit <STRING>

Assign a 'rerouting' device to named vehicles

--device.rerouting.deterministic <BOOL>

The 'rerouting' devices are set deterministic using a fraction of 1000; default: false

--device.rerouting.period <TIME>

The period with which the vehicle shall be rerouted;default: 0

--device.rerouting.pre-period <TIME>

The rerouting period before depart; default: 1

--device.rerouting.adaptation-weight <FLOAT>

The weight of prior edge weights for exponential moving average; default: 0.5

--device.rerouting.adaptation-steps <INT>

The number of steps for moving average weight of prior edge weights; default: 0

--device.rerouting.adaptation-interval <TIME>

The interval for updating the edge weights; default: 1

--device.rerouting.with-taz <BOOL>

Use zones (districts) as routing start- and endpoints;default: false

--device.rerouting.init-with-loaded-weights<BOOL>

Use weight files given with option --weight-files for initializing edge weights; default: false

--device.rerouting.shortest-path-file <FILE>

Initialize lookup table for astar from the given distance matrix

--device.rerouting.threads <INT>

The number of parallel execution threads used for rerouting; default: 0

--device.rerouting.output <FILE>

Save adapting weights to FILE

 

2.1.7报告

Option

Description

-v <BOOL>
--verbose <BOOL>

Switches to verbose output; default: false

是否使用冗余的输出,默认为false

--print-options <BOOL>

Prints option values before processing; default: false

在处理前先打印出选项参数

-? <BOOL>
--help <BOOL>

Prints this screen; default: false

-V <BOOL>
--version <BOOL>

Prints the current version; default: false

-X <STRING>
--xml-validation <STRING>

Set schema validation scheme of XML inputs ("never", "auto" or "always"); default: auto

--xml-validation.net <STRING>

Set schema validation scheme of SUMO network inputs ("never", "auto" or "always"); default: never

-W <BOOL>
--no-warnings <BOOL>

Disables output of warnings; default: false

-l <FILE>
--log <FILE>

Writes all messages to FILE (implies verbose)

--message-log <FILE>

Writes all non-error messages to FILE (implies verbose)

--error-log <FILE>

Writes all warnings and errors to FILE

--duration-log.disable <BOOL>

Disable performance reports for individual simulation steps; default: false

--duration-log.statistics <BOOL>

Enable statistics on vehicle trips; default: false

--no-step-log <BOOL>

Disable console output of current simulation step;default: false

 

2..1.8排放量

Option

Description

--phemlight-path <FILE>

Determines where to load PHEMlight definitions from.;default: ./PHEMlight/

--device.emissions.probability <FLOAT>

The probability for a vehicle to have a 'emissions' device; default: 0

--device.emissions.explicit <STRING>

Assign a 'emissions' device to named vehicles

--device.emissions.deterministic <BOOL>

The 'emissions' devices are set deterministic using a fraction of 1000; default: false

 

2.1.9通信

Option

Description

--device.btreceiver.probability<FLOAT>

The probability for a vehicle to have a 'btreceiver' device; default: 0

车辆拥有蓝牙接收器btreceiver的可能性。

--device.btreceiver.explicit <STRING>

Assign a 'btreceiver' device to named vehicles

--device.btreceiver.deterministic <BOOL>

The 'btreceiver' devices are set deterministic using a fraction of 1000; default: false

--device.btreceiver.range <FLOAT>

The range of the bt receiver; default: 300

--device.btreceiver.all-recognitions <BOOL>

Whether all recognition point shall be written; default:false

--device.btreceiver.offtime <FLOAT>

The offtime used for calculating detection probability (in seconds); default: 0.64

--device.btsender.probability <FLOAT>

The probability for a vehicle to have a 'btsender' device;default: 0

车辆拥有一个蓝牙发送器的可能性。

--device.btsender.explicit <STRING>

Assign a 'btsender' device to named vehicles

--device.btsender.deterministic <BOOL>

The 'btsender' devices are set deterministic using a fraction of 1000; default: false

 

2.1.10电池

Option

Description

--device.battery.probability <FLOAT>

The probability for a vehicle to have a 'battery' device;default: 0

车辆拥有一个电池的可能性,默认为

--device.battery.explicit <STRING>

Assign a 'battery' device to named vehicles

--device.battery.deterministic <BOOL>

The 'battery' devices are set deterministic using a fraction of 1000; default: false

 

2.1.11示例装置

Option

Description

--device.example.probability <FLOAT>

The probability for a vehicle to have a 'example' device;default: 0

--device.example.explicit <STRING>

Assign a 'example' device to named vehicles

--device.example.deterministic <BOOL>

The 'example' devices are set deterministic using a fraction of 1000; default: false

--device.example.parameter <FLOAT>

An exemplary parameter which can be used by all instances of the example device; default: 0

 

2.1.12Traci服务器

Option

Description

--remote-port <INT>

Enables TraCI Server if set; default: 0

 

2.1.13Mesoscopic

Option

Description

--mesosim <BOOL>

Enables mesoscopic simulation; default: false

--meso-edgelength <FLOAT>

Length of an edge segment in mesoscopic simulation;default: 98

--meso-tauff <TIME>

Factor for calculating the net free-free headway time;default: 1.13

--meso-taufj <TIME>

Factor for calculating the net free-jam headway time;default: 1.13

--meso-taujf <TIME>

Factor for calculating the jam-free headway time;default: 2

--meso-taujj <TIME>

Factor for calculating the jam-jam headway time;default: 1.4

--meso-jam-threshold <FLOAT>

Minimum percentage of occupied space to consider a segment jammed. A negative argument causes thresholds to be computed based on edge speed and tauff (default); default: -1

--meso-multi-queue <BOOL>

Enable multiple queues at edge ends; default: true

--meso-junction-control <BOOL>

Enable mesoscopic traffic light and priority junction handling; default: false

--meso-junction-control.limited <BOOL>

Enable mesoscopic traffic light and priority junction handling for saturated links. This prevents faulty traffic lights from hindering flow in low-traffic situations;default: false

--meso-tls-penalty <FLOAT>

Apply scaled time penalties when driving across tls controlled junctions based on green split instead of checking actual phases; default: 0

--meso-overtaking <BOOL>

Enable mesoscopic overtaking; default: false

--meso-recheck <TIME>

Time interval for rechecking insertion into the next segment after failure; default: 0

 

2.1.14随机数

Option

Description

--random <BOOL>

Initialises the random number generator with the current system time; default: false

--seed <INT>

Initialises the random number generator with the given value; default: 23423

 
2.1.15只针对GUI

Option

Description

--gui-settings-file <FILE>

Load visualisation settings from FILE

-Q <BOOL>
--quit-on-end <BOOL>

Quits the GUI when the simulation stops; default: false

-G <BOOL>
--game <BOOL>

Start the GUI in gaming mode; default: false

-S <BOOL>
--start <BOOL>

Start the simulation after loading; default: false

-D <BOOL>
--demo <BOOL>

Restart the simulation after ending (demo mode);default: false

-T <BOOL>
--disable-textures <BOOL>

Do not load background pictures; default: false

--window-size <STRING>

Create initial window with the given x,y size

 

3、输入文件的加载顺序

每当一个仿真对象A需要用到对象B,那么B必须在A以前定义。在不同文件文件中更早加载或者在同一文件的更靠前的位置。

有关文件加载的选项是至关重要的,--route-files 和—additional-files。有关--route-files的特点是增量的加载以节省内存,但是—additional-files是在仿真前全部加载的。很多对象需要在仿真的时候先输出来或者在加载一些东西的时候route文件需要,因此需要讲additional文件全部加载。注意,所有写入route文件的内容也能写到additional问价中。当多个文件给出的时候,从左到右依次加载。

4、additional文件的格式

additional文件中的条目可能包含了多种多样的标签,比如 trafficlight programsdetectordefinitionsvariablespeed signs 和 busstops。并且,在route文件中定义的任何标签,都可以在additional文件中定义。

在additional文件中需要一个任意命名的根标签(一般是默认的additional)。例如下面的代码定义的:

<pre>
<additional>
<inductionLoopid="myLoop1" lane="foo_0" pos="42"freq="900" file="out.xml"/>
    <inductionLoop id="myLoop2"lane="foo_2" pos="42" freq="900"file="out.xml"/>
 
    <busStop id="station1"lane="foo_0" startPos="5" endPos="20"/>
 
<vTypeid="bus" maxSpeed="20" length="12"/>
</additional>
</pre>

5、车辆的导入

车辆在他们出发的时间点插入到仿真程序中(或者使用选项—random-depart-offset进行微量的延迟)。如果目前的道路上放不开这个车辆,那么它会被加入到插入队列中,一直重复尝试插入。如果使用选项—max-depart-delay被使用,那么车辆在相应的时间段内被遗弃。

这里有两种方法插入车辆:

1、试着在每个仿真步长上插入车辆

2、针对每条道路进行插入,尝试在一辆车插入后进行插入

在不拥挤的道路上这两种方法是类似的,但是在拥挤的道路上,方法2明显更快一些。在老版本的sumo中可以通过选项—sloppy-insert来将默认的方法1转换为方法2。自从版本0.18.0开始,方法2成为默认的,并且可以通过选项—eager-insert进行转换。

6、小标题

Using additional Polygons and POIs withinthe Simulation:阅读连接

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值