def load_students_and_teachers_and_courses(self): """ Return a tuple containing a list of Teacher and Student objects. This loads the courses and adds them to the objects request/qualification lists. """ # load the raw data # TODO: load from a file of some sort num_courses = 5 student_requests = [ [0, 1, 3], [0, 2, 3], [0, 2, 4], [1, 3, 4], [0, 1, 2], [1, 2, 3] ] teacher_qualifs = [ [0, 1, 3], [0, 2, 4], [1, 2, 3] ] rawCourses = [(str(i), CourseType.CORE) for i in range(num_courses)] # example course already in list rawStudentRequests = {i: reqs for i, reqs in enumerate(student_requests)} # map student name to requests (strings) rawStudentGrades = {i: 12 for i in range(len(student_requests))} # map student name to the grade they're in rawTeacherQualifications = {i: qualifs for i, qualifs in enumerate(teacher_qualifs)} # map teacher name to qualifications (strings) rawTeacherRequestedOpenPeriods = {i: 0 for i in range(len(teacher_qualifs))} # map teacher name to requested open periods # create tag generator tg = tag_generator() # create Courses, Students, and Teachers courses = {} # maps course name to object for c in rawCourses: courses[c[0]] = Course(*c) allCourses = list(courses.values()) students = [] for index, requestList in rawStudentRequests.items(): student = Student(next(tg), allCourses) # set student grade to rawStudentGrades[index] students.append(student) student.requestAll([courses[str(c)] for c in requestList]) teachers = [] for index, qualifications in rawTeacherQualifications.items(): qualifications_with_course_objects = [courses[str(q)] for q in qualifications] teacher = Teacher(next(tg), allCourses) teacher.addQualifications(qualifications_with_course_objects) # TODO: add open period requests from rawTeacherRequestedOpenPeriods[index] teachers.append(teacher) return students, teachers, list(courses.values())