# himanishpuri/uct401 architecture

> Architecture diagram of the GitHub repository himanishpuri/uct401, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/himanishpuri/uct401
- Repository: https://github.com/himanishpuri/uct401

## Overview

##### Project type and purpose
- This is a C++ console application (an educational “open-source tool”) that implements five CPU scheduling algorithms (FCFS, SJF, Round Robin, Priority, SRTF) for an Operating Systems course.
- Its primary components are a command-line interface (main.cpp), a scheduling engine (OperatingSystemLab), individual algorithm implementations (in src), and a logging utility.

##### File structure
- Top level
- CMakeLists.txt – build & configuration
- main.cpp – application entrypoint / CLI
- /OperatingSystemLab.h + src/OperatingSystemLab.cpp – core engine
- util/logger.h + util/logger.cpp – logging utility
- Pattern
- Monolithic process, subdivided into modules (CLI, engine, algorithms, logger)
- Algorithm implementations live inside OperatingSystemLab (could be viewed as a Strategy pattern)

##### README for additional insights
- The README confirms usage of CMake to configure/build, then runs a single executable that presents or runs algorithms.
- No external services or databases—pure in-memory computation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User invocation
    User["User"]:::external
    User -->|"invokes"| Executable

    %% CLI Layer
    subgraph "CLI Layer"
        Executable["Executable (main.cpp)"]:::cli
    end

    %% Scheduling Engine
    subgraph "Scheduling Engine"
        OSLab["OperatingSystemLab.cpp/.h"]:::engine
    end

    %% Scheduling Strategies
    subgraph "Scheduling Strategies"
        FCFS["FCFS"]:::algo
        SJF["SJF"]:::algo
        RR["Round Robin"]:::algo
        Priority["Priority"]:::algo
        SRTF["SRTF"]:::algo
    end

    %% Utility Module
    Logger["Logger (logger.cpp/.h)"]:::util

    %% Console Output
    Console["Console Output"]:::external

    %% Build & Documentation
    subgraph "Project Files"
        CMake["CMake Build System (CMakeLists.txt)"]:::build
        README["README.md"]:::build
        Gitignore[".gitignore"]:::build
    end

    %% Relationships
    Executable -->|"calls API"| OSLab
    OSLab -->|"processList"| FCFS
    OSLab -->|"processList"| SJF
    OSLab -->|"processList"| RR
    OSLab -->|"processList"| Priority
    OSLab -->|"processList"| SRTF
    FCFS -->|"scheduleResult"| OSLab
    SJF -->|"scheduleResult"| OSLab
    RR -->|"scheduleResult"| OSLab
    Priority -->|"scheduleResult"| OSLab
    SRTF -->|"scheduleResult"| OSLab
    OSLab -->|"uses logger"| Logger
    OSLab -->|"outputs"| Console
    CMake -->|"builds"| Executable

    %% Click Events
    click Executable "https://github.com/himanishpuri/uct401/blob/main/main.cpp"
    click OSLab "https://github.com/himanishpuri/uct401/blob/main/include/OperatingSystemLab.h"
    click OSLab "https://github.com/himanishpuri/uct401/blob/main/src/OperatingSystemLab.cpp"
    click Logger "https://github.com/himanishpuri/uct401/blob/main/util/logger.h"
    click Logger "https://github.com/himanishpuri/uct401/blob/main/util/logger.cpp"
    click CMake "https://github.com/himanishpuri/uct401/blob/main/CMakeLists.txt"
    click README "https://github.com/himanishpuri/uct401/blob/main/READme.md"
    click Gitignore "https://github.com/himanishpuri/uct401/blob/main/.gitignore"

    %% Styles
    classDef cli fill:#B3D9FF,stroke:#0366D6,color:#000;
    classDef engine fill:#CCE5FF,stroke:#004085,color:#000;
    classDef algo fill:#D4EDDA,stroke:#155724,color:#000;
    classDef util fill:#FFF3CD,stroke:#856404,color:#000;
    classDef build fill:#E2E3E5,stroke:#6C757D,color:#000;
    classDef external fill:#F5F5F5,stroke:#999,color:#000;
```
