}
public static class CurriculumCourseInputBuilder extends TxtInputBuilder {
public Solution readSolution() throws IOException {
CourseSchedule schedule = new CourseSchedule();
schedule.setId(0L);
// Name: ToyExample
schedule.setName(readStringValue("Name:"));
// Courses: 4
int courseListSize = readIntegerValue("Courses:");
// Rooms: 2
int roomListSize = readIntegerValue("Rooms:");
// Days: 5
int dayListSize = readIntegerValue("Days:");
// Periods_per_day: 4
int timeslotListSize = readIntegerValue("Periods_per_day:");
// Curricula: 2
int curriculumListSize = readIntegerValue("Curricula:");
// Constraints: 8
int unavailablePeriodPenaltyListSize = readIntegerValue("Constraints:");
Map<String, Course> courseMap = readCourseListAndTeacherList(
schedule, courseListSize);
readRoomList(
schedule, roomListSize);
Map<List<Integer>, Period> periodMap = createPeriodListAndDayListAndTimeslotList(
schedule, dayListSize, timeslotListSize);
readCurriculumList(
schedule, courseMap, curriculumListSize);
readUnavailablePeriodPenaltyList(
schedule, courseMap, periodMap, unavailablePeriodPenaltyListSize);
readEmptyLine();
readConstantLine("END\\.");
createLectureList(schedule);
int possibleForOneLectureSize = schedule.getPeriodList().size() * schedule.getRoomList().size();
BigInteger possibleSolutionSize = BigInteger.valueOf(possibleForOneLectureSize).pow(
schedule.getLectureList().size());
logger.info("CourseSchedule {} has {} teachers, {} curricula, {} courses, {} lectures," +
" {} periods, {} rooms and {} unavailable period constraints with a search space of {}.",
getInputId(),
schedule.getTeacherList().size(),
schedule.getCurriculumList().size(),
schedule.getCourseList().size(),
schedule.getLectureList().size(),
schedule.getPeriodList().size(),
schedule.getRoomList().size(),
schedule.getUnavailablePeriodPenaltyList().size(),
getFlooredPossibleSolutionSize(possibleSolutionSize));
return schedule;
}