Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.
-
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
-
Start the application with Maven:
$ mvn quarkus:dev
or with Gradle:
$ gradle quarkusDev
-
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.
For high-scalability use cases, switch to Timefold Solver Enterprise Edition, our commercial offering. Contact Timefold to obtain the credentials required to access our private Enterprise Maven repository.
-
Configure the Enterprise Edition Maven repository:
- Maven
-
Create
.m2/settings.xml
in your home directory with the following content:<settings> ... <servers> <server> <!-- Replace "my_username" and "my_password" with credentials obtained from a Timefold representative. --> <id>timefold-solver-enterprise</id> <username>my_username</username> <password>my_password</password> </server> </servers> ... </settings>
See Settings Reference for more information on Maven settings.
- Gradle
-
Add the following in your
build.gradle
:repositories { mavenCentral() maven { url "https://timefold.jfrog.io/artifactory/releases/" credentials { // Replace "my_username" and "my_password" with credentials obtained from a Timefold representative. username "my_username" password "my_password" } authentication { basic(BasicAuthentication) } } }
See Settings Reference for more information on Gradle settings.
-
Start the application with Maven:
$ mvn clean quarkus:dev -Denterprise
-
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
NoteTo 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
The container image name
-
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.