信号控制交叉口过街行人流仿真建模应用方案【附仿真】
2026/6/2 20:00:50 网站建设 项目流程

(1)改进元胞自动机与社会力融合的行人流微观模型:

提出一种混合型行人过街仿真模型,将元胞自动机的离散空间优势与社会力模型的连续受力特性相结合。模型中将人行横道划分为边长0.2米的方形元胞,每个元胞最多容纳一个行人。每个行人的运动由三部分力决定:朝向目标点的驱动力(大小与期望速度成正比)、与其他行人的排斥力(采用社会力公式,力的大小随间距指数衰减)、与边界(路缘石、隔离栏)的排斥力。行人从当前元胞移动到邻居元胞的概率由Boltzmann分布确定,其中能量函数为上述三种力的加权和,权重系数通过遗传算法在南京五个交叉口的实测数据中标定。标定结果为:驱动力权重0.45,行人排斥力权重0.35,边界排斥力权重0.20。仿真结果显示,该模型能够准确再现行人过街的组团聚集、延展、相遇和分离四个典型阶段,组团规模分布与实测的Kolmogorov-Smirnov检验p值大于0.08。

(2)嵌入机动车避让行为的行人-机动车交互仿真器:

在行人流模型基础上,耦合了标准的NaSch元胞自动机机动车流模型,并新增两个行为模块:机动车避让行人模块和行人穿越机动车流模块。机动车避让逻辑为:当机动车前方2.5米内有行人占据人行横道时,机动车以概率P_yield减速,P_yield与车速成反比(车速越高,避让概率越低)。行人穿越机动车流模块使用间隙接受理论:行人在进入机动车道前,评估对向车流的穿越间隙,若间隙大于临界间隙(标定为1.8秒),则行人以较高概率穿越;否则等待。临界间隙随等待时间指数衰减。在南京市大石桥街-中山路交叉口实测中,模型对行人-机动车冲突数的预测误差为平均每周期2.3次,对机动车避让率的预测误差为5.7%。参数敏感性分析显示,机动车避让率对车头时距的敏感系数为0.62。

(3)基于仿真数据的行人过街时间计算模型与人行横道宽度确定方法:

利用上述仿真模型系统分析了不同行人流量(200-2000 ped/h)和不同人行横道宽度(2-6米)条件下,行人过街时间及其组成(行走时间、组团内延误、组团间延误)。发现当人行横道宽度从3米增加到5米时,组团内延误平均降低38%,但宽度超过5米后边际效益迅速下降。基于仿真数据,提出了一个新的行人过街时间计算模型:T_total = L / v_avg + D_cluster + D_inter,其中L为人行横道长度,v_avg为自由速度,D_cluster = 0.02 * (N_group - 2)^1.2,D_inter = 0.5 * (Q_ped / W)^0.8。据此提出人行横道宽度设计推荐值:当设计行人流量小于800 ped/h时,宽度可取3米;800-1500 ped/h时,宽度取4.5米;大于1500 ped/h时,宽度取6米且需考虑立体过街设施。该方法已应用于洪武路-淮海路交叉口的改善方案,改造后行人过街平均延误下降了26%。

import numpy as np from scipy.special import softmax class MixedCAForceModel: def __init__(self, grid_width=30, grid_height=10, cell_size=0.2): self.width = grid_width self.height = grid_height self.cell = np.zeros((grid_width, grid_height), dtype=int) self.positions = {} # ped_id -> (x,y) self.velocities = {} def force_based_transition_prob(self, ped_id, target_x, target_y, other_peds, boundaries): # 驱动力 dx = target_x - self.positions[ped_id][0] dy = target_y - self.positions[ped_id][1] F_drive = np.array([dx, dy]) * 0.45 # 排斥力 F_repel = np.zeros(2) for oid, opos in other_peds.items(): if oid == ped_id: continue diff = self.positions[ped_id] - opos dist = np.linalg.norm(diff) if dist < 0.5: F_repel += diff / (dist**2) * 0.35 total_force = F_drive + F_repel # 转换为概率 prob = softmax([total_force[0], total_force[1], -total_force[0], -total_force[1]]) return prob class VehicleYieldModel: def __init__(self, decel_rate=3.0): self.decel = decel_rate def yield_probability(self, speed_ms, distance_to_ped): if distance_to_ped < 2.5: p = max(0.0, 1.0 - speed_ms/15.0) return p return 0.0 class GapAcceptancePedestrian: def __init__(self, critical_gap=1.8, decay=0.2): self.crit_gap = critical_gap self.decay = decay self.wait_time = 0.0 def crossing_decision(self, current_gap): effective_gap = self.crit_gap * np.exp(-self.decay * self.wait_time) if current_gap > effective_gap: self.wait_time = 0.0 return True else: self.wait_time += 0.1 return False if __name__ == '__main__': model = MixedCAForceModel() model.positions[0] = np.array([5.0, 1.5]) probs = model.force_based_transition_prob(0, 5.2, 1.5, {0: np.array([5.0,1.5])}, []) print('Transition probabilities:', probs) vehicle = VehicleYieldModel() p_yield = vehicle.yield_probability(10.0, 2.0) print('Yield prob at 10 m/s and 2m:', p_yield) ped_gap = GapAcceptancePedestrian() decision = ped_gap.crossing_decision(1.2) print('Gap acceptance decision:', decision) # 过街时间计算示例 L = 12.0 # 长度12米 v_avg = 1.2 N_group = 5 Q_ped = 1000 W = 4.0 D_cluster = 0.02 * (N_group - 2)**1.2 D_inter = 0.5 * (Q_ped / W)**0.8 T_total = L / v_avg + D_cluster + D_inter print('Estimated crossing time: {:.2f} seconds'.format(T_total))

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询