A simulation of urban incidents involving pedestrians and vehicles based on Weighted A*
Edgar Gonzalez Fernandez
TL;DR
This work introduces a multiagent urban simulation that models pedestrians and vehicles on a 2D grid using a risk-aware Weighted A* pathfinding approach to study safety and mobility under varying infrastructure and behavioral conditions. Agents operate with a four-phase loop and optimize routes via the cost function $f(n) = g(v) + w h(v) + α r(a,v)$, where $h(v)$ is the Manhattan distance and $α$ encodes risk weights. The framework supports configurable populations, obstacle placement, and scenario variation, with heatmaps and metrics (e.g., jaywalking, runovers, and average speed) to analyze outcomes. Findings show that vehicle density is a primary driver of collisions, sidewalk obstructions redirect pedestrians and influence congestion, and path-weight settings shape risk-taking, offering actionable guidance for urban planning and safety interventions. The implementation in Python with AgentPy provides a flexible, data-driven platform that can be extended to real-time data integration, adaptive behaviors, and comparative planner evaluations.
Abstract
This document presents a comprehensive simulation framework designed to model urban incidents involving pedestrians and vehicles. Using a multiagent systems approach, two types of agents (pedestrians and vehicles) are introduced within a 2D grid based urban environment. The environment encodes streets, sidewalks, buildings, zebra crossings, and obstacles such as potholes and infrastructure elements. Each agent employs a weighted A* algorithm for pathfinding, allowing for variation in decision making behavior such as reckless movement or strict rule-following. The model aims to simulate interactions, assess risk of collisions, and evaluate efficiency under varying environmental and behavioral conditions. Experimental results explore how factors like obstacle density, presence of traffic control mechanisms, and behavioral deviations affect safety and travel efficiency.
