2D traffic modeling.
Project description
Autopysta
Autopysta is a python library for modeling 2-D highway traffic, it's written natively on C++ for better performance and wrapped in SWIG to be used in Python
-
Important
Only Python 3.8 works on Windows, other versions are not working due to problems with the .dll
For Linux you can use any version from Python 3.8 onwards and there's also legacy support for python 2.7
The 3.8 version is al compatible with Google Colaboratory
-
Details
The package comes with a .so file (Linux), a .pyd file (Windows) and a .py that uses those files depending on your OS
There is no Mac OS support at the moment, but an implementation is planned for future realeses
-
How to use
Installation
You can install Autopysta using the pip installer
pip install autopysta
To begin using Autopysta you just need to import the module on Python:
import
autopystaAnd now you can use all the functions available on the library
-
Examples
A quick implementation of Autopysta:
import autopysta as ap geo = ap.geometry(1000, 1, 0, 1000) newell = ap.newell() # Since this example doesn't use lane changes we use the no lane change as our model lcm = ap.no_lch() creators_list = [ap.fixed_state_creator(newell, 20, 10),] total_time = 120 # total_time must be a multiple of dt dt = 1.2 pre_made_vehicles = [] # We run the simulation simulation = ap.simulation(lcm, total_time, geo, creators_list, pre_made_vehicles, dt) results = simulation.run() # And plot the results results.plot_x_vs_t()
This gives us the following output :
INITIAL STATE SIMULATION
[simulation.cpp] Out of loops, getting the answer ready
And the plot :
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file autopysta-0.0.3.9.tar.gz
.
File metadata
- Download URL: autopysta-0.0.3.9.tar.gz
- Upload date:
- Size: 567.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc1d68c172c25e442680ff327b32ea4f2c152a9911ad7ffc80b932b6b4392d6c |
|
MD5 | d58232ebf1263f87a566779fe279c109 |
|
BLAKE2b-256 | e46f6b687276317ba37bf54a6bc59fb4013864749ff9d7c53be73aa0bf2ecee2 |
File details
Details for the file autopysta-0.0.3.9-py3-none-any.whl
.
File metadata
- Download URL: autopysta-0.0.3.9-py3-none-any.whl
- Upload date:
- Size: 575.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7a0660d022ecf90041a23134fc0b8977bb370944783e10185fb001aaa4ddd6d |
|
MD5 | dc69e91716100b7f4a06a3961a9e2513 |
|
BLAKE2b-256 | 151b29b6c567de56b45a415ee9fbe25ed9ba9871c93b1a0fc07e0edb365ade5e |