Process scheduledProcess; private void assignNextProcess(){ if (queue1.size() != 0){ scheduledProcess.add(Scheduler.SRTF.getNext(queue1)); if (scheduledProcess.getBurstTime(0) == scheduledProcess.getTimeRemaining(0)){ scheduledProcess.getResponseTime(0).add(time.remove(scheduledProcess.getArrivalTime(0))); } queue1.remove(scheduledProcess); String msg = "Assigned Process " + scheduledProcess.getProcessNumber(0) + " to CPU"; } else if (queue2.size() != 0){ scheduledProcess = Scheduler.NPP.getNext(queue2); if (scheduledProcess.getBurstTime(0)==(scheduledProcess.getTimeRemaining(0))){ scheduledProcess.getResponseTime(0).add(time.remove(scheduledProcess.getArrivalTime(0))); } queue2.remove(scheduledProcess); String msg = "Assigned Process " + scheduledProcess.getProcessNumber(0) + " to CPU"; } else if (queue3.size() != 0){ scheduledProcess.add(Scheduler.FCFS.getNext(queue3)); if (scheduledProcess.getBurstTime(0)==(scheduledProcess.getTimeRemaining(0))){ scheduledProcess.getResponseTime(0).add(time.remove(scheduledProcess.getArrivalTime(0))); } queue3.remove(scheduledProcess); String msg = "Assigned P" + scheduledProcess.getProcessNumber(0) + " to CPU"; } } public class Process(){ public int getBurstTime(int BurstTime) { return BurstTime; } public int getArrivalTime(int ArrivalTime) { return ArrivalTime; } public int getProcessNumber(int ProcessNumber) { return ProcessNumber; } public int getTimeRemaining(int TimeRemaining){ return TimeRemaining; } }
when i run this file, there's an error in the lines, and the other lines in the if statements, like this if statement, it has an error.
if (scheduledProcess.getBurstTime(0) == scheduledProcess.getTimeRemaining(0)){
scheduledProcess.getResponseTime(0).add(time.remov e(scheduledProcess.getArrivalTime(0)));
}
the error is "int cannot be dereferrenced" and its pointing out to the code in this if statement. what should I change in this code?