Code for PuV TS-PART
Project description
IVT Public Transport Optimization Exercises (PUV, TS Part)
This repository contains exercises developed by the Institute for Transport Planning and Systems (IVT) at ETH Zurich. These exercises focus on public transport optimization, covering topics like line planning, timetable evaluation, and operational performance analysis.
Setup:
You can now install openbus_light directly from PyPI:
pip install openbus-light
Alternatively, if you prefer using the provided wheel file:
- Clone the repository to a suitable location on your computer.
- Create your virtual environment (venv) using Python 3.10 with the command:
python -m venv venv
- Activate your venv:
- On Windows:
.\venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
- Install
openbus_lightusing the provided wheel file:pip install openbus_light-X.X.X-py3-none-any.whl
(ReplaceX.X.Xwith the actual version number.) - Verify the setup by running the unittests:
python -m unittest
- Open your preferred IDE and begin working on
exercise_3.pyandexercise_4.py.
Running the Line Planning Problem Experiments (Exercise 3)
The line planning problem (LPP) experiments are designed to explore the impacts of various parameters on the planning outcomes. exercise_3.py serves as the main script for executing these experiments in parallel.
How to Run Experiments
- Ensure both
exercise_3.pyandsolve_exercise_3.pyare present in your working directory. - Execute the
solve_exercise_3.pyscript from your terminal to initiate the experiments:python solve_exercise_3.pyThis script will automatically run multiple configurations of the LPP in parallel, collect results, and generate insightful plots for analysis. - Experiment summaries and plots will be saved in the
resultsdirectory. Review these materials to analyze the performance and outcomes of different configurations.
Analyzing Trip and Dwell Times (Exercise 4)
In exercise_4.py, you will analyze the trip and dwell times for bus lines using recorded measurements. This involves calculating and comparing planned versus observed trip times and dwell times for selected bus lines.
How to Run Analysis
- Ensure you've completed the setup steps and have access to the necessary data files.
- Run
exercise_4.py, optionally specifying the bus line numbers for analysis. This script will load bus lines with recorded measurements, calculate trip and dwell times, and prepare the data for further analysis.
Note: The script includes a NotImplementedError as a placeholder for where you will need to process and display the analysis results. This is an intentional aspect of the exercise, designed to encourage you to apply what you've learned from Exercise 3, such as plotting techniques, and extend it with additional insights, like plotting data on maps or between stations.
Adding Result Plotting
Result plotting provides a visual analysis of the experiment outcomes, enhancing understanding through visual means.
- After executing
solve_exercise_3.py, visit theresultsdirectory to find the generated HTML files. - Open these files in a web browser to view the scatter and bar plots, which visualize the experiments' results. The scatter plot displays the number of vehicles versus the objective (CHF per hour), while the bar plot details the objective by activity, offering a breakdown of cost components.
Student Engagement and Adaptation
Exercise 4 is purposefully left incomplete to challenge you to apply and adapt the learnings from Exercise 3. This includes utilizing plotting capabilities and integrating geographic data visualization to enrich your analysis. You are encouraged to manipulate and extend the provided code to explore creative and insightful ways of representing and analyzing the data.
Conclusion
These exercises are crafted to provide a comprehensive, hands-on experience with public transport optimization, covering everything from setup and execution of line planning problems to in-depth data analysis and visualization. By following the above instructions and engaging actively with the exercises, you will deepen your understanding of transport planning challenges and solutions.
This project is part of the Institute for Transport Planning and Systems (IVT) at ETH Zurich and is used in educational settings for students to gain hands-on experience in public transport optimization.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openbus_light-0.1.1.tar.gz.
File metadata
- Download URL: openbus_light-0.1.1.tar.gz
- Upload date:
- Size: 41.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef57c4f450aeb2c4869607f7655e11b480757672edac2252b96f50b917274b6
|
|
| MD5 |
b722f423a4652ff963c548a744b11710
|
|
| BLAKE2b-256 |
10075a3ec11e489e72a68da9283724da4ea2fdf2bc9943dca42ff8acabf610d3
|
File details
Details for the file openbus_light-0.1.1-py3-none-any.whl.
File metadata
- Download URL: openbus_light-0.1.1-py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bec8fabb286f80c3ec592cd14510d47b47aada1faa67affe6636a037013e79a1
|
|
| MD5 |
2284f914384e47787ba9d5224226a8b7
|
|
| BLAKE2b-256 |
85f3715b474ce54fd9b94c245fb401781d92f68f99d77e6f2e93e679badc62a3
|