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.
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.
- 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.
Models a basic system where clients arrive at intervals and are served one-by-one in order of arrival.
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.
Introduces customer patience thresholds. Clients will leave the queue if their waiting time exceeds a specific limit before being served.
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.
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.
- 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).
- Python 3.8 or higher
- Rich library
-
Install the required dependencies: pip install -r requirements.txt
-
Execute the simulator: python main.py
-
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.
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.