Labs
Hands-on notebooks with real traffic data. Run them in Google Colab, with nothing to install.
Each lab is a Jupyter notebook. Open one below to read it with its results, or click Open in Colab at the top of the lab to run it yourself in the browser.
For more trajectory data to explore on your own, see Traffic Data.
Labs build on each other. They use trafficlab, the course’s own Python package, which grows over the semester into a complete traffic simulator.
TipComing up in the labs
- Lab 3 · From Video to Trajectories. Start from vehicle tracks extracted from video by a deep-learning detector and tracker, the same kind of pipeline behind drone datasets and video analytics. Clean them up, check them against physics, and see how much the cleaning changes flow, density and speed. (with Lecture 3)
- Lab 4 · Fix the Data. Hunt down broken and filled-in freeway detector data, repair a gap, and test the repaired counts against conservation between two stations. How much can you trust the result? (with Lecture 4)
- Lab 5 · The Fundamental Diagram, and the Wave It Predicts. Fit the diagram to real detector data by least squares and with a small neural network, test both beyond the data, then check the wave it predicts against a wave measured on real trajectories. (with Lecture 5)
- Lab 6 · Shock Waves and the Slow Truck. Code a solver for shock waves, check it against your hand calculations, then build the slow truck and reproduce what a detector downstream sees. (with Lecture 6)
- Lab 7 · Build Your Own Freeway (and Debug an AI-Written One). A cell transmission model with a lane drop, checked against hand solutions and conservation. Then find the bugs in a model written by an AI assistant. (with Lecture 7)
- Lab 8 · Teach a Car to Drive: IDM and MOBIL. Write a driver and a lane-change rule, plug them into a small simulator, and check them against theory. (with Lecture 8)
- Lab 9 · Phantom Jams for Real, and an AI Driver. Measure a real phantom jam on a ring road with 22 cars, reproduce it with your driver model, then train an AI driver on the real drivers and put it through three exams. (with Lecture 9)
- Lab 10 · How Sure Are We? Put error bars on two fits you already made, the fundamental diagram and a driver model on real ring-road drivers, and find the parameter the data cannot see. (with Lecture 10)
- Lab 11 · Beat Persistence. Forecast freeway speeds 5 to 60 minutes ahead from real detector data, evaluate honestly, and find out when a simple rule beats machine learning. Optional: estimate the traffic on your own Lab 7 freeway with an ensemble Kalman filter or a physics-informed network. (with Lecture 11)
- Lab 12 · One Smart Car. Mix one reinforcement-learning car with rule-following cars on a jammed ring road: can it smooth the jam? Catch it gaming its reward, fix the reward, and test it on traffic it has never seen. (with Lecture 12)
| Lab | What you'll do |
|---|---|
| Lab 1 · Real Traffic from the Sky | NGSIM trajectories · time-space diagrams · Edie’s definitions · a virtual loop detector |
| Lab 2 · Phantom Jams on Your Laptop | Reproduce the 1959 GM experiment · local and string stability · when a platoon collides |
No matching items