readEmptyLine();
readConstantLine("UNAVAILABILITY_CONSTRAINTS:");
List<UnavailablePeriodPenalty> penaltyList = new ArrayList<UnavailablePeriodPenalty>(
unavailablePeriodPenaltyListSize);
for (int i = 0; i < unavailablePeriodPenaltyListSize; i++) {
UnavailablePeriodPenalty penalty = new UnavailablePeriodPenalty();
penalty.setId((long) i);
// Unavailability_Constraints: <CourseID> <Day> <Day_Period>
String line = bufferedReader.readLine();
String[] lineTokens = splitBySpacesOrTabs(line, 3);
penalty.setCourse(courseMap.get(lineTokens[0]));
int dayIndex = Integer.parseInt(lineTokens[1]);
int timeslotIndex = Integer.parseInt(lineTokens[2]);
Period period = periodMap.get(Arrays.asList(dayIndex, timeslotIndex));
if (period == null) {
throw new IllegalArgumentException("Read line (" + line + ") uses an unexisting period("
+ dayIndex + " " + timeslotIndex + ").");
}
penalty.setPeriod(period);
penaltyList.add(penalty);
}
schedule.setUnavailablePeriodPenaltyList(penaltyList);
}