SUMO本事就是仿真的程序,它是微观的、空间上的连续、时间离散的交通流仿真。
目的:仿真一个定义好的脚本文件
系统:Linux/windows已经测试了;在命令行下运行;
输入(强制的):
Ø 道路网络,由netconvert或者netgenerate生成,具体可以查看页面: Building Networks。
Ø 一系列路由,由daurouter、jtrrouter、dfrouter或者activitygen生成,具体可以参考:Definition of Vehicles, Vehicle Types, and Routes。
输入(可选的):交通灯、变速标志、输出检测器等的附加定义。
输出:有多种生成文件的类型,具体可以参考SUMO-GUI。
编程语言:C++
你可能用到相应的xml验证文件用来设置配置文件: sumoConfiguration.xsd。
Option选项 |
Description描述 |
-c |
Loads the named config on startup 在运行开始前加载配置文件 |
--save-configuration |
Saves current configuration into FILE 保存目前的配置到文件 |
--save-template |
Saves a configuration template (empty) into FILE 保存一个配置模板到文件 |
--save-schema |
Saves the configuration schema into FILE 保存配置验证到文件 |
--save-commented |
Adds comments to saved template, configuration, or schema; default: false 增加评论到模板、配置文件或者验证文件。 |
Option |
Description |
-n |
Load road network description from FILE 从文件中加载道路路网描述 |
-r |
Load routes descriptions from FILE(s) 从文件中加载路由描述 |
-a |
Load further descriptions from FILE(s) 从问价中加载更多的描述 |
-w |
Load edge/lane weights for online rerouting from FILE 从文件中加载用于在线重路由的道路或者车道的权重 |
-x |
Name of the xml attribute which gives the edge weight;default: traveltime |
--load-state |
Loads a network state from FILE 从问价中加载网络状态 |
--load-state.offset |
Shifts all times loaded from a saved state by the given offset; default: 0 |
Option |
Description |
--output-prefix |
Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time. 应用于所有输出文件的前缀。特殊的符号“TIME”被当前的时间所代替。 |
--netstate-dump |
Save complete network states into FILE 保存完整的网络状态到文件。 |
--netstate-dump.empty-edges |
Write also empty edges completely when dumping;default: false 当输出时,也写入空的道路(默认为false) |
--netstate-dump.precision |
Write positions and speeds with the given precision (default 2); default: 2 使用给定的精度写入位置和速度(默认为2) |
--emission-output |
Save the emission values of each vehicle 保存每辆车的排放值。 |
--emission-output.precision |
Write emission values with the given precision (default 2); default: 2 使用给定的精度写入排放值(默认为2) |
--battery-output |
Save the battery values of each vehicle 保存每辆车的电量值。 |
--battery-output.precision |
Write battery values with the given precision (default 2); default: 2 使用给定的精度写入电池电量 |
--fcd-output |
Save the Floating Car Data 保存浮动车数据 |
--fcd-output.geo |
Save the Floating Car Data using geo-coordinates (lon/lat); default: false 使用地理坐标保存浮动车数据 |
--fcd-output.signals |
Add the vehicle signal state to the FCD output (brake lights etc.); default: false 增加车辆的信号状态到FCD输出文件(刹车信号灯)默认为false |
--full-output |
Save a lot of information for each timestep (very redundant) 保存每一个时间步长的信息(冗余信息) |
--queue-output |
Save the vehicle queues at the junctions (experimental) 保存在节点的车辆队列(实验性质的) |
--vtk-output |
Save complete vehicle positions inclusive speed values in the VTK Format (usage: /path/out will produce /path/out_$TIMESTEP$.vtp files) 保存完整的车辆位置,包括速度值。使用VTK格式。 |
--amitran-output |
Save the vehicle trajectories in the Amitran format 使用Amitran格式保存车辆的轨迹信息 |
--summary-output |
Save aggregated vehicle departure info into FILE 将汇总的车辆进入【翻译不准确,待实验】信息保存到文件中 |
--tripinfo-output |
Save single vehicle trip info into FILE 保存单辆车的轨迹信息 |
--tripinfo-output.write-unfinished |
Write tripinfo output for vehicles which have not arrived at simulation end; default: false 当车辆没有仿真结束时,写入车辆的轨迹信息。 |
--vehroute-output |
Save single vehicle route info into FILE 保存单辆车的路由信息到文件。 |
--vehroute-output.exit-times |
Write the exit times for all edges; default: false 写入所有道路的推出时间,默认为false |
--vehroute-output.last-route |
Write the last route only; default: false 写入最后一个路由。默认为false |
--vehroute-output.sorted |
Sorts the output by departure time; default: false 按照离开时间排序。默认为false |
--vehroute-output.dua |
Write the output in the duarouter alternatives style;default: false 使用duarouter格式输出 |
--vehroute-output.intended-depart |
Write the output with the intended instead of the real departure time; default: false 输出预期的离开时间而不是真实的时间。 |
--vehroute-output.route-length |
Include total route length in the output; default: false 在输出文件中包含了全部的路由长度 |
--vehroute-output.write-unfinished |
Write vehroute output for vehicles which have not arrived at simulation end; default: false 输出在仿真结束仍没到达的车辆。默认为false |
--link-output |
Save links states into FILE 保存连接状态到文件 |
--bt-output |
Save bluetooth visibilities into FILE (in conjunction with device.btreceiver and device.btsender) 保存蓝牙可见的到文件(结合device.btreceiver和device.btsender) |
--lanechange-output |
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 |
save state repeatedly after TIME period; default: -1 反复保存时间周期的状态 |
--save-state.prefix |
Prefix for network states; default: state 网络状态的前缀 |
--save-state.suffix |
Suffix for network states (.sbx or .xml); default: .sbx 网络状态的后缀 |
--save-state.files |
Files for network states 网络状态的文件 |
Option |
Description |
-b |
Defines the begin time in seconds; The simulation starts at this time; default: 0 设置启动时间,秒为单位。默认为0 |
-e |
Defines the end time in seconds; The simulation ends at this time; default: -1 设置结束时间,秒为单位。默认为0. |
--step-length |
Defines the step duration in seconds; default: 1 定义步骤时间,秒为单位。默认为1. |
Option |
Description |
--step-method.ballistic |
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 |
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 |
Load routes for the next number of seconds ahead;default: 200 加载未来几秒的时间的路由,默认为200 |
--no-internal-links |
Disable (junction) internal links; default: false 节点内部车道被禁用。默认为false |
--ignore-junction-blocker |
Ignore vehicles which block the junction after they have been standing for SECONDS (-1 means never ignore);default: -1 在他们占用了几秒的时间后,忽视在节点拥堵的车辆。默认为-1,即从来不忽略。 |
--ignore-route-errors |
Do not check whether routes are connected; default:false 不检查是否路由是连接的。默认false |
--ignore-accidents |
Do not check whether accidents occur; default: false 不检查是否事故发生,默认为false |
--collision.action |
How to deal with collisions:[none,warn,teleport,remove]; default: teleport 如何解决碰撞[none,warn,teleport,remove] |
--collision.check-junctions |
Enables collisions checks on junctions; default: false 在节点处的碰撞检查。 |
--max-num-vehicles |
Delay vehicle insertion to stay within the given maximum number; default: -1 延迟车辆的进入,给定最大值。默认为-1 |
--scale |
Scale demand by the given factor (by discarding or duplicating vehicles); default: 1 通过给定因素确定的规模需求。 |
--time-to-teleport |
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 |
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 |
Length of time interval, over which accumulated waiting time is taken into account; default: 100 |
--max-depart-delay |
How long vehicles wait for departure before being skipped, defaults to -1 which means vehicles are never skipped; default: -1 |
--sloppy-insert |
Whether insertion on an edge shall not be repeated in same step once failed; default: false |
--eager-insert |
Whether each vehicle is checked separately for insertion on an edge; default: false |
--random-depart-offset |
Each vehicle receives a random offset to its depart value drawn uniformly from [0, TIME]; default: 0 |
--lanechange.duration |
Duration of a lane change maneuver (default 0);default: 0 |
--lanechange.overtake-right |
Whether overtaking on the right on motorways is permitted; default: false |
--tls.all-off |
Switches off all traffic lights.; default: false |
--pedestrian.model |
Select among pedestrian models ['nonInteracting', 'striping']; default: striping 选择行人的模型[“无相互作用的”,”条纹”],默认为条纹 |
--pedestrian.striping.stripe-width |
Width of parallel stripes for segmenting a sidewalk (meters) for use with model 'striping'; default: 0.65 隔离开来用于人行道的宽度,默认值为0.65米 |
--pedestrian.striping.dawdling |
factor for random slow-downs [0,1] for use with model 'striping'; default: 0.2 |
--pedestrian.striping.jamtime |
Time in seconds after which pedestrians start squeezing through a jam when using model 'striping' (non-positive values disable squeezing); default: 300 |
Option |
Description |
--routing-algorithm |
Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']; default: dijkstra 选取路由算法[“迪杰斯特拉”,”astar”,”CH”,”CHWrapper”],默认为迪杰斯特拉 |
--weights.random-factor |
Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT);default: 1 |
--device.rerouting.probability |
The probability for a vehicle to have a 'rerouting' device; default: 0 |
--device.rerouting.explicit |
Assign a 'rerouting' device to named vehicles |
--device.rerouting.deterministic |
The 'rerouting' devices are set deterministic using a fraction of 1000; default: false |
--device.rerouting.period |
The period with which the vehicle shall be rerouted;default: 0 |
--device.rerouting.pre-period |
The rerouting period before depart; default: 1 |
--device.rerouting.adaptation-weight |
The weight of prior edge weights for exponential moving average; default: 0.5 |
--device.rerouting.adaptation-steps |
The number of steps for moving average weight of prior edge weights; default: 0 |
--device.rerouting.adaptation-interval |
The interval for updating the edge weights; default: 1 |
--device.rerouting.with-taz |
Use zones (districts) as routing start- and endpoints;default: false |
--device.rerouting.init-with-loaded-weights |
Use weight files given with option --weight-files for initializing edge weights; default: false |
--device.rerouting.shortest-path-file |
Initialize lookup table for astar from the given distance matrix |
--device.rerouting.threads |
The number of parallel execution threads used for rerouting; default: 0 |
--device.rerouting.output |
Save adapting weights to FILE |
Option |
Description |
-v |
Switches to verbose output; default: false 是否使用冗余的输出,默认为false |
--print-options |
Prints option values before processing; default: false 在处理前先打印出选项参数 |
-? |
Prints this screen; default: false |
-V |
Prints the current version; default: false |
-X |
Set schema validation scheme of XML inputs ("never", "auto" or "always"); default: auto |
--xml-validation.net |
Set schema validation scheme of SUMO network inputs ("never", "auto" or "always"); default: never |
-W |
Disables output of warnings; default: false |
-l |
Writes all messages to FILE (implies verbose) |
--message-log |
Writes all non-error messages to FILE (implies verbose) |
--error-log |
Writes all warnings and errors to FILE |
--duration-log.disable |
Disable performance reports for individual simulation steps; default: false |
--duration-log.statistics |
Enable statistics on vehicle trips; default: false |
--no-step-log |
Disable console output of current simulation step;default: false |
Option |
Description |
--phemlight-path |
Determines where to load PHEMlight definitions from.;default: ./PHEMlight/ |
--device.emissions.probability |
The probability for a vehicle to have a 'emissions' device; default: 0 |
--device.emissions.explicit |
Assign a 'emissions' device to named vehicles |
--device.emissions.deterministic |
The 'emissions' devices are set deterministic using a fraction of 1000; default: false |
Option |
Description |
--device.btreceiver.probability |
The probability for a vehicle to have a 'btreceiver' device; default: 0 车辆拥有蓝牙接收器btreceiver的可能性。 |
--device.btreceiver.explicit |
Assign a 'btreceiver' device to named vehicles |
--device.btreceiver.deterministic |
The 'btreceiver' devices are set deterministic using a fraction of 1000; default: false |
--device.btreceiver.range |
The range of the bt receiver; default: 300 |
--device.btreceiver.all-recognitions |
Whether all recognition point shall be written; default:false |
--device.btreceiver.offtime |
The offtime used for calculating detection probability (in seconds); default: 0.64 |
--device.btsender.probability |
The probability for a vehicle to have a 'btsender' device;default: 0 车辆拥有一个蓝牙发送器的可能性。 |
--device.btsender.explicit |
Assign a 'btsender' device to named vehicles |
--device.btsender.deterministic |
The 'btsender' devices are set deterministic using a fraction of 1000; default: false |
Option |
Description |
--device.battery.probability |
The probability for a vehicle to have a 'battery' device;default: 0 车辆拥有一个电池的可能性,默认为 |
--device.battery.explicit |
Assign a 'battery' device to named vehicles |
--device.battery.deterministic |
The 'battery' devices are set deterministic using a fraction of 1000; default: false |
Option |
Description |
--device.example.probability |
The probability for a vehicle to have a 'example' device;default: 0 |
--device.example.explicit |
Assign a 'example' device to named vehicles |
--device.example.deterministic |
The 'example' devices are set deterministic using a fraction of 1000; default: false |
--device.example.parameter |
An exemplary parameter which can be used by all instances of the example device; default: 0 |
Option |
Description |
--remote-port |
Enables TraCI Server if set; default: 0 |
Option |
Description |
--mesosim |
Enables mesoscopic simulation; default: false |
--meso-edgelength |
Length of an edge segment in mesoscopic simulation;default: 98 |
--meso-tauff |
Factor for calculating the net free-free headway time;default: 1.13 |
--meso-taufj |
Factor for calculating the net free-jam headway time;default: 1.13 |
--meso-taujf |
Factor for calculating the jam-free headway time;default: 2 |
--meso-taujj |
Factor for calculating the jam-jam headway time;default: 1.4 |
--meso-jam-threshold |
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 |
Enable multiple queues at edge ends; default: true |
--meso-junction-control |
Enable mesoscopic traffic light and priority junction handling; default: false |
--meso-junction-control.limited |
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 |
Apply scaled time penalties when driving across tls controlled junctions based on green split instead of checking actual phases; default: 0 |
--meso-overtaking |
Enable mesoscopic overtaking; default: false |
--meso-recheck |
Time interval for rechecking insertion into the next segment after failure; default: 0 |
Option |
Description |
--random |
Initialises the random number generator with the current system time; default: false |
--seed |
Initialises the random number generator with the given value; default: 23423 |
Option |
Description |
--gui-settings-file |
Load visualisation settings from FILE |
-Q |
Quits the GUI when the simulation stops; default: false |
-G |
Start the GUI in gaming mode; default: false |
-S |
Start the simulation after loading; default: false |
-D |
Restart the simulation after ending (demo mode);default: false |
-T |
Do not load background pictures; default: false |
--window-size |
Create initial window with the given x,y size |
每当一个仿真对象A需要用到对象B,那么B必须在A以前定义。在不同文件文件中更早加载或者在同一文件的更靠前的位置。
有关文件加载的选项是至关重要的,--route-files 和—additional-files。有关--route-files的特点是增量的加载以节省内存,但是—additional-files是在仿真前全部加载的。很多对象需要在仿真的时候先输出来或者在加载一些东西的时候route文件需要,因此需要讲additional文件全部加载。注意,所有写入route文件的内容也能写到additional问价中。当多个文件给出的时候,从左到右依次加载。
additional文件中的条目可能包含了多种多样的标签,比如 trafficlight programs, detectordefinitions, variablespeed signs 和 busstops。并且,在route文件中定义的任何标签,都可以在additional文件中定义。
在additional文件中需要一个任意命名的根标签(一般是默认的additional)。例如下面的代码定义的:
车辆在他们出发的时间点插入到仿真程序中(或者使用选项—random-depart-offset进行微量的延迟)。如果目前的道路上放不开这个车辆,那么它会被加入到插入队列中,一直重复尝试插入。如果使用选项—max-depart-delay被使用,那么车辆在相应的时间段内被遗弃。
这里有两种方法插入车辆:
1、试着在每个仿真步长上插入车辆
2、针对每条道路进行插入,尝试在一辆车插入后进行插入
在不拥挤的道路上这两种方法是类似的,但是在拥挤的道路上,方法2明显更快一些。在老版本的sumo中可以通过选项—sloppy-insert来将默认的方法1转换为方法2。自从版本0.18.0开始,方法2成为默认的,并且可以通过选项—eager-insert进行转换。
Using additional Polygons and POIs withinthe Simulation:阅读连接