﻿ 基于DEVS的交叉路口建模与仿真
 计算机系统应用  2020, Vol. 29 Issue (3): 187-193 PDF

Intersection Modeling and Simulation Based on DEVS
ZHANG Xue-Jun, WANG Ning, WANG Zhao-Peng
Department of Electric Power Engineering, Shanxi University, Taiyuan 030013, China
Abstract: Considering the conflicts between vehicles and between vehicle and pedestrian at the intersection with signal control, the microscopic traffic simulation model of the intersection is constructed under the Discrete Event System Specification (DEVS). By calibrating simulation parameters with observation data of a typical intersection in a city, the simulation results are compared with the calculated traffic capacity according to the “Specification for Urban Road Engineering”, and the model is verified. On this basis, first, the influence of the amount of left-turn ratio on the traffic capacity of intersection is analyzed by the simulation. Then, an intelligent green ratio control strategy is designed based on the number of vehicles waiting to cross the intersection in each direction. The simulation results show that, the capacity increases first and then decreases with the increase of the ratio of left-turn vehicles; and the intelligent green ratio control can significantly improve the traffic capacity of intersection and significantly reduce the average approach road delay time. These prove that the simulation model can truly simulate the interaction of various intersection factors, and is easy to expand and universalize, which can be applied to the study of other intelligent traffic problems.
Key words: DEVS     intersection     microscopic traffic simulation     intelligence traffic system

1 DEVS模型

DEVS是一种系统建模与仿真的形式化规范, 包括原子模型和耦合模型. 原子模型是具有独立构造、内部活动和输入输出接口的最基本的元素, 它用来描述组成系统的基本实体的动态行为. 原子模型相互连接形成耦合模型. 耦合模型又可与其它原子或耦合连接形成更大具有模块化、层次化结构的系统模型. 这一特点使得DEVS特别适合于面向对象建模与仿真.

 $M = < X,S,Y,{\delta _{{\rm int} }},{\delta _{\rm ext}},{\delta _{\rm con}},\lambda ,ta >$ (1)

2 交叉路口微观仿真模型 2.1 交叉路口系统分析

2.2 交叉路口的DEVS建模

 图 1 交叉路口示意图

 图 2 冲突点模型

 $Inports = \{ Recv1,Recv2,Perm1,Perm2,Ackin\}$ (2)

4个输出端口组成交换器的输出端口集:

 $Oports = \{ Send1,Send2,Load,Ackout\}$ (3)

 $X = \{ (p,v)\left| {p \in Inports,v \in } \right.{X_{\rm in}}\}$ (4)

 $Y = \{ (p,v)\left| {p \in Oports,v \in } \right.{Y_{\rm out}}\}$ (5)

 $\begin{split} S = &\{ Passive,Resp,Delay\} \times R_0^ + \times Z \\ &\times \{ Recv1,Recv2\} \times \{ {\rm true,false}\} \times \{{\rm true,false}\} \\ \end{split}$ (6)

 $s = (ph,\sigma ,v,port,sw1,sw2)$ (7)

 ${\delta _{ext}}(ph,\sigma ,v,port,sw1,sw2,e,x) = \left\{ \begin{array}{l} (Resp,0,x.v,x.port,sw1,sw2), \;\;\;\;ph = Passive \wedge x.port \in \{ Recv1,Recv2\} \wedge v = 0 \\ (ph,\sigma - e,v,port,x.v,sw2),\;\;\;\;\;\;x.port = Perm1 \\ (ph,\sigma - e,v,port,sw1,x.v),\;\;\;\;\;\;x.port = Perm2 \\ (Resp,0,0,port,sw1,sw2),\;\;\;\;\;\;\;\;\;x.port = Ackin \\ (ph,\sigma - e,v,port,sw1,sw2),\;\;\;\;\;\;{\rm otherwise} \\ \end{array} \right.$ (8)

 \begin{aligned} &{\delta _{{\rm int} }}(ph,\sigma ,v,port,sw1,sw2) = \\ &\left\{ \begin{array}{l} (Delay,pass{\rm{\_}}t,v,port,sw1,sw2),\;\;\;\;\;ph = Resp \wedge v \ne 0 \\ (Passive,\infty ,v,port,sw1,sw2),\;\;\;\;\;\;\;\;ph = Resp \wedge v = 0 \\ (Passive,\infty ,v,port,sw1,sw2),\;\;\;\;\;\;\;\;ph = Delay \end{array} \right. \end{aligned} (9)

 \begin{aligned} &{\delta _{\rm con}}(ph,\sigma ,v,port,sw1,sw2,x) =\\ &{\delta _{{\rm int} }}({\delta _{\rm ext}}(ph,\sigma ,v,port,sw1,sw2,\sigma ,x)) \end{aligned} (10)

 \begin{aligned} & \lambda (ph,\sigma ,v,port,sw1,sw2) =\\ & \left\{ \begin{array}{l} (Send1,v),\;\;\;\;\;\;ph = Delay \wedge port = Recv1 \wedge sw1 = {\rm true} \\ (Send2,v),\;\;\;\;\;\;ph = Delay \wedge port = Recv2 \wedge sw2 = {\rm true} \\ (Load,{\rm false}),\;\;\;ph = Resp \wedge v \ne 0 \\ (Load,{\rm true}),\;\;\;\;ph = Resp \wedge v = 0 \\ (Ackout,v),\;\;\;\;\;ph = Resp \wedge v \ne 0 \\ \end{array} \right. \end{aligned}\!\!\!\!\! (11)
 $ta(ph,\sigma ,v,port,sw1,sw2) = \sigma$ (12)
2.3 模型验证

2.3.1 基础数据调查

 图 3 交叉路口相位图

2.3.2 通行能力计算

《城市道路设计规范》[10]指出, 交叉路口的通行能力等于各进口道通行能力之和, 各进口道的通行能力等于各车道通行能力之和. 本例交叉路口入站车道为左转、直行和右转专用, 采用以下3种车道的通行能力计算方法, 表1为各相位各进口道通行能力的计算结果.

1) 直行车道的通行能力计算公式:

 ${C_s} = \frac{{3600}}{{{T_c}}}\left(\frac{{{t_g} - {t_0}}}{{{t_i}}} + 1\right)\varphi$ (13)

 ${C_{elr}} = \sum {C_s}/(1 - {\beta _l}{\rm{ - }}{\beta _r})$ (14)

2) 左转专用车道的通行能力计算公式:

 ${C_l} = {C_{elr}}{\beta _l}$ (15)

3) 由于右转车不受信号灯控制, 右转专用车道的通行能力为两个相位车道通行能力之和, 计算公式:

 ${C_l} = ({C_{elr}} + { C'_{elr}}){\beta _r}$ (16)

2.3.3 通行能力仿真

 图 4 通过交叉路口流量与车辆总到达率的关系

 图 5 左转比例对交叉路口通行能力的影响

3 智能交通仿真设计

 $\left\{ {\begin{array}{*{20}{c}} {we = \max \{ wl,wt,el,et\} } \\ {ns = \max \{ nl,nt,sl,st\} } \end{array}} \right.$ (17)
 \left\{ {\begin{aligned} & {{T_{g1}} = T \cdot \frac{{we}}{{we + ns}}} \\ & {{T_{g2}} = T \cdot \frac{{ns}}{{we + ns}}} \\ & {\eta \le {T_{g1}},{T_{g2}} \le T - \eta } \end{aligned}} \right. (18)

 图 6 智能交通与固定配时通行能力对比图

 图 7 智能交通与固定配时延误时间对比图

4 结论

 [1] 李素兰, 张谢东, 施俊庆, 等. 信号控制交叉口交通流建模与通行能力分析. 公路交通科技, 2017, 34(12): 108-114. [2] 孙腾达, 王劲峰. 一种基于路网网格化的微观交通仿真模型. 系统仿真学报, 2007, 19(12): 2735-2739. DOI:10.3969/j.issn.1004-731X.2007.12.025 [3] Yaqub O, 王建强, 李灵犀. 基于THPNs的道路交叉口建模、分析与仿真(英文). 汽车安全与节能学报, 2016, 7(1): 25-34. DOI:10.3969/j.issn.1674-8484.2016.01.003 [4] 黄敏, 潘嘉杰, 刘芳. 基于SVM的交叉口连通关系建模. 计算机工程与设计, 2017, 38(5): 1319-1323. [5] Zeigler BP. Theory of Modeling and Simulation. New York: John Wiley, 1976. [6] 邱晓刚, 段伟. DEVS研究进展及其对建模与仿真学科建立的作用. 系统仿真学报, 2009, 21(21): 6697-6704, 6709. [7] Kang DH, Kong J, Choi BK. DEVS modeling of urban traffic systems (WIP). Proceedings of the 2012 Symposium on Theory of Modeling and Simulation - DEVS Integrative M&S Symposium. Orlando, FL, USA. 2012. 16. [8] 胡建鹏, 黄林鹏. 基于P-DEVS的可执行体系结构建模与仿真方法. 系统仿真学报, 2016, 28(2): 283-291. [9] Chow ACH, Zeigler BP. Parallel DEVS: A parallel, hierarchical, modular modeling formalism. Proceedings of Winter Simulation Conference. Lake Buena Vista, FL, USA. 1994. 716–722. [10] 袁晶矜, 袁振洲. 信号交叉口通行能力计算方法的比较分析. 公路交通技术, 2006(5): 123-128, 132. DOI:10.3969/j.issn.1009-6477.2006.05.035 [11] 刘小明, 何忠贺. 城市智能交通系统技术发展现状及趋势. 自动化博览, 2015(1): 58-60. DOI:10.3969/j.issn.1003-0492.2015.01.042 [12] 卫星, 张利, 魏振春, 等. 交通信号自适应遗传控制算法及其仿真研究. 系统仿真学报, 2012, 24(11): 2255-2258. [13] 邱建东, 解小平, 汤旻安, 等. 基于车流量的智能交通信号优化控制研究. 计算机应用与软件, 2018, 35(1): 92-96. [14] 章伟, 张代远. 基于车流量的交通灯控制系统设计. 计算机技术与发展, 2015, 25(5): 196-199, 204. [15] 王宗利, 张海鑫, 宫子栋, 等. 基于车流量检测的智能交通信号灯系统. 河北农机, 2018(7): 42-43. [16] 朱旭东. 基于车流量的自适应智能交通信号灯控制算法. 电子世界, 2019(4): 100-103.