This is the all new addition to the classsync where we are introducing the automation in timetable generation using genetic algorithm.
(currently in the intitial-coding-ish phase of development)
Step | Description |
---|---|
Data Collection | Gather all necessary data including teacher availability, room availability, and subject requirements. |
Initial Population Generation | Create an initial set of possible timetables (population). |
Fitness Evaluation | Evaluate each timetable based on predefined criteria such as teacher conflicts, room conflicts, and adherence to subject requirements. |
Selection | Select the best-performing timetables to serve as parents for the next generation. |
Crossover and Mutation | Generate new timetables by combining parts of the selected parents and introducing small random changes (mutations). |
Iteration | Repeat the evaluation, selection, and crossover/mutation steps for several generations until an optimal timetable is found. |
Final Timetable | Select the best timetable from the final generation as the solution. |
This process ensures that the generated timetable is optimized for the given constraints and requirements.
data.JSON (example)
{
"fitness": 0,
"data":[
{
"local_fitness": 0,
"timetable": [
[{ "classid": "", "teacherid": "" }, ........ for 10 periods ],
[{ "classid": "", "teacherid": "" }, ........ for 10 periods ],
"
"
"
.... for 7 days a week
],
"subjects": [
{
"subjectid": "TEST1",
"teacherid": "2118526",
"weekly_hrs": 3,
"type": "theory"
},
{
"subjectid": "PTEST1",
"teacherid": "21185299",
"weekly_hrs": 2,
"type": "practical"
},
... as many subject as we want to plot
]
},
{
"local_fitness": 0,
"timetable": [
[{ "classid": "", "teacherid": "" }, ........ for 10 periods ],
"
"
.... for 7 days a week
],
"subjects": [
{
"subjectid": "TEST1",
"teacherid": "2118526",
"weekly_hrs": 3,
"type": "theory"
},
... as many subject as we want to plot
]
},
.... as many sections as we need with predecided teacher and subjects
]
}
This is an abstract representation of our data strucutre as timetable set
File Name | Description |
---|---|
test.js |
Function to build a generation |
plot_timetables.js |
Function that plot the timetable according to the predefined resource data set |
validate_timetable.js |
Function that validate the timetable set from teacher and room clash |
fitness_func.js |
Fitness Function |
selection.js |
Function that do the selection of the Fit timetable for next generation as parents |
data.json |
Represent a set of timetables (1 person in population) |
data2.json |
Represent a plotted set of timetables (for testing) |
population.json |
Represent population of many set of timetable |
room.json |
Room data in which slots can be plotted |
population_selected.json |
Selected timetable from this generation |
index.html |
For visualization of plotted set of timetable |
index.js index2.js index3.js |
JS for index.html |
README.md |
Readme.md |
(these are not used right now)
Type | Condition | Points |
---|---|---|
Teacher Conflict | Per conflict | -20 |
Room Conflict | Per conflict | -20 |
Teacher Overload | Per extra hour | -10 |
Student Overload | For exceeding max classes in a day | -5 |
Perfect Day Reward | 4-5 classes in a day | +6 |
Active Day Count | 4-5 active days | +20 |
Low Active Days | Less than 3 active days | -10 |
Algorithm Terminology | Common Terminology | Description | Example |
---|---|---|---|
Generation | Population | Represent a Set of probable group of Timtable (or genome) | 20 set of 20 section's Timetable (20 Genomes) |
Genome or Chromosome | Timetable Set or Person (or unit) of a generation |
It is the Set of probable Timtables (or Gene) | 20 section's Timetable (20 Genes) |
Gene | Timtable | It is the single Timetable | Timetable of section A |