-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcess.java
More file actions
23 lines (22 loc) · 869 Bytes
/
Process.java
File metadata and controls
23 lines (22 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Process {
int id; // Process ID
int arrivalTime; // Time when the process arrives
int burstTime; // CPU burst time required
int SRTremainingTime; // Remaining burst time (for SRT)
int RRremainingTime; // Remaining burst time (for RR)
int priority; // Priority of the process
int waitingTime; // Time spent waiting
int turnaroundTime; // Total time from arrival to completion
int finishTime; // Time when the process finishes execution
public Process(int id, int arrivalTime, int burstTime, int priority) {
this.id = id;
this.arrivalTime = arrivalTime;
this.burstTime = burstTime;
this.SRTremainingTime = burstTime;
this.RRremainingTime = burstTime;
this.priority = priority;
this.waitingTime = 0;
this.turnaroundTime = 0;
this.finishTime = 0;
}
}