How pablousky4/scheduler works
Project type and purpose
• This is a CLI‐driven simulation tool (“Scheduler”) that models process scheduling in an OS using FCFS (First‐Come‐First‐Serve) and Round‐Robin algorithms.
• It is not a multi‐tier web app or distributed microservice: it’s a single‐executable package with core scheduling logic, process abstractions, metrics calculation, and a simple CLI front end.
File structure
• Top-level:
• main.py (entry point / CLI)
• requirements.txt (dependencies)
• src/ (core logic)
– proceso.py (Process data model)
– repositorio.py (in‐memory or persisted process repository)
– scheduler.py (scheduling algorithms orchestrator)
– metrics.py (collects and computes run‐time statistics)
– __init__.py
• tests/ (pytest suite mirroring src modules)
• The structure implies a layered design:
• CLI layer invokes the scheduling engine
• Engine layer manages processes and algorithms
• Data layer holds processes
• Metrics layer consumes results
Extract insights from README
• Confirms CLI interface in main.py calls into src/
• Describes two scheduling strategies (FCFS, RR)
• Emphasizes simulation and reporting, not persistence or networking
a. Main components
• CLI Interface (main.py)
• Scheduler Engine
– FCFS strategy
– Round-Robin strategy
• Process Repository
• Process Model
• Metrics Calculator
b. Relationships and interactions
1. User → CLI: user invokes simulation with arguments
2. CLI → Scheduler Engine: passes process list and parameters
3. Scheduler Engine ↔ Process Repository:
• retrieves process definitions
• updates their state (ready, running, finished)
4. Scheduler Engine → Metrics Calculator: streams state transitions or final stats
5. Metrics Calculator → CLI: returns report to display
c. Architectural patterns / principles
• Single Responsibility: each module has a distinct concern (model, repo, engine, metrics, UI)
• Dependency Injection: CLI instantiates repository, engine, metrics and wires them together
• Strategy Pattern: scheduler.py selects between FCFS or RR at runtime
d. Key technologies / libraries
• Python 3.x standard libraries
• pytest for unit tests