Skip to main content

A Python package for elevator traffic analysis and simulation

Project description

Elevator Traffic Analysis

CI Status

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.0 or higher (for Docker-based execution)
  • Operating system supporting bash shell
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elevator_traffic_analysis-0.1.5.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elevator_traffic_analysis-0.1.5-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file elevator_traffic_analysis-0.1.5.tar.gz.

File metadata

File hashes

Hashes for elevator_traffic_analysis-0.1.5.tar.gz
Algorithm Hash digest
SHA256 413474956f6240c29d32746d80d6068ad29bf10a17439482d217fc92e6742641
MD5 7ab13cf97128c10ffecddecb3a58b8d3
BLAKE2b-256 d2d5512d58a4013d0a27ecde852f91757eda17a1a6d1b6e31741b16dadc3ec11

See more details on using hashes here.

File details

Details for the file elevator_traffic_analysis-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for elevator_traffic_analysis-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 65f33cefea9f398a838001587008a26bcab46d3180d6f16020d0a460f122164f
MD5 f3fd7b19809e9ff1e4cd359c3e53292a
BLAKE2b-256 6dbdd4f8efdec2bcf3ba0fe897cd0bd3580f411d513f276d308eaf0bc9dd8d2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page