A Python package for elevator traffic analysis and simulation
Project description
Elevator Traffic Analysis
A Python package for simulating and analyzing elevator traffic using various scheduling algorithms. This tool allows you to model building elevator systems, simulate passenger traffic patterns, and visualize elevator movements and waiting times.
Features
- Multiple Elevator Algorithms: Supports FCFS (First Come First Served), SCAN, LOOK, and SSTF (Shortest Seek Time First) scheduling algorithms
- Flexible Scenario Configuration: Define custom scenarios using YAML files
- Visualization: Generate plots showing elevator trajectories and passenger movements
- Comprehensive Testing: Includes unit tests with coverage reporting
- Docker Support: Easy deployment using containerization
- CLI Interface: Simple command-line interface for running simulations
Requirements
To run the project, you need:
- Docker version
24.0.0or higher (for Docker-based execution) - Operating system supporting
bashshell - Python 3.8+ (for alternative PyPI installation)
Running with Docker
The project includes an elevator-traffic-analysis script that simplifies working with containers and running simulations.
List Available Scenarios
cd elevator-traffic-analysis
./elevator-traffic-analysis list-scenarios
To add your own scenario, create a new YAML file (e.g., new_scenario.yaml) in the scenarios directory.
Run an Example Scenario
The following command runs the example scenario, generates a plot, and displays passenger IDs on trajectories:
./elevator-traffic-analysis run example --plot --show-passenger-ids
Display Available Options
./elevator-traffic-analysis --help
Run Tests with Coverage
./elevator-traffic-analysis test
Run Linter
./elevator-traffic-analysis lint
Alternative Installation (PyPI)
The project is also available as a pip package. The example below uses a virtual environment for installation:
python3 -m venv myenv
source myenv/bin/activate
pip install elevator-traffic-analysis
After installation, you can list available scenarios:
elevator-traffic-analysis list-scenarios
Running simulations, generating plots, and other parameters work the same way as in the Docker version.
Scenario Configuration
Scenarios are defined in YAML format. Example structure:
n_floors: 10
n_elevators: 1
elevator_capacity: 8
elevator_logic: shortest_seek_time_first
passenger_schedule:
0:
- passenger_id: P__0
appear_floor: F__0
destination_floor: F__5
Available Algorithms
- FCFS (First Come First Served): Services requests in the order they arrive
- SCAN: Elevator moves in one direction until no more requests, then reverses
- LOOK: Similar to SCAN but reverses immediately after the last request
- SSTF (Shortest Seek Time First): Services the closest request first
Output
Simulations generate:
- Output YAML files with detailed simulation results (in
scenarios_out/) - Visualization plots showing elevator movements (in
scenarios_plots/)
License
MIT License - see the LICENSE file for details.
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
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 elevator_traffic_analysis-0.1.5.tar.gz.
File metadata
- Download URL: elevator_traffic_analysis-0.1.5.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
413474956f6240c29d32746d80d6068ad29bf10a17439482d217fc92e6742641
|
|
| MD5 |
7ab13cf97128c10ffecddecb3a58b8d3
|
|
| BLAKE2b-256 |
d2d5512d58a4013d0a27ecde852f91757eda17a1a6d1b6e31741b16dadc3ec11
|
File details
Details for the file elevator_traffic_analysis-0.1.5-py3-none-any.whl.
File metadata
- Download URL: elevator_traffic_analysis-0.1.5-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65f33cefea9f398a838001587008a26bcab46d3180d6f16020d0a460f122164f
|
|
| MD5 |
f3fd7b19809e9ff1e4cd359c3e53292a
|
|
| BLAKE2b-256 |
6dbdd4f8efdec2bcf3ba0fe897cd0bd3580f411d513f276d308eaf0bc9dd8d2c
|