Keyur Bhanderi
Keyur Bhanderi

Reputation: 1544

How to set OptaPlanner Constraints for school timetabling in my below case?

I am a beginner of OptaPlanner I have to execute the example but our requirement is different as below.

In our case assigning lesson as a different time slot, for example in std-10 have a total of 4 hours and its time slot is 1 hour per lecture and subjects are fixed, and same 4 hours in std-7 have 5 lecture and also its subjects are fixed and its time slot is 45 minutes so how I can manage it using constraint? Is there any example to refer it to get some idea? Please help!

Thanks in advance!

Upvotes: 0

Views: 208

Answers (1)

Geoffrey De Smet
Geoffrey De Smet

Reputation: 27312

There's basically two approaches:

  1. Like the conference scheduling example in optaplanner-examples (zip download): create 2 LessonTypes and create separate timeslots for each LessonType. Then add a hard constraint - or even a @ValueRangeProvider on entity like that example does - to never put a Lesson of LessonType "Lab (2 hours)" in a timeslot of LessonType "conf talk (1 hour)". It does a similar approach for rooms. This works well if your room+timeslot combinations are assigned to a LessonType (not a lesson) in advance (before solving), otherwise it doesn't. For conference scheduling, that is always the case.

  2. Like the maintenance scheduling quickstart (optaplanner-quickstarts on github) use a timegrain pattern (explained in docs) for maximum flexibility, but at a higher complexity cost.

Upvotes: 1

Related Questions