Skip to content
/ FleetPy Public

Simulation framework to model and control the tasks of vehicle fleets (routing, user-assignment, charging, ...)

License

Notifications You must be signed in to change notification settings

TUM-VT/FleetPy

Repository files navigation

πŸš– FleetPy – Open-Source Fleet Simulation Framework

GitHub stars
FleetPy is an open-source fleet simulation framework for modeling and controlling vehicle fleets in ride-sharing, autonomous mobility, and on-demand transport applications.

Whether you're a researcher, transportation engineer, or mobility innovator, FleetPy helps you analyze and optimize fleet operations, routing strategies, and demand-responsive services.

πŸ˜Άβ€πŸŒ«οΈ Fleetpy for dummies πŸ“– Read the Wiki | πŸ›  Installation Guide | πŸš€ Quickstart

Fleetpy Logo

🎯 Key Features

βœ… Agent-Based Simulation – Models individual vehicles, passengers, and operators.
βœ… Flexible User-Operator Interaction – Supports multiple request-acceptance models.
βœ… Multi-Fleet Management – Simulates ride-pooling, dispatching, and EV charging.
βœ… Customizable Routing Algorithms – Choose between memory-efficient and fast methods.
βœ… Modular & Extensible Design – Easily integrate new demand models, routing strategies, or data sources.
βœ… Optimized for Large-Scale Scenarios – Handles thousands of vehicles and requests efficiently.


πŸš€ Quickstart

Get up and running in just a few commands!

# Clone the repository
git clone https://github.com/TUM-VT/FleetPy.git
cd FleetPy

# Set up the virtual environment
conda env create -f environment.yml
conda activate fleetpy

# Run an example simulation
python run_examples.py

βœ” The results will be saved in FleetPy/studies/example_study/results/
βœ” To visualize the results, run:

python replay_pyplot.py scenario_result_directory

πŸ›  Installation

1️⃣ Install with Conda (Recommended)

Ensure you have Anaconda installed.

# Fetch the latest updates
git clone https://github.com/TUM-VT/FleetPy.git
cd FleetPy

# Set up a Conda environment
conda env create -f environment.yml
conda activate fleetpy

2️⃣ Install C++ Router (Recommended)

For improved routing efficiency, compile the C++ router:

cd FleetPy/src/routing/cpp_router
python setup.py build_ext --inplace

Ensure a C++ compiler and Cython are installed.

3️⃣ Install Optimizer (Optional)

For advanced optimization tasks, install the necessary optimizers:

πŸ† Gurobi

To install Gurobi:

python -m pip install gurobipy==12.0.1

You can acquire a free academic license from Gurobi. πŸŽ“

⚑ OR-Tools

To install Google's OR-Tools:

pip install ortools

This is useful for combinatorial optimization and routing problems.


πŸ“‚ Data Preparation and Study Setup

For now, you can inspect the data structures and files in the examples provided in GitHub:

  • πŸ“ FleetPy/data
  • πŸ“ FleetPy/studies

More detailed descriptions of the data structure, preprocessing steps, and result data will be provided in upcoming versions. Additionally, a GUI to set up scenarios (with a choice of submodules and data) is planned for the future. 🎨

In general, you can save your data and study definitions in the mentioned directories. These are included in .gitignore.


πŸ“Š Running a Simulation

To test an example scenario:

python run_examples.py

βœ” The output will be stored in:
πŸ“‚ FleetPy/studies/example_study/results/

πŸ“Š Output Files

File Name Description
1_user_stats.csv User request statistics
2_0_op-stats.csv Fleet vehicle task logs
standard_eval.csv Aggregated evaluation results

To analyze trends:

python FleetPy/src/evaluation/temporal.py scenario_result_directory

πŸŽ₯ Watch a Replay

To visualize a previously simulated scenario, run:

python replay_pyplot.py scenario_result_directory <sim_seconds_per_real_second>

πŸ›‘ (Optional: Specify start time as an additional argument.)


Benchmark Data Sets

Input data and corresponding example scenario files are available for large-scale case studies of Manhattan, NY, Chicago, IL, and Munich, Germany. This data can be used as benchmark data sets to test and compare new algorithms or to set up large-scale simulations quickly. The FleetPy input data can be downloaded here and has to be copied into the FleetPy/data folder:


🀝 Contributing

We welcome contributions from the community! πŸš€
πŸ“Œ How to contribute:

  1. Fork the repo & create a feature branch (git checkout -b new-feature).
  2. Commit your changes (git commit -m "Added a cool feature").
  3. Push to your branch (git push origin new-feature).
  4. Make sure that the module tests are running (\studies\module_tests\run_module_tests.py).
  5. Open a Pull Request!

πŸ“’ Get Involved

πŸ’¬ Join the discussion: GitHub Discussions
πŸ’» Contribute: Open an issue or PR!
⭐ Support FleetPy: Give us a star ⭐ on GitHub!
πŸš€ Stay updated: Follow us on Homepage & LinkedIn


πŸ“Œ Tested on

βœ” Windows 10 Pro x64
βœ” Chrome 79.0.3945
βœ” Python 3.10


πŸ§ͺ Research Projects Using FleetPy

FleetPy has been applied in various academic and applied research projects across topics like shared mobility, autonomous vehicle operations, and electrified fleets:

Ongoing Projects

  • CONDUCTOR – Development of an integrated ride-parcel-pooling service using automated vehicles (CCAM), evaluated via FleetPy-Aimsun coupling (multi-modal integration, AVs, cooperative routing, traffic control, simulation coupling)
  • metaCCAZE – Scientific support and simulation-based evaluation of Munich’s Living Lab innovations including multimodal logistics hubs, dynamic curbside management, and connected/autonomous last-mile vehicles. FleetPy contributes to monitoring and optimizing operations (multimodal hubs, curbside management, AV logistics, LL evaluation, policy support)
  • MINGA – Evaluation of AV stop concepts and passenger interactions at TUM’s test field. FleetPy is used alongside MATSim and microscopic traffic simulations to model AV and non-AV traffic, evaluate climate and system-wide impacts, and support accessibility-focused user studies (AV integration, stop concepts, MATSim coupling, KPI evaluation, accessibility research)
  • STADT:up – Simulation of autonomous shuttle bus in different inter-mobility scenarios with dynamic stops (Operation, traffic evaluation)
  • SUM (Seamless Shared Urban Mobility) – Simulation-based evaluation of operational strategies for automated on-demand fleets in Munich using FleetPy, including integration with public transport, pricing strategies, and transferability to future mobility hubs (on-demand AV fleets, public transport integration, pricing, living lab scalability)

Completed Projects

  • MOIA – Implementation of algorithms to represent MOIA’s fleet control (operation, ride-pooling)

  • MCube: STEAM – Simulation of semi-flexible bus lines in Munich using FleetPy, integrated with the TUM-OSM decision support system (agent-based simulation, semi-flexible transit, DSS coupling, urban mobility, evaluation pipeline)

🧠 Do you use FleetPy in your research? Let us know!


Citation

If you find this framework useful for your work or use it in your project, please consider citing: Engelhardt, R., Dandl, F., Syed, A., Zhang, Y., Fehn, F., Wolf, F., Bogenberger, K. (2022). FleetPy: A Modular Open-Source Simulation Tool for Mobility On-Demand Services. Arxiv pre-print

@misc{engelhardt2022fleetpymodularopensourcesimulation,
      title={FleetPy: A Modular Open-Source Simulation Tool for Mobility On-Demand Services}, 
      author={Roman Engelhardt and Florian Dandl and Arslan-Ali Syed and Yunfei Zhang and Fabian Fehn and Fynn Wolf and Klaus Bogenberger},
      year={2022},
      eprint={2207.14246},
      archivePrefix={arXiv},
      primaryClass={cs.MA},
      url={https://arxiv.org/abs/2207.14246}, 
}

About

Simulation framework to model and control the tasks of vehicle fleets (routing, user-assignment, charging, ...)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 11