{"id":28717417,"url":"https://github.com/intns/inevitable","last_synced_at":"2025-08-02T06:08:44.735Z","repository":{"id":295484956,"uuid":"974182410","full_name":"intns/inevitable","owner":"intns","description":"A CPU scheduling simulator","archived":false,"fork":false,"pushed_at":"2025-05-25T19:58:25.000Z","size":58,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-25T20:40:06.272Z","etag":null,"topics":["cpp20","cpu-scheduling","simulator"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-28T11:34:44.000Z","updated_at":"2025-05-25T19:58:28.000Z","dependencies_parsed_at":"2025-05-25T20:50:32.917Z","dependency_job_id":null,"html_url":"https://github.com/intns/inevitable","commit_stats":null,"previous_names":["intns/inevitable"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/intns/inevitable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intns%2Finevitable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intns%2Finevitable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intns%2Finevitable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intns%2Finevitable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intns","download_url":"https://codeload.github.com/intns/inevitable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intns%2Finevitable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259914924,"owners_count":22931334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp20","cpu-scheduling","simulator"],"created_at":"2025-06-15T03:15:39.109Z","updated_at":"2025-06-15T03:15:40.058Z","avatar_url":"https://github.com/intns.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inevitable\n\n`inevitable` is a C++ command-line tool for simulating a basic CPU, complete with mock processes, scheduling algorithms, and interrupts. I developed this project while studying operating systems to pass an exam.\n\n## Table of Contents\n\n- [Features](#features)\n- [Building and Running](#building-and-running)\n- [Configuration Options](#configuration-options)\n- [System Design](#system-design)\n- [Future Enhancements / To-Do](#future-enhancements--to-do)\n- [Appendix](#appendix)\n\n## Features\n\n- Implements various scheduling algorithms:\n  - First-Come, First-Served (FCFS)\n  - Shortest Job First (SJF)\n  - Shortest Remaining Time First (SRTF)\n  - Round Robin (RR)\n  - Priority Scheduling\n- CPU / I/O burst simulation\n- Basic CPU execution model\n- Interrupt-driven I/O\n- Process state transitions\n- Preemptive and non-preemptive modes\n- Priority aging\n- Exponential burst prediction\n- Configurable parameters\n- Color-coded console logs\n\n## Building and Running\n\nBinaries are automatically compiled using Github Actions, and are available in the Releases tab. You can also, alternatively, compile it manually. This project uses CMake to manage the build process.\n\n1. **Prerequisites**:\n    - C++20 (or later) compiler (GCC, Clang, MSVC).\n    - CMake (3.10+ recommended).\n\n2. **Compilation (using CMake)**:\n    Navigate to the project root directory (where the main `CMakeLists.txt` is located).\n\n    ```bash\n    # Create a build directory\n    mkdir build\n    cd build\n\n    # Configure the project and generate build files\n    # (e.g., Makefiles on Linux/macOS, Visual Studio solution on Windows)\n    cmake .. \n\n    # Compile the project\n    # This will produce 'inevitable' or 'inevitable.exe' in the build directory \n    cmake --build .\n    ```\n\n3. **Running**:\n    - After a successful build, the executable will typically be found in the `build` directory.\n    - The program will then prompt you to choose a scheduling algorithm and configure simulation parameters.\n\n## Configuration Options\n\nWhen the simulator starts, configure:\n\n- Scheduling Algorithm: Select from implemented algorithms.\n- Process Creation Cost: Time (ticks/ms) for new process creation.\n- Context Switch Cost (Dispatch Latency): Time (ticks/ms) for context switch.\n- Minimum Process Burst Count: Min CPU/I/O bursts per process.\n- Maximum Process Burst Count: Max CPU/I/O bursts per process.\n- Number of Processes: Total processes to simulate.\n- Round Robin Time Quantum (if RR selected): RR time slice duration (ticks/ms).\n- Initial Burst Prediction (used by SJF/SRTF): Initial assumed CPU burst length.\n\n## System Design\n\n- `CPU`: Simulates the CPU, fetching and executing scheduled processes, handling context switches and state transitions.\n- `Process` / `ProcessControlBlock (PCB)`: `Process` defines task work (CPU/I/O bursts). `PCB` stores process metadata (state, ID, priority, etc.).\n- `IScheduler` (Interface): Base class for scheduling algorithms.\n  - Concrete Schedulers: `FCFSScheduler`, `SJFScheduler`, `SRTFScheduler`, `RRScheduler`, `PriorityScheduler` implement specific logic.\n- `InterruptController`: Manages I/O-blocked processes, simulating completion and returning them to the ready queue.\n- `ProcessWork`: Defines a CPU or I/O work burst with a specific duration.\n- Configuration (`cfg` namespace \u0026 `main.cpp`): User-configurable global settings (creation cost, dispatch latency, etc.).\n\n## Future Enhancements / To-Do\n\n- Output simulation results (metrics) to CSV for analysis / potential website visualisation.\n- Add multi-level (feedback) queue scheduling.\n\n## Appendix\n\nThe following is a screenshot of the program during runtime:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/preview.png\"\u003e\n\u003c/p\u003e\n\n---\n\nBy intns, 2025.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintns%2Finevitable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintns%2Finevitable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintns%2Finevitable/lists"}