-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDriver.java
27 lines (23 loc) · 1.37 KB
/
Driver.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class Driver {
public static void main(String[] args) {
String path1 = "Jobs.txt";
String path2 = "Dependencies.txt";
JobScheduler cizelge = new JobScheduler(path1);
cizelge.setResourcesCount(2); //same as one in hw1
cizelge.insertDependencies(path2);
// System.out.println(cizelge.dependencyMap);
while(cizelge.stillContinues()){ // stillContinues metodu ile job dosyasında bir şey bulunup bulunmadığına bakılır
cizelge.insertJob(); //insertJob reads a new line from the inputfile, adds a job if necessary
System.out.println("min-heap\n" + cizelge); // a proper toString method for JobSchedular class
cizelge.run(); //different from one in hw1
//printing as a list and printing as a tree
cizelge.completedJobs(); // prints completed jobs and their completion time
cizelge.dependencyBlockedJobs(); // prints jobs whose time is up but waits due to its dependency, also prints its dependency
cizelge.resourceBlockedJobs(); // prints jobs whose time is up but waits due to busy resources
cizelge.workingJobs(); // prints jobs working on this cycle and its resource
System.out.println("-------------"+cizelge.timer+"-------------");
}
cizelge.runAllRemaining();
cizelge.allTimeLine();
}
}