Supporting Code for "Epidemics on the Move" Study
Description
This repository contains code and sample data used to generate resampled public transport demand scenarios for the study "Epidemics on the Move: How Public Transport Demand and Capacity Shape Disease Spread"
Contents
- resample_original_data.py — a Python script for generating synthetic transit demand datasets by resampling passenger trips.
- original_demand/trip_list_clean.txt — a cleaned sample of the original public transport trip data used for resampling.
The script generates synthetic public transport demand datasets by resampling with replacement from an original data sample.
The original dataset was sourced from this link.
Each sampling unit is a passenger tour, consisting of all trips made by a single individual throughout the day.
By randomly selecting entire passenger tours (with replacement), the script preserves the temporal and spatial structure of individual travel patterns, allowing for realistic generation of alternative demand scenarios.
Starting from a baseline scenario of 117,500 trips, the script creates additional scenarios corresponding to reduced demand levels (e.g., 83%, 66.5%, 59%, and 50% of the baseline demand).
Each generated scenario is saved into a separate directory:
-
original_demand/demand_100/ -
original_demand/demand_83/ -
original_demand/demand_66_5/ -
original_demand/demand_59/ original_demand/demand_50/
Parameters
The following parameters can be adjusted in resample_original_data.py to generate alternative scenarios:
- baseline_demand: Sets the number of trips in the baseline (full demand) scenario.
- demand_level: A list of demand percentages relative to the baseline, used to generate reduced demand scenarios
Files
resampling_module.zip
Files
(46.9 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:0fed72e6791631e2c86975d14c06f515
|
46.9 kB | Preview Download |