Course:CPSC312-2023/UniPlan

From UBC Wiki

Authors: Konstantin Mestnikov, Yegor Yeryomenko

What is the problem?

Time management can be challenging after transferring from school to independent life at a higher institution. UniPlan aims to help novice students create a healthier schedule that meets the demands of academic work, extracurricular, and other social commitments. We will create a scheduling system for students that would allow them to input their lifestyle preferences, their course schedule, and their desired homework plan, and that outputs a weekly schedule that corresponds to their preferences and needs.

The following things will be taken into account in the scheduler:

  • Sleep: How much sleep do you require each day? Are you a morning person? Do you take naps?
  • Free time: Self-care and relaxation are extremely important in reducing stress. How much free time would you like to have. Do you prefer scattered leisure time or a few longer breaks?
    • Fitness: How much time do you spend per week? How many hours of rest do you need before doing another workout?
    • Social/Relationships: Do you have any special dates in mind for when you want to party, or maybe you have a friend with whom you play board games on Sunday evenings?
  • Homework: Some might spend more time here than in sleep! Do you like studying in long sessions or taking breaks regularly? Which courses are you taking and how much time do you want to spend on each one?

What is the something extra?

We can add some basic natural language capabilities for queries.

We can also add functionality for students to see consequences of changes to their schedule. For example, what if I skip studying and go to a party? The schedule will be able to tell how modified weekly plan would need to look, and it if would be possible at all.

What did we learn from doing this?

The automated search was a key feature we pushed the core of our project off of. It searches through all of the current facts in the knowledge base about the scheduled time slots to identify potential conflicts that may arise as the result of adding a new activity.

Another useful feature of prolog, at least for our project, was that it was highly resilient to user input errors, minimizing the risks of crashing the environment completely. This is particularly helpful for our project as it ensures that all of the program state (i.e., the true facts) are saved. To illustrate, when we had scheduled half of our activities, but overlooked the handling of invalid input, the erroneous input would cause the function to exit, however, after reboot/restart of the function, the successful operations that happened prior to the crash were saved.

Like Haskell, working on this project in Prolog has reinforced the importance of starting small and developing useful/generic functions that could be used many times, while planning top-down. This approach allowed us to spot any obvious bugs early, and leverage the rule-based nature of Prolog by thinking ahead of how a valid schedule could be generated, enhancing the simplicity and cohesion of the code.

Notably, we did not use any external modules, highlighting a tiny fraction of Prolog's hidden powers.

Links to code etc.

https://github.com/ritec03/UniPlan