package jobshop; import java.util.Arrays; public class Schedule { public final Instance pb; // start times of each job and task // times[j][i] is the start time of task (j,i) : i^th task of the j^th job final int[][] times; public Schedule(Instance pb, int[][] times) { this.pb = pb; this.times = new int[pb.numJobs][]; for(int j = 0 ; j < pb.numJobs ; j++) { this.times[j] = Arrays.copyOf(times[j], pb.numTasks); } } public int startTime(int job, int task) { return times[job][task]; } /** Returns true if this schedule is valid (no constraint is violated) */ public boolean isValid() { for(int j = 0 ; j startTime(j, t)) return false; } for(int t = 0 ; t