Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ It shows different use cases and basic implementations to get you started on you
| 🛏️ <a href="#-bed-allocation-scheduling">Bed Allocation Scheduling</a> | Service Model, Allows Unassigned, Pinning |
| 🛫 <a href="#-flight-crew-scheduling">Flight Crew Scheduling</a> | |
| 👥 <a href="#-meeting-scheduling">Meeting Scheduling</a> | Service Model, TimeGrain, Justifications |
| ✅ <a href="#-task-assigning">Task Assigning</a> | Bendable Score, Chained Through Time, Allows Unassigned |
| ✅ <a href="#-task-assigning">Task Assigning</a> | Service Model, Bendable Score, Chained Through Time, Allows Unassigned |
| 📆 <a href="#-project-job-scheduling">Project Job Scheduling</a> | Shadow Variables, Variable Listener, Strenght Comparator |
| 🏆 <a href="#-sports-league-scheduling">Sports League Scheduling</a> | Service Model, Consecutive Sequences, Justifications |
| 🏅 <a href="#-tournament-scheduling">Tournament Scheduling</a> | Pinning, Load Balancing |
Expand Down
49 changes: 27 additions & 22 deletions use-cases/task-assigning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@

Assign employees to tasks to produce a better plan for task assignments.

Each employee is assigned an ordered list of tasks: the sequence in which they work through them
determines when each task starts, since a task can only start once the employee's previous task has
finished (or, for the first task, once its own earliest start time has passed). An employee's
affinity with a task's customer speeds up or slows down how long that task takes them.

![Task Assigning Screenshot](./task-assigning-screenshot.png)

## Constraints

| Name | Level | Description |
|---------------------------------|-------|------------------------------------------------------------------------|
| No missing skills | Hard | An employee must have all the required skills for their assigned task. |
| Minimize unassigned tasks | Soft | All tasks should be assigned to an employee. |
| Minimize makespan | Soft | Minimize the time until all tasks are completed. |
| Critical priority task end time | Soft | Critical priority tasks should be completed as early as possible. |
| Major priority task end time | Soft | Major priority tasks should be completed as early as possible. |
| Minor priority task end time | Soft | Minor priority tasks should be completed as early as possible. |
| Name | Level | Description |
|-----------------------------------|-------|--------------------------------------------------------------------------|
| No missing skills | Hard | An employee must have all the required skills for their assigned task. |
| Minimize unassigned tasks | Soft | All tasks should be assigned to an employee. |
| Minimize makespan | Soft | Minimize the time until all tasks are completed. |
| Critical priority task end time | Soft | Critical priority tasks should be completed as early as possible. |
| Major priority task end time | Soft | Major priority tasks should be completed as early as possible. |
| Minor priority task end time | Soft | Minor priority tasks should be completed as early as possible. |

- [Run the application](#run-the-application)
- [Run the packaged application](#run-the-packaged-application)
Expand All @@ -25,34 +30,34 @@ Assign employees to tasks to produce a better plan for task assignments.
1. Install Java and Maven, for example with [Sdkman](https://sdkman.io):

```sh
$ sdk install java
$ sdk install maven
sdk install java
sdk install maven
```

## Run the application

1. Git clone the timefold-quickstarts repo and navigate to this directory:

```sh
$ git clone https://github.com/TimefoldAI/timefold-quickstarts.git
git clone https://github.com/TimefoldAI/timefold-quickstarts.git
...
$ cd timefold-quickstarts/use-cases/task-assigning
cd timefold-quickstarts/use-cases/task-assigning
```

2. (Optional) If you want to run a licensed edition (Plus / Enterprise), set up your license key first. See the [Timefold license tool](https://licenses.timefold.ai/) for instructions.

3. Start the application with Maven:

1. Community Edition

```sh
$ mvn quarkus:dev
mvn quarkus:dev
```

2. Plus / Enterprise Edition: The profile sets up the correct Maven artifacts to run the licensed version. See the `pom.xml` for the implementation details.

```sh
$ mvn quarkus:dev -Denterprise
mvn quarkus:dev -Denterprise
```

4. Visit [http://localhost:8080](http://localhost:8080) in your browser.
Expand All @@ -73,13 +78,13 @@ When you're done iterating in `quarkus:dev` mode, package the application to run
1. Build it with Maven:

```sh
$ mvn package
mvn package
```

2. Run the Maven output:

```sh
$ java -jar ./target/quarkus-app/quarkus-run.jar
java -jar ./target/quarkus-app/quarkus-run.jar
```

> **Note**
Expand All @@ -94,13 +99,13 @@ When you're done iterating in `quarkus:dev` mode, package the application to run
1. Build a container image:

```sh
$ mvn package -Dcontainer
mvn package -Dcontainer
```

2. Run a container:

```sh
$ docker run -p 8080:8080 --rm $USER/task-assigning:1.0-SNAPSHOT
docker run -p 8080:8080 --rm $USER/task-assigning:0.0.1
```

## Run it native
Expand All @@ -112,13 +117,13 @@ To increase startup performance for serverless deployments, build the applicatio
2. Compile it natively. This takes a few minutes:

```sh
$ mvn package -Dnative
mvn package -Dnative
```

3. Run the native executable:

```sh
$ ./target/*-runner
./target/*-runner
```

4. Visit [http://localhost:8080](http://localhost:8080) in your browser.
Expand Down
248 changes: 11 additions & 237 deletions use-cases/task-assigning/pom.xml
Original file line number Diff line number Diff line change
@@ -1,247 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.acme</groupId>
<parent>
<groupId>ai.timefold.solver</groupId>
<artifactId>timefold-solver-service-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>

<groupId>ai.timefold.model</groupId>
<artifactId>task-assigning</artifactId>
<version>1.0-SNAPSHOT</version>
<version>${revision}</version>

<properties>
<revision>0.0.1</revision>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<version.io.quarkus>3.39.2</version.io.quarkus>
<version.ai.timefold.solver>999-SNAPSHOT</version.ai.timefold.solver>
<version.org.apache.commons.text>1.15.0</version.org.apache.commons.text>

<version.compiler.plugin>3.16.0</version.compiler.plugin>
<version.resources.plugin>3.5.0</version.resources.plugin>
<version.surefire.plugin>3.5.6</version.surefire.plugin>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${version.io.quarkus}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>ai.timefold.solver</groupId>
<artifactId>timefold-solver-bom</artifactId>
<version>${version.ai.timefold.solver}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>ai.timefold.solver</groupId>
<artifactId>timefold-solver-quarkus</artifactId>
</dependency>
<dependency>
<groupId>ai.timefold.solver</groupId>
<artifactId>timefold-solver-quarkus-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${version.org.apache.commons.text}</version>
</dependency>

<!-- Testing -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.7</version>
<scope>test</scope>
</dependency>

<!-- UI -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-web-dependency-locator</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.3.8</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.7.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>7.1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>js-joda</artifactId>
<version>1.11.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>js-joda__locale_en-us</artifactId>
<version>3.1.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.resources.plugin}</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${version.io.quarkus}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>
${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.native.enabled>true</quarkus.native.enabled>
<!-- To allow application.properties to avoid using the in-memory database for native builds. -->
<quarkus.profile>native</quarkus.profile>
</properties>
</profile>
<profile>
<id>container</id>
<activation>
<property>
<name>container</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-jib</artifactId>
</dependency>
</dependencies>
<properties>
<quarkus.container-image.build>true</quarkus.container-image.build>
</properties>
</profile>
<profile>
<id>enterprise</id>
<activation>
<property>
<name>enterprise</name>
</property>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>ai.timefold.solver.enterprise</groupId>
<artifactId>timefold-solver-enterprise-bom</artifactId>
<version>${version.ai.timefold.solver}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>ai.timefold.solver.enterprise</groupId>
<artifactId>timefold-solver-enterprise-quarkus</artifactId>
</dependency>
<dependency>
<groupId>ai.timefold.solver.enterprise</groupId>
<artifactId>timefold-solver-enterprise-quarkus-jackson</artifactId>
</dependency>
</dependencies>
<properties>
<quarkus.profile>enterprise</quarkus.profile>
</properties>
</profile>
</profiles>

</project>
Loading
Loading