simobility
A human-friendly Python framework that helps scientists and engineers to prototype and compare fleet optimization algorithms (autonomous and human-driven vehicles).
https://github.com/sash-ko/simobility
Category: Consumption
Sub Category: Mobility and Transportation
Keywords
autonomous-vehicles fleet-management mobility mobility-modeling optimization-algorithms python ridehailing ridesharing simulation-framework simulator transportation
Last synced: about 2 hours ago
JSON representation
Repository metadata
simobility - light-weight mobility simulation framework. Best for quick prototyping
- Host: GitHub
- URL: https://github.com/sash-ko/simobility
- Owner: sash-ko
- License: mit
- Created: 2020-01-22T18:23:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T14:07:50.000Z (over 4 years ago)
- Last Synced: 2025-04-10T04:00:46.717Z (17 days ago)
- Topics: autonomous-vehicles, fleet-management, mobility, mobility-modeling, optimization-algorithms, python, ridehailing, ridesharing, simulation-framework, simulator, transportation
- Language: Python
- Size: 126 MB
- Stars: 42
- Watchers: 3
- Forks: 9
- Open Issues: 6
- Releases: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
simobility
simobility is a light-weight mobility simulation framework. Best for quick prototyping
simobility is a human-friendly Python framework that helps scientists and engineers to prototype and compare fleet optimization algorithms (autonomous and human-driven vehicles). It provides a set of building blocks that can be used to design different simulation scenarious, run simulations and calculate metrics. It is easy to plug in custom demand models, customer behavior models, fleet types, spatio-temporal models (for example, use OSRM for routing vehicles and machine learning models trained on historical data to predict ETA).
Motivation
Create an environment for experiments with machine learning algorithms for decision-making problems in mobility services and compare them to classical solutions.
Some examples:
-
Deep Reinforcement Learning with Applications in Transportation
-
T. Oda and C. Joe-Wong, "Movi: A model-free approach to dynamic fleet management". 2018
Installation
pip install simobility
Contributions and thanks
Thanks to all who contributed to the concept/code:
Examples
Benchmarks
Benchmark simulations with LinearRouter
and GreedyMatcher
. Simulations will run slower with OSRMRouter
because OSRM
cannot process requests as fast as the linear router.
Processor: 2,3 GHz Dual-Core Intel Core i5; Memory: 8 GB 2133 MHz LPDDR3
Simulated time | Simulation step | Vehicles | Bookings per hour | Execution time | Generated events | Pickup rate |
---|---|---|---|---|---|---|
1 hour | 10 sec | 50 | 100 | 4 sec | 1082 | 96.97% |
24 hours | 1 min | 50 | 100 | 12 sec | 23745 | 88.37% |
24 hours | 10 sec | 50 | 100 | 20 sec | 23880 | 88.84% |
12 hours | 10 sec | 200 | 100 | 18 sec | 13337 | 99.89% |
12 hours | 10 sec | 50 | 500 | 31 sec | 40954 | 53.92% |
12 hours | 10 sec | 200 | 500 | 46 sec | 65444 | 99.3% |
12 hours | 10 sec | 1000 | 500 | 1 min 48 sec | 66605 | 99.98% |
1 hour | 1 min | 1000 | 1000 | 14 sec | 11486 | |
1 hour | 10 sec | 1000 | 1000 | 18 sec | 11631 | |
24 hours | 1 min | 1000 | 1000 | 5 min 1 sec | 262384 | |
24 hours | 10 sec | 1000 | 1000 | 6 min 20 sec | 262524 |
A heuristic that allows estimating a maximum number of booking a fleet of N vehicles can handle: assume that an avarage trip duration is 15 minute, than 1 vehicle can not more then handle 4 booking per hour and the upper limit for 1000 vehicles is 4000 bookings per hour.
Metrics example
{
"avg_paid_utilization": 63.98,
"avg_utilization": 96.87,
"avg_waiting_time": 292.92,
"created": 3998,
"dropoffs": 589,
"empty_distance": 640.37,
"empty_distance_pcnt": 33.67,
"fleet_paid_utilization": 63.98,
"fleet_utilization": 96.87,
"num_vehicles": 50,
"pickup_rate": 15.48,
"pickups": 619,
"total_distance": 1902.04,
}
Simulation logs
The are multiple ways to collect simulation log - use CSV or InMemory log handler or implement your own handler: loggers
Read CSV logs with pandas:
import pandas as pd
data = pd.read_csv(
"simulation_output.csv",
sep=";",
converters={"details": lambda v: eval(v)},
)
details = data.details.apply(pd.Series)
Run OSRM
wget http://download.geofabrik.de/north-america/us/new-york-latest.osm.pbf
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/new-york-latest.osm.pbf
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/new-york-latest.osrm
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/new-york-latest.osrm
docker run -d -t -i -p 5010:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/new-york-latest.osrm
Owner metadata
- Name: Oleksandr Lysenko
- Login: sash-ko
- Email:
- Kind: user
- Description:
- Website: http://twitter.com/sash_ko
- Location: Berlin
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/220472?u=409a076d99b51c5af3bc40b6103a82006cdffe70&v=4
- Repositories: 23
- Last ynced at: 2024-06-11T15:44:55.071Z
- Profile URL: https://github.com/sash-ko
GitHub Events
Total
- Watch event: 3
Last Year
- Watch event: 3
Committers metadata
Last synced: 6 days ago
Total Commits: 231
Total Committers: 2
Avg Commits per committer: 115.5
Development Distribution Score (DDS): 0.009
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Oleksandr Lysenko | s****o@g****m | 229 |
Yabir G | y****b@g****m | 2 |
Committer domains:
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 7
Total pull requests: 4
Average time to close issues: about 1 month
Average time to close pull requests: about 3 hours
Total issue authors: 3
Total pull request authors: 2
Average comments per issue: 1.71
Average comments per pull request: 0.0
Merged pull request: 4
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- sash-ko (5)
- Xiaobing-Shen (1)
- lijiawei20161002 (1)
Top Pull Request Authors
- sash-ko (3)
- yabirgb (1)
Top Issue Labels
- research (2)
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 72 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 3
- Total maintainers: 1
pypi.org: simobility
Lightweight mobility simulation for quick algorithm prototyping
- Homepage: https://github.com/sash-ko/simobility
- Documentation: https://simobility.readthedocs.io/
- Licenses: MIT
- Latest release: 0.3.0 (published about 5 years ago)
- Last Synced: 2025-04-26T12:01:43.605Z (1 day ago)
- Versions: 3
- Dependent Packages: 0
- Dependent Repositories: 1
- Downloads: 72 Last month
-
Rankings:
- Dependent packages count: 7.373%
- Stargazers count: 10.781%
- Forks count: 11.468%
- Dependent repos count: 22.233%
- Average: 26.432%
- Downloads: 80.304%
- Maintainers (1)
Score: 8.868413284672007