How maxitoto/integradorso works
Project Type and Purpose
• This is a Java-based CPU scheduling simulator organized with an MVC structure.
• It reads a list of processes (procesos.txt), applies different scheduling policies (FCFS, Round Robin, SPN, etc.), updates process state over time, and writes out results in the Resultados directory.
High-Level Architecture Components
a. User Interface Layer (View)
• View/InicioView.java – main GUI window for loading processes, selecting policy, starting/stopping simulation
• View/ControllerErroresView.java – dialog for showing errors or logs
b. Controller Layer
• Controller/inicioController.java – mediates user events (button clicks) → starts/stops simulation → updates View
• Controller/ControllerErroresView.java – handles error logging and display
c. Simulation Engine
• Simulador/iniciador.java – contains main(String[]), bootstraps So (Sistema Operativo) instance, kicks off the scheduling loop
• So.java (Model) – core orchestrator: holds references to ready/blocked queues, CPU instance, current policy, drives time ticks
d. Domain Model (Model)
• Process representation
– Proceso.java – data structure for a process (ID, burst time, priority, etc.)
– Estados (Nuevo, Listo, Ejecutando, Bloqueado, Terminado) – State Pattern: each state implements Estado interface
• Scheduling Policies (Strategy Pattern)
– Politica.java – interface for selecting next process
– FCFS.java, RoundRobin.java, SPN.java, SRTN.java, PrioridadExterna.java – concrete implementations
• CPU.java – simulates CPU time slice, executes the current Proceso
e. Persistence & Artifacts
• Resultados/*.txt – output logs per policy
• procesos.txt – sample input
• TPI-TomasBlanco.jar – compiled simulator JAR
f. Documentation & UML
• “Políticas de Planificación…” PDF – design paper
Interactions & Data Flow
1) User triggers “Start” in InicioView → calls inicioController.startSimulation()
2) Controller loads procesos.txt → builds Proceso objects → passes to So instance
3) So loops:
– Queries current Politica for next Proceso
– Moves Proceso through Estados (State transitions)
– Delegates to CPU.execute() for time slice
– Writes intermediate state to log (in-memory or file)
4) Controller polls So for status updates → updates View with Gantt chart or table
5) On completion, So writes final timeline to Resultados/<policy>.txt → View notifies user
Key Architectural Patterns
• MVC (View <> Controller <> Model)
• Strategy Pattern for scheduling policies (Politica + implementations)
• State Pattern for process life-cycle (Estados hierarchy)