Skip to content

AI-based CPU Task Scheduler – Simulation of CPU scheduling algorithms with an AI-driven approach to optimize task execution.

Notifications You must be signed in to change notification settings

Github-Saurabh0/Cpu-task-scheduler-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CPU Task Scheduler (JavaFX)

A desktop CPU scheduling simulator built with Java 21+ and JavaFX, featuring:

  • Scheduling algorithms: FCFS, SJF, SRTF, Priority (Preemptive / Non-Preemptive), and Round Robin.
  • A modern JavaFX UI with CSS styling.
  • Gantt-like timeline visualization.
  • Metrics: waiting time, turnaround time, response time, CPU utilization, throughput.
  • An optional AI Assist that heuristically suggests an algorithm based on burst variance.

Model

Model Main Screen

Prerequisites

  • JDK 21+ installed (java -version to verify).
  • Maven 3.9+ installed (mvn -v to verify).

Development Run

mvn clean javafx:run

Run with AI Assist

mvn exec:java -Dexec.mainClass="com.wearl.scheduler.ui.App" -Dexec.args="--ai-assist"

Run without AI Assist

mvn exec:java -Dexec.mainClass="com.wearl.scheduler.ui.App"

Packaging

Build a runnable JAR:

mvn -DskipTests package

The artifact will be at:

target/cpu-task-scheduler-1.0.0.jar

Run it with:

java -jar target/cpu-task-scheduler-1.0.0.jar

Features

  • Algorithms

    • First Come First Serve (FCFS)
    • Shortest Job First (SJF)
    • Shortest Remaining Time First (SRTF)
    • Priority Scheduling (Preemptive and Non-Preemptive)
    • Round Robin (with configurable quantum)
  • User Interface

    • Built with JavaFX + CSS for a clean, modern look.
    • Timeline visualization for executed slices (Gantt-like chart).
    • Metrics dialog with averages and per-process statistics.
    • AI Assist: suggests an algorithm given workload characteristics.

Usage

  1. Enter processes: ID, Arrival, Burst, and (optionally) Priority.
  2. Choose a scheduling algorithm.
    • For Round Robin, set the quantum value.
  3. (Optional) Enable AI Assist to let the tool suggest an algorithm.
  4. Click Run to visualize the execution timeline and view calculated metrics.

Notes

  • JavaFX provides a contemporary scene graph and CSS theming, making it suitable for modern desktop apps in 2025.
  • For distribution, consider:
    • jlink – custom runtime image.
    • jpackage – native installer packaging.

References


License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Saurabh

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Issues

If you encounter any issues or have feature requests, please open an issue on the GitHub repository.


Star this repository if you find it helpful!

About

AI-based CPU Task Scheduler – Simulation of CPU scheduling algorithms with an AI-driven approach to optimize task execution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published