I need to create an automatic generator of Timetables.
My idea is to generate "n" timetables and then give it scores according to my conditions. The timetable with high score, wins.
I have these variables:
- Disciplines
- Professors
- List item
- Class room
Each discipline has a code and the number of hours it needs per week. Lets call the number of hours "block".
So I have an array of blocks.
array = [5,4,3,2,1];
This array means the number of disciplines we have (in this case 5) and the number of hours they need per week. The first discipline needs 5 hours, the second 4 hours, third 3 hours, fourth 2 hours and fifth 1 hour.
My timetable is a 5x5 bidimensional array (Monday to Friday) and I need to allocate the array of disciplines into the 5x5 array. So I need all the solutions it can generate.
Example:
array = [5,4,3,2,1];
I can put the first discipline (5 hours) in Monday, second (4 hours) in Tuesday, third and fourth in Wednesday (3 hours and 2 hours) and the last discipline (1 hour) in Tuesday. Something like this:
discipline = {A,B,C,D,E};
array = {5,4,3,2,1};
ABC
ABC
ABC
ABD
AED
This is just 1 possible solution but I need all the combinations and save that combinations inside an array.
I've made a function to translate the 5x5 timetable array into a code I understand and vice-versa. So each time a solution is generated, I save that code into an array.
Basically I want an array filled with 5x5 timetable array codes but I'm stuck in this part.
Sorry about my English.