Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.
| Name | Level | Description |
|---|---|---|
| Room conflict | Hard | Two lessons cannot be scheduled in the same room at the same time. |
| Teacher conflict | Hard | A teacher cannot teach two lessons at the same time. |
| Student group conflict | Hard | A student group cannot attend two lessons at the same time. |
| Teacher room stability | Soft | A teacher should teach all their lessons in the same room. |
| Teacher time efficiency | Soft | A teacher should have consecutive lessons to minimize gaps in their schedule. |
| Student group subject variety | Soft | A student group should not have the same subject in consecutive timeslots. |
-
Install Java and Maven, for example with Sdkman:
$ sdk install java $ sdk install maven
-
Git clone the timefold-quickstarts repo and navigate to this directory:
$ git clone https://github.com/TimefoldAI/timefold-quickstarts.git ... $ cd timefold-quickstarts/java/school-timetabling -
(Optional) If you want to run a licensed edition (Plus / Enterprise), set up your license key first. See the Timefold license tool for instructions.
-
Start the application with Maven or Gradle:
-
Community Edition
$ mvn quarkus:dev
or with Gradle:
$ gradle quarkusDev
-
Plus / Enterprise Edition: The enterprise profile sets up the correct artifacts to run the licensed version. See the
pom.xmlorbuild.gradlefor the implementation details.$ mvn quarkus:dev -Denterprise
or with Gradle:
$ gradle quarkusDev -Denterprise=true
-
-
Visit http://localhost:8080 in your browser.
-
Click on the Solve button.
Then try live coding:
- Make some changes in the source code.
- Refresh your browser (F5).
Notice that those changes are immediately in effect.
When you're done iterating in quarkus:dev mode, package the application to run as a conventional jar file.
-
Build it with Maven:
$ mvn package
or with Gradle:
$ gradle clean build
-
Run the Maven output:
$ java -jar ./target/quarkus-app/quarkus-run.jar
or the Gradle output:
$ java -jar ./build/quarkus-app/quarkus-run.jar
Note To run it on port 8081 instead, add
-Dquarkus.http.port=8081. -
Visit http://localhost:8080 in your browser.
-
Click on the Solve button.
-
Build a container image:
$ mvn package -Dcontainer
-
Run a container:
$ docker run -p 8080:8080 --rm $USER/school-timetabling:1.0-SNAPSHOT
To increase startup performance for serverless deployments, build the application as a native executable:
-
Compile it natively. This takes a few minutes:
$ mvn package -Dnative
-
Run the native executable:
$ ./target/*-runner -
Visit http://localhost:8080 in your browser.
-
Click on the Solve button.
Visit timefold.ai.
