Simsttab: A timetabling engine for schools
Simsttab stands for Simplistic School Time-Tabler. It is a
timetabling engine that can generate timetables satisfying
requirements typical for secondary schools in Austria
("Gymnasium"-type), Germany and maybe other European countries.
Source code: simsttab.pl
Video: |
|
The code is also available from a public git repository:
https://github.com/triska/simsttab/
Simsttab requires a Prolog system that supports CLP(ℤ) and library(reif).
Simsttab uses constraint logic programming
over integers to compute solutions.
Try the demo: https://www.metalevel.at/prolog/timetabling/
More about Prolog: The Power of Prolog
Quick Start
Prolog facts are
used to specify the requirements of the timetable.
An example based on sample requirements that ship with Tablix is
available as reqs.pl.
Sample invocation,
using Scryer Prolog:
$ scryer-prolog simsttab.pl reqs.pl
Sample query:
?- requirements_variables(Rs, Vs),
labeling([ff], Vs),
print_classes(Rs).
Depending on your Prolog system, you obtain a timetable
like timetable.txt within a
few seconds or minutes.
Specifying requirements
The input is a sequence of
Prolog facts that describe
what we want from a solution.
The dimensions of the timetable are specified by:
- slots_per_week(W)
Each week has W time slots.
- slots_per_day(D)
Each day has D time slots.
The main requirements are specified by:
- class_subject_teacher_times(C, S, P, T)
Class C must have subject S, taught
by person P, exactly T times
per week.
Additional requirements are specified by:
- class_freeslot(C, F)
No lesson must be scheduled at time F for
class C.
- coupling(C, S, L1, L2)
For class C, lessons L1
and L2 of subject S are to be
scheduled in direct succession.
- teacher_freeday(T, D)
For
teacher T, day D must be
kept free.
- room_alloc(R, C, S, L)
Room R
is to be used for class C and
lesson L of subject S
Main page