Skip to content

leo01102/seriat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seriat: Queuing System Simulator

Seriat is a Python-based discrete-event simulation (DES) tool designed to model and analyze various queuing system configurations. This application was developed as a comprehensive solution for the Practical Work No. 1 (TP1) of the Systems Modelling and Simulation module.

Overview

The application utilizes a priority-queue-based simulation engine to process events chronologically. It provides a structured CLI interface to configure and execute five distinct simulation scenarios, ranging from standard single-server queues to complex systems involving server downtime, customer abandonment, and priority-based processing.

Key Features

  • Modular Architecture: Separation of the core simulation engine, problem-specific logic, and user interface.
  • Interactive CLI: Step-by-step configuration using the Rich library for formatted output and tables.
  • Predefined Presets: Includes data sequences from TP1 tables to facilitate verification of manual simulations.
  • Flexible Generators: Support for constant values, list-based sequences, and extensible random distributions for time intervals.
  • State Tracking: Detailed recording of system state changes (clock, queue size, server status) for every processed event.

Implemented Scenarios

1. Standard Single Server (FCFS)

Models a basic system where clients arrive at intervals and are served one-by-one in order of arrival.

2. Server with Work/Rest Intervals

Simulates a system where the server alternates between active work periods and rest intervals. Includes logic for suspending and resuming services when the server departs.

3. Reneging (Abandonment)

Introduces customer patience thresholds. Clients will leave the queue if their waiting time exceeds a specific limit before being served.

4. Priority Queuing

Manages two types of clients (A and B). Type A clients are granted priority for service over Type B clients, while maintaining First-Come, First-Served order within each category.

5. Security Zone and Travel Time

Models a system with physical separation between the queue and the service point. Clients must cross a "Security Zone," introducing travel time and occupancy constraints for that zone.

Project Structure

  • main.py: Application entry point and orchestration.
  • sim/
    • engine.py: Core Discrete Event Simulation engine using heapq.
    • problems/: Specific state transition logic for each TP1 problem.
  • ui/
    • cli.py: Rich-based command line interface and result formatting.
  • utils/
    • generators.py: Time interval generation logic (Constant and List-based).

Requirements

  • Python 3.8 or higher
  • Rich library

Installation and Usage

  1. Install the required dependencies: pip install -r requirements.txt

  2. Execute the simulator: python main.py

  3. Follow the on-screen prompts to:

    • Select the problem type.
    • Configure time generators (Arrival, Service, etc.) using constants, custom lists, or presets.
    • Define the number of events to simulate.
    • View the generated simulation table.

Technical Implementation Details

The simulation operates on a Next-Event Time Advance mechanism. The engine maintains an event list sorted by time. Each event type (ARRIVAL, END_SERVICE, etc.) triggers a specific handler that updates state variables and schedules future events based on the configured generators. This ensures high precision and adherence to the theoretical models of queuing theory.

About

A Python-based discrete-event simulation (DES) engine for modeling and analyzing complex queuing systems, featuring priority queues, server downtime, and customer reneging.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages