NDresevic / timetable-generator

Timetable generator for university schedule implemented in Python using genetic algorithms.
178 stars 59 forks source link

How can I alter classrooms structure? #2

Open blockchain-expert opened 3 years ago

blockchain-expert commented 3 years ago

Hi, I would like to implement this algorithm for school-level timetable generator. I couldn't alter the classrooms from input data. When I alter the input data and execute, then it got "Index out of bound" error. It would be nice if you could explain what should I do. Also, what are those keys meant in the classroom section in input data like "a", "k", "n", "r", "s"? Any help would be appreciated.

NDresevic commented 3 years ago

Hi,

For altering the classroom's input data (or any other input) you would need to modify the load_data method (https://github.com/NDresevic/timetable-generator/blob/master/utils.py#L8). From line number 59 is where the parsing for classrooms starts, so you should change that part to fit your model. For my model each classroom is identified by name and type, so you might also need to change that model (https://github.com/NDresevic/timetable-generator/blob/master/model.py#L19), not sure how your data looks like. Here is also where those keys appear the first time ("a", "k", "n", "r", "s"). This is adapted to finding a schedule for my university and each key represents a type of classroom. For example, some classrooms have computers, some are auditoriums, etc. Each classroom has its own type and each class can be held in only one type of classroom (it can be in any of the classrooms but from the defined type).

How does your input data for classrooms look like? I could change a bit the loading to make it more robust or something like that, although for reading the input requirements there will always need to be some hardcoding to fit different input models.

Let me know if you have more questions.