← Portfolio

Melbourne Cafés Agent-Based Model

An agent-based model of pedestrians walking to cafés across Melbourne.

Links
Topics
urban analyticsagent-based modelling
Stack
NetLogoPythonOSMNx

CASA0011 assessment (CASA, UCL).

Goal

Spatially explicit agent-based model of pedestrians walking to cafes in Melbourne.

Methodology

Built in NetLogo, using the GIS extension to load a real Melbourne street network and café locations as shapefiles (from OSMNx). Roads become a graph: each vertex becomes a node, connected by weighted links (weight = segment length), with a proximity pass to stitch adjacent polylines into one connected network. Cafés snap to their nearest node.

Pedestrian agents spawn at random points on the network, each with a workplace (spawn node) and a minimum time-at-café drawn from a normal distribution. Route to the nearest café uses nw:turtles-on-weighted-path-to — Dijkstra shortest path weighted by edge length.

Cafés fill up like this: each gets a max-capacity drawn from a normal distribution around avg-cafe-capacity. Every tick, a café counts pedestrians at its node marked at-cafe; hitting max-capacity flags it at-capacity? and turns it red. Agents split into “waiters” and “reroute-rs” via a waiting-prop parameter — waiters queue at the door if their café is full on arrival; reroute-rs recheck every 3 ticks and retarget the nearest available café if theirs fills up. After the minimum time elapses, an agent heads back to its workplace via the same shortest-path logic and despawns on arrival. Distance travelled and capacity stats are logged and plotted live each tick.

Systematic experiments run via BehaviorSpace; documented with the ODD protocol.