Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void sjf(){
- ArrayList<List<Integer>> jobQueue = new ArrayList<>(); //Queue
- sjfQueue = multiDimArray; // ArrayList<List<Integer>> that is being used to store processes
- int maxArrivaltime,time;
- time = 0; //Used to simulate time
- maxArrivaltime =2000; // Calculate Max Time
- while(time<maxArrivaltime){
- for (List<Integer> row: sjfQueue){
- if (time == row.get(1)){
- jobQueue.add(row);
- System.out.println(row);
- }
- }
- time++;
- }
- //System.out.println(JobQueue.size());
- }
Advertisement
Add Comment
Please, Sign In to add comment