Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdi-jamil authored Sep 28, 2023
1 parent a429049 commit 7f42251
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,52 @@
# FCFS-scheduling-algorithm
simulating FCFS algorithm in java
# FCFS Scheduling Algorithm Simulator

Simulate the First-Come-First-Serve (FCFS) scheduling algorithm for process management in Java.

This small program simulating the FCFS scheduling algorithm .
Simulating means waiting all process to finish as real life .
That means will not give you the output immediately .

The process created in .txt file as following :
Pid AT Bt1 IO1 BT2 IO2 .... and so on
## Table of Contents

The program will give :
Pid At TotalBurstTime ComplitionTime TurnAroundTime WaitingTime
then gives the avarage of waiting time .
- [Overview](#overview)
- [Usage](#usage)
- [Example Output](#example-output)



# Overview
This Java program simulates the First-Come-First-Serve (FCFS) scheduling algorithm for process management. FCFS is a non-preemptive scheduling algorithm where processes are executed in the order they arrive in the queue. This program is designed to simulate the real-life behavior of FCFS, meaning it will not provide immediate output but will wait for all processes to finish execution.


## Usage

1. Clone this repository to your local machine.
2. Navigate to the project directory.
3. Modify any Test.java files that contains in scr/test/java (change the file path)
4. Modify the choosen test.txt file to your own processes
5. Modify pom.xml to your choosen Test.java file (which one to run)
6. Run the program using Maven.(mvn clean test or run pom.xml as clean test) (Optional or use method below)
7. Modify MainTest.java in src/main/java by changing the .txt file
8. Run from MainTest
10. Review the program's output.


### 6. Example Output


```markdown
process 1 arrives
process 3 arrives
process 4 arrives
process 2 arrives
process 5 arrives
terminated with
Pid AT BT CT TT WT
P1 0 4 4675 4675.0 675.0
P2 3 1 10702 7702.0 6702.0
P3 1 2 6676 5676.0 3676.0
P4 2 3 9688 7688.0 4688.0
P5 5 4 14713 9713.0 5713.0
AVG Waiting Time 4290.8
```

The test cases design to success if the avg time is in
correct range because there is no one exact solution in multithreading
DO NOT run more than test case in same time .



Expand Down

0 comments on commit 7f42251

Please sign in to comment.