public synchronized void rescheduleIdle(Process p) {
    int goodP = Simulator.goodness(p);
    int good0 = Simulator.goodness(simulator.getCpu0().getActualProcess());
    int good1 = Simulator.goodness(simulator.getCpu1().getActualProcess());
    
    //Check if the last cpu the process used is idle
    if(p.getLastCpu() != -1) {
      if((p.getLastCpu() == 0) && (this.simulator.getCpu0().getActualProcess() == null)) {
        simulator.getCpu0().setActualProcess(p);
        return;
      } else if((p.getLastCpu() == 1) && (this.simulator.getCpu1().getActualProcess() == null)) {
        simulator.getCpu1().setActualProcess(p);
        return;
      }
    }
    //Otherwise check if the process can preempt any cpu
    if(((goodP - good0) > (goodP - good1))) {
      if((goodP - good0) > 0){
        simulator.getCpu0().setActualProcess(p);
        return;
      }
    }else{
      if((goodP - good1 > 0)) {
        simulator.getCpu1().setActualProcess(p);
        return;
      }
    }
    
    // The process can't preempt any CPU, so it has to go to the run queue.
    simulator.addProcess(p);
  }