Answer Set Programming

Java
Prolog
Backstory

University coursework. The idea behind this is that a procedural program which sorts out how to distribute lecture slots throughout the week would be far too long, complicated and error prone. A different approach needs to be taken.
You want to be able to express the program in a way which is as close as possible to the actual constraints and preferences of lecturers and students.

Geeky Stuff

ASP stands for Answer Set Programming (subset of the Prolog programming language) and is a type of logic programming which allows generation of answer sets stemming from an initial collection of rules.
The visualisation of the results was done using Java.

How you can run this

How to use the program

To make your own timetable system, you simply need to express your own rules through the ASP language (simple does not mean easy). Realistically, if you want to change the current program, you will also need to change the answer set interpretation by Java. My best advice is that you should go and learn how to write ASP and start from scratch. If you want to keep the program as is, just follow the steps from the previous paragraph.

Thoughts

Logic programming along with functional programming, was by far the most fascinating eye-opener of my whole university course. We were bread to think that programs are sequential, if this, then that, repeat for the length of the list, return this etc... But in many ways, that is a less natural way of coding. The Nirvana of coding would be converting your ideas and requirements into code directly. To some extent, this is exactly what logic programming does.
This project made me realise the huge amount of ambiguity that can arise from seemingly trivial staring rules. In my mind it shifted the focus of the development process from the mere action of writing code to the much more important step of nailing down exactly how to express the requirements.

Acknowledgements
  1. JSON simple - Yidong Fang, Chris Nokleberg, Dave Hughes. https://github.com/fangyidong/json-simple