Skip to main content

IVT Public Transport Optimization Exercises (PUV, TS Part)

PyPI version Downloads black isort License: MIT mypyc flake8 pylint

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:

  1. Clone the repository to a suitable location on your computer.
  2. Create your virtual environment (venv) using Python 3.10 with the command:
    python -m venv venv
    
  3. Activate your venv:
    • On Windows:
      .\venv\Scripts\activate
      
    • On macOS/Linux:
      source venv/bin/activate
      
  4. Install openbus_light using the provided wheel file:
    pip install openbus_light-X.X.X-py3-none-any.whl
    
    (Replace X.X.X with the actual version number.)
  5. Verify the setup by running the unittests:
    python -m unittest
    
  6. Open your preferred IDE and begin working on exercise_3.py and exercise_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

  1. Ensure both exercise_3.py and solve_exercise_3.py are present in your working directory.
  2. Execute the solve_exercise_3.py script from your terminal to initiate the experiments:
    python solve_exercise_3.py
    
    This script will automatically run multiple configurations of the LPP in parallel, collect results, and generate insightful plots for analysis.
  3. Experiment summaries and plots will be saved in the results directory. 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

  1. Ensure you've completed the setup steps and have access to the necessary data files.
  2. 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 the results directory 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.

Metadata

Release files for openbus-light 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openbus-light 0.4.0
File Size Uploaded Provenance Actions
openbus_light-0.4.0.tar.gz 41.0 MB Without provenance Details for openbus_light-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openbus-light 0.4.0
File Interpreter ABI Platform Actions
openbus_light-0.4.0-py3-none-any.whl Python 3 none any Details for openbus_light-0.4.0-py3-none-any.whl

Total release size: 41.1 MB

Release files / openbus_light-0.4.0.tar.gz

Download URL openbus_light-0.4.0.tar.gz
Size 41.0 MB
Tags Source
SHA-256 checksum
How to use checksums
13c9e0c38d428d1717ba302f922b21c762447be061f07ceae4b5235af972152e
BLAKE2b-256 checksum
How to use checksums
bcefdcb4475f6c8bc8cad978f62bf7c26f17b5e8877f0b177ac1da386e02b189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.4

Release files / openbus_light-0.4.0-py3-none-any.whl

Download URL openbus_light-0.4.0-py3-none-any.whl
Size 43.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d0ca5980bda943cb9b0811a8cb19f5b67a16080af30d0c137fcfae7800686ec
BLAKE2b-256 checksum
How to use checksums
f27fee9b6a9a649b338d58310bab941470eb034a89346fb208ada7f6ed9be170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.4

Security for openbus-light 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page