Navigation
CONCEPTS
Timetable engine
How the scheduling algorithm works
Overview
The timetable engine manages class scheduling with real-time conflict detection and constraint validation.
Scheduling model
TimeSlot
├── day: "monday"
├── period: "period_1"
├── start_time: "08:00"
├── end_time: "08:45"
└── assignments:
├── class_id: "cls_7a"
├── subject_id: "subj_math"
├── teacher_id: "usr_t001"
└── room: "rm_101"
Conflict detection
The system checks for three types of conflicts: teacher conflict (same teacher at same time), class conflict (same class at same time), and room conflict (same room at same time). Conflicts are detected in real time and prevent saving invalid schedules.
Scheduling constraints
- Each teacher can teach a maximum number of periods per day
- Each class must have at least one period of each core subject per week
- Break periods cannot have class assignments
- Maximum consecutive periods for a single teacher