vissim — vap/visvap培训 >...
TRANSCRIPT
www.ptvchina.cn
VISSIM — VAP/VisVAP培训
辟途威交通科技(上海)有限公司
© PTV China 2012 2
> 基本认识
– VAP/VisVAP属于VISSIM的中高级应用范
畴
– 熟练掌握VAP/VisVAP,有助于更加灵活
地应用VISSIM解决科研和工程问题
> 基础知识
– 交通信号控制的基本理论与方法
– VISSIM建模方法
VAP/VisVAP概要介绍(1/2)
© PTV China 2012 3
> VAP:Vehicle Actuated Programming,车辆感应逻辑编程,可用TextPad编辑。文件类型:*.vap。
> VisVAP:通过编辑逻辑流程图,简化VAP的编程工作,可通过VISSIM附加模块VisVAP编辑,可自动把VisVAP文件转换为VAP文件。文件类型:*.vv。
> VAP/VisVAP的用途:与数据检测器一起,可以为VISSIM提供信号感应控制、停车场的模拟设置、可变交通控制等。
> 使用要求:直接在VISSIM里调用,需要三个文件:- vap216.dll文件,在VISSIM安装目录下的Exe文件夹内。- *.pua文件,描述了相位过渡的时间设置,可通过TextPad或Crossig编辑,也可以通过VISSIG附加模块计算生成。
- *.vap文件,用户定义的逻辑文件。
VAP/VisVAP概要介绍(2/2)
© PTV China 2012 4
VAP在VISSIM中的调用窗口
© PTV China 2012 5
VAP/VisVAP与VISSIM、Crossig的关系
© PTV China 2012 6
VAP/VisVAP与VISSIM、VISSIG模块的关系
© PTV China 2012 7
> 在VISSIM里建立路网,包括车辆输入、路径、优先规则等基本信息。
> 明确功能需求,规划设计逻辑流程图的技术架构。
> 在VISSIM里设置数据检测器,定义信号灯组,确定相位。注意,在VISSIM里的相位编号应与*.pua文件和*.vap文件里的编号一致。
> 确定相位之间的过渡时间,创建*.pua文件。
> 在VisVAP中设计逻辑流程图,编译成功后,转成*.vap文件。
> 在VISSIM的信号灯编辑窗口选择完成的*.pua文件以及*.vap文件。保存运行仿真。
一般工作流程
© PTV China 2012
*.PUA文件的简约格式(1/3)
信号灯组编号
相位阶段定义
初始相位阶段
相位阶段切换时间
8
结束语
© PTV China 2012 9
*.PUA文件的简约格式(2/3)信号灯组
相位
© PTV China 2012 10
*.PUA文件的简约格式(3/3)
© PTV China 2012 11
例子:*.pua文件
© PTV China 2012
*.PUA文件的完整格式(1/4)
CROSSIG中的信号灯组编号与VISSIM中的信号灯组编号的对应关系
12
© PTV China 2012
*.PUA文件的完整格式(2/4)
绿灯间隔时间矩阵
13
© PTV China 2012
*.PUA文件的完整格式(3/4)
相位阶段切换时间
14
© PTV China 2012
*.PUA文件的完整格式(4/4)
相位阶段定义
15
© PTV China 2012
*.PUA文件的必备内容
16
> 用途1:信号控制策略(或方案)设计
– 信号灯组编号
– 绿灯间隔时间矩阵或相位阶段切换时间
– 相位阶段定义
– 初始相位阶段
> 用途2:非信号控制策略(或方案)设计
– 信号灯组编号
– 相位阶段定义
– 初始相位阶段
© PTV China 2012 17
常用函数及其使用方法(1/13)
> 检测器类函数
> 信号灯组类函数
> 相位阶段类函数
> 公共交通类函数
> 其他函数
© PTV China 2012 18
常用函数及其使用方法(2/13)
> 检测器类函数(待续)
Long name Short MeaningDetection(<no>) Det Returns 1 if the impulse memory of detector <no> is 1
(i.e. a vehicle front end has been detected) or a vehicle is on the detector, else 0.
Presence(<no>) Call Returns 1 if the impulse memory of detector <no> is 1 (i.e. a vehicle front end has been detected).
Headway(<no>) Hdw Returns the current time gap at the detector <no>.
Headway10(<no>) Hdw10 Returns the current headway of detector <no> in tenths of a second.
Occupancy(<no>) OccT Returns the elapsed time since detector <no> has been activated or 0 if no vehicle is present at end of time step.
Occupancy10(<no>) OccT10 Returns the elapsed time since detector <no> has been activated in tenth of seconds or 0 if no vehicle is present at end of time step.
© PTV China 2012 19
常用函数及其使用方法(3/13)
> 检测器类函数(续前)
Long name Short MeaningOccup_rate(<no>) OccR Returns smoothened occupancy rate of detector <no>
[0..1].Veh_length(<no>) V_l Returns the length of the last vehicle that passed
detector <no> within the current simulation second.Velocity(<no>) V Returns the speed in m/s of the last vehicle that was
detected by detector <no> in the current time step or 0 if no vehicle was detected in this time step.
Front_ends (<no>) F_e Returns the number of detected vehicle front ends on detector <no> (the total amount since the last call of clear_front_ends(<no>)).
Rear_ends(<no>) R_e Returns the number of detected vehicle rear ends on detector <no> (the total amount since the last call of clear_rear_ends(<no>)).
© PTV China 2012 20
常用函数及其使用方法(4/13)
> 信号灯组类函数(待续)
Long name Short MeaningCurrent_state(<no>,<display>)
Cst Returns 1 if the current state of signal group <no> is <display>, else 0.
T_free(<no>) Tf Returns the time elapsed since the end of red of the signal group <no> (green plus red/amber time).
T_green(<no>) Tg Returns elapsed green time of signal group <no> or 0 if signal group is not green.
T_green_min(<no>) Tgmin Returns minimum green time of signal group <no>.
T_red(<no>) Tr Returns elapsed red time of signal group <no> or 0 if signal group is not red.
T_red_min(<no>) Trmin Returns minimum red time of signal group <no>.
T_stop(<no>) Ts Returns the time elapsed since the end of green of signal group <no> (red time plus amber time).
© PTV China 2012 21
常用函数及其使用方法(5/13)
> 信号灯组类函数(续前)
Long name Short MeaningSet_sg(<no>, <display>)
Ssg Sets display of signal group <no> to <display> including all transitions and providing all minimum display times defined in VISSIM.
Set_sg_direct(<no>, <display>)
Ssgd Sets display of signal group <no> immediately to <display> without any transitions and disregarding minimum display times.
Sg_green(<no>) SetG Sets signal group <no> to green. If it is not green already, the red-amber time as defined in VISSIM is automatically switched first.
Sg_red(<no>) SetR Sets signal group <no> to red. If it is not red already, the amber time as defined in VISSIM is automatically switched first.
© PTV China 2012 22
常用函数及其使用方法(6/13)
> 信号灯组类函数(续前)
Long name Short MeaningIntergreen(<sg1>, <sg2>)
IntG Returns the intergreen time between signal groups <sg1> and <sg2> as defined *.pua file.
Remaining_intergreen(<no>)
Rig Returns the time in seconds until signal group <no> can get green according to the intergreen matrix.
Test_intergreen(<no>)
Tig Returns 1 if all intergreen times towards signal group <no> are completed so that the signal group may be switched to green.
© PTV China 2012 23
常用函数及其使用方法(7/13)
> 相位阶段类函数(待续)
Long name Short MeaningAny_interstage_active
Aia Returns 1 if any interstage is active, otherwise 0.
Interstage(<stage1>, <stage2>)
Is Runs an interstage.
Interstage_active(<stage1>, <stage2>)
IsA Returns 1 if any interstage is active, otherwise 0.
Interstage_duration(<stage1>, <stage2>)
IsT Returns the current second of the interstage or 0 in case the interstage is not active.
Interstage_length(<stage1>, <stage2>)
IsL Returns length of interstage.
© PTV China 2012 24
常用函数及其使用方法(8/13)
> 相位阶段类函数(续前)
Long name Short MeaningStage_active(<stage>)
StgA Returns 1, if stage <stage> is active otherwise 0. A stage is regarded as active only if all its green signal groups are either red-amber or green and all its red signal groups are either amber or red and if there is no active interstage referring to this stage as ‘from_stage’ or ‘to_stage’.
Stage_duration(<stage>)
StgT Returns elapsed duration of stage <stage> or 0 if stage is not active.
© PTV China 2012 25
常用函数及其使用方法(9/13)
> 公共交通类函数(待续)
Long name Short MeaningTele_calling_point(<no>)
TeCPt Returns the calling point number from the telegram number <no>.
Tele_count TeCnt Returns the number of telegrams received in the current simulation time step.
Tele_course(<no>) TeCrs Returns the course number from the telegram number <no>.
Tele_delay(<no>) TeDel Returns the delay in seconds from the telegram number <no>.
Tele_line(<no>) TeLin Returns the line number from the telegram number <no>.
Tele_man_direction(<no>)
TeDir Returns the code for manual direction from the telegram number <no>.
© PTV China 2012 26
常用函数及其使用方法(10/13)
> 公共交通类函数(续前)
Long name Short MeaningTele_passengers(<no>)
TePas Returns the number of passengers from public transport telegram number <no>.
Tele_prio(<no>) TePri Returns the priority value from the telegram number <no>.
Tele_route(<no>) TeRou Returns the route number from the telegram number <no>.
Tele_tram_length(<no>)
TeLng Returns the tram length from the telegram number <no>.
© PTV China 2012 27
常用函数及其使用方法(11/13)
> 其他函数(待续)
Long name Short MeaningCycle_second T Returns current cycle second.
Cycle_second_between (<begin>, <end>, <op.type>)
Csb Returns 1 if the current cycle second (t) is between <begin> (b) and <end> (e), otherwise 0. <operatortype> determines the exact meaning of "between" (including or excluding): 0: b < t < e; 1: b < t <= e; 2: b <= t < e; 3: b <= t <= e.
Cycle_time Tc Returns current cycle length.
Marker_get(<no>) MGet Returns the value from input channel <no> .
Marker_put(<no>, <value>)
MPut Writes the <value> to the output channel <no>.
Prog_active PAct Returns the no. of active program selected in VISSIM [1..16].
© PTV China 2012 28
常用函数及其使用方法(12/13)
> 其他函数(续前)
Long name Short Meaning
Record_value(<no>, <value>)
RecVal Transmits <value> to VISSIM for output in the SC/detector record in the column “variable no. <no>”.
Set_cycle_second(<sec>)
SetT Sets the current cycle second to <sec> [1...999].
Set_prog(<no>) Sprg Sets the no. of the active program to <no> [1..16].
Sqrt(<value>) N/A Returns the square root of <value>.
© PTV China 2012 29
常用函数及其使用方法(13/13)
> 其他函数(续前)
Long name Short Meaning
Set_des_speed(<desSpDecNo>,<vehClassNo>,<desSpDistrNo>)
Sdsp Assigns the desired speed distribution <desSpDistrNo> to the vehicle class <vehClassNo> in the desired speed decision <desSpDecNo>.
Set_route(<routDecNo>,<routeNo>,<flow>)
Srou Sets the relative flow of the route <routeNo> of the routing decision <routDecNo> in the current time interval (or the next one, if no interval is currently active) to <flow>.
Set_stop_time_dist(<stop_no>,<veh_cl_no>, <dist_no>)
Sst Selects the dwell time distribution <dist_no> for vehicle class <veh_cl_no> at the stop sign <stop_no>.
© PTV China 2012 30
VAP/VisVAP的运算符
VAP/VisVAP 216
© PTV China 2012 31
例子:VisVAP的控制逻辑
© PTV China 2012 32
例子:VisVAP的逻辑框图
© PTV China 2012 33
VisVAP界面(1/3)
© PTV China 2012 34
VisVAP的用户界面(2/3)
逻辑流程图的设计要素
逻辑流程图的设计界面
© PTV China 2012 35
VisVAP的用户界面(3/3)
定义流程图中的定值参数
定义流程图中的数组
定义流程图中的表达式
定义上级流程图中的包含子流程图
© PTV China 2012 36
例子:VisVAP的界面
© PTV China 2012 37
VisVAP逻辑单元
程序开始、结束
命令和赋值语句
判断语句
子程序
打印分页符
注释
连接线
箭头显示程度(显示一部分/所
有箭头)
© PTV China 2012 38
VisVAP的函数
包含了所有VAP的函数
© PTV China 2012 39
例子:转换成的VAP文件
© PTV China 2012 40
> *.vv文件必须以字母作为文件名字的开头。名字只能包含字母、数字、下划线。
> 转换出来的*.vap文件和*.vv文件同名。
> 所有的变量的首字符必须是字母。
> 变量长度不能超过32字符。
> 在逻辑字符(如And、Or、Not)前后要保证有一个空格,以便区分出逻辑字符。
*.vv文件命名原则
© PTV China 2012 41
路径信息:在<VISSIM-目录>\examples\training文件夹:
> LRT-Luxembourg3个信号控制的交叉口,编号为5的交叉口包含复杂的轨道优先设置。
> SimpleJunction模拟了2相位、3相位的交叉口,包含定时控制和感应控制。
> VAP_dynRouting展示如何通过VAP来控制静态路径选择。- SplRSI:类似港湾站的停车模拟,只有该港湾没有停车,才允许车停入。- RSI: 含有1个货车停车位,5个小汽车停车位。有停车位的情况下,车辆才停入。
> PedCrossing模拟了根据行人需求设置的感应行人过街信号。
VISSIM安装文件夹里的VAP案例(1/2)
© PTV China 2012 42
路径信息:在<VISSIM-目录>\examples\training文件夹:
> VMS模拟变化车速标志的基本例子。展示了如何通过VAP控制期望得到的变化速度。
> TempLaneUse在大流量的情况下,高速公路暂时使用硬路肩的情况。VAP控制了局部的静态路径以及速度变换。
> RampMetering简单模拟高速公路入口的交通流情况。
VISSIM安装文件夹里的VAP案例(2/2)