Final Exam Scheduler

From UBC Wiki

Authors

Justin Frank, Ricky Ma, Ian Ho

What is the problem?

We will create a simplified version of an exam scheduler for UBC. With building and rooms modeled to allow for different room and class sizes, as well as students that are enrolled in the courses.

What is the something extra?

We added a couple of different constraints that will makes better schedules. This includes maximizing room usage (e.g. scheduling large rooms for large classes), as well as trying to minimize the number of exam hardships among the students.

What did we learn from doing this?

Some problems we had to overcome were:

  • Generating the knowledge base manually: knowledge base becomes very large very quickly, so manually inputting data does not seem viable as a long term solution
  • Debugging with a large (or long) query: traces take a long time as each call/exit/redo/fail is outputted into the terminal
  • Finding and developing a viable data structure to store available rooms/time-slots: went through multiple refactoring periods, changing from one structure to another
  • Optimizing runtime for when many students take more than 6 courses (which is not very likely anyway)

Some things that we found Prolog did very well:

  • Prolog works with lists very well (simple syntax)
  • The syntax is very readable
  • It is easy to increase the level of constraints by just adding very few lines of code
  • It is easy to check for input validity (E.x. if a room that is inputted doesn't exist, it will just fail)

Overall, we think Prolog is quite suitable for scheduling final exams. Our current issues like generating the knowledge base manually can be easily circumvented with a premade dataset (which probably already exists in UBC's system). By doing our project, we found that Prolog and logic programming in general seems like it should be more widely used for these sort of logic puzzle tasks.

Links to code

https://github.com/ricky-ma/exam-scheduler