-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPC.java
More file actions
21 lines (18 loc) · 780 Bytes
/
PC.java
File metadata and controls
21 lines (18 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class PC {
public static void main(String[] args) {
/* TODO: You may change this method to perform any tests you like */
final Process[] processes = {
// Process parameters are: arrivalTime, burstTime, memoryRequirements (kB)
new Process(0, 5, 10),
new Process(2, 2, 40),
new Process(3, 1, 25),
new Process(4, 3, 30)
};
final int[] availableBlockSizes = {15, 40, 10, 20}; // sizes in kB
MemoryAllocationAlgorithm algorithm = new BestFit(availableBlockSizes);
MMU mmu = new MMU(availableBlockSizes, algorithm);
Scheduler scheduler = new RoundRobin();
CPU cpu = new CPU(scheduler, mmu, processes);
cpu.run();
}
}