You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by xi...@apache.org on 2024/08/20 13:38:30 UTC
(pulsar-java-contrib) 04/08: delete unused file
This is an automated email from the ASF dual-hosted git repository.
xiangying pushed a commit to branch InitProject
in repository https://gitbox.apache.org/repos/asf/pulsar-java-contrib.git
commit 52b38544f5328b98d1920c9ae64f592b1055d527
Author: xiangying <xi...@apache.org>
AuthorDate: Mon Jul 29 00:34:01 2024 +0800
delete unused file
(cherry picked from commit 9a0d28b677f923bb27ff81d532e363435a9d9e3d)
---
hello-world/.gitignore | 13 -
hello-world/README.adoc | 36 --
hello-world/build.gradle | 54 --
hello-world/pom.xml | 136 -----
.../jar-with-dependencies-and-services.xml | 22 -
.../org/acme/schooltimetabling/TimeTableApp.java | 148 ------
.../org/acme/schooltimetabling/domain/Lesson.java | 80 ---
.../org/acme/schooltimetabling/domain/Room.java | 24 -
.../acme/schooltimetabling/domain/TimeTable.java | 57 --
.../acme/schooltimetabling/domain/Timeslot.java | 43 --
.../solver/TimeTableConstraintProvider.java | 104 ----
hello-world/src/main/resources/logback.xml | 16 -
.../schooltimetabling/JarWithDependenciesIT.java | 66 ---
.../solver/TimeTableConstraintProviderTest.java | 95 ----
technology/java-activemq-quarkus/.gitignore | 13 -
technology/java-activemq-quarkus/README.adoc | 142 -----
technology/java-activemq-quarkus/broker-00.xml | 23 -
technology/java-activemq-quarkus/client/.gitignore | 13 -
technology/java-activemq-quarkus/client/pom.xml | 108 ----
.../bootstrap/DemoDataGenerator.java | 205 --------
.../persistence/TimeTableRepository.java | 21 -
.../schooltimetabling/rest/TimeTableResource.java | 78 ---
.../src/main/resources/META-INF/resources/app.js | 261 ----------
.../main/resources/META-INF/resources/index.html | 75 ---
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 29 --
.../ActiveMQTestResourceLifecycleManager.java | 27 -
.../schooltimetabling/TimeTableResourceTest.java | 105 ----
technology/java-activemq-quarkus/common/.gitignore | 13 -
technology/java-activemq-quarkus/common/pom.xml | 47 --
.../org/acme/schooltimetabling/domain/Lesson.java | 80 ---
.../org/acme/schooltimetabling/domain/Room.java | 38 --
.../acme/schooltimetabling/domain/TimeTable.java | 69 ---
.../acme/schooltimetabling/domain/Timeslot.java | 57 --
.../schooltimetabling/message/SolverRequest.java | 28 -
.../schooltimetabling/message/SolverResponse.java | 80 ---
.../java-activemq-quarkus/docker-compose.yml | 18 -
technology/java-activemq-quarkus/pom.xml | 175 -------
technology/java-activemq-quarkus/run.sh | 85 ---
technology/java-activemq-quarkus/solver/.gitignore | 13 -
technology/java-activemq-quarkus/solver/pom.xml | 96 ----
.../solver/src/main/docker/Dockerfile.jvm | 59 ---
.../solver/src/main/docker/Dockerfile.native | 22 -
.../messaging/TimeTableMessagingHandler.java | 95 ----
.../solver/TimeTableConstraintProvider.java | 104 ----
.../src/main/resources/application.properties | 45 --
.../schooltimetabling/ActiveMQEmbeddedBroker.java | 52 --
.../TimeTableMessagingHandlerIT.java | 10 -
.../TimeTableMessagingHandlerTest.java | 144 -----
.../solver/TimeTableConstraintProviderTest.java | 100 ----
.../src/test/resources/application.properties | 21 -
.../solver/src/test/resources/broker.xml | 116 -----
technology/java-quarkus/README.adoc | 5 -
technology/java-spring-boot/.gitignore | 12 -
technology/java-spring-boot/README.adoc | 84 ---
technology/java-spring-boot/build.gradle | 47 --
technology/java-spring-boot/pom.xml | 149 ------
.../schooltimetabling/TimeTableSpringBootApp.java | 198 -------
.../org/acme/schooltimetabling/domain/Lesson.java | 90 ----
.../org/acme/schooltimetabling/domain/Room.java | 48 --
.../acme/schooltimetabling/domain/TimeTable.java | 72 ---
.../acme/schooltimetabling/domain/Timeslot.java | 63 ---
.../persistence/LessonRepository.java | 15 -
.../persistence/RoomRepository.java | 15 -
.../persistence/TimeTableRepository.java | 46 --
.../persistence/TimeslotRepository.java | 16 -
.../rest/TimeTableController.java | 54 --
.../solver/TimeTableConstraintProvider.java | 105 ----
.../src/main/resources/application.properties | 29 --
.../src/main/resources/static/app.js | 344 ------------
.../src/main/resources/static/index.html | 179 -------
.../main/resources/static/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../rest/TimeTableControllerTest.java | 50 --
.../solver/TimeTableBenchmarkTest.java | 24 -
.../solver/TimeTableConstraintProviderTest.java | 98 ----
technology/kotlin-quarkus/.dockerignore | 3 -
technology/kotlin-quarkus/.gitignore | 14 -
technology/kotlin-quarkus/.s2i/environment | 5 -
technology/kotlin-quarkus/README.adoc | 170 ------
technology/kotlin-quarkus/pom.xml | 279 ----------
.../kotlin-quarkus/src/main/docker/Dockerfile.jvm | 57 --
.../src/main/docker/Dockerfile.native | 27 -
.../bootstrap/DemoDataGenerator.kt | 208 --------
.../acme/kotlin/schooltimetabling/domain/Lesson.kt | 51 --
.../acme/kotlin/schooltimetabling/domain/Room.kt | 31 --
.../kotlin/schooltimetabling/domain/TimeTable.kt | 38 --
.../kotlin/schooltimetabling/domain/Timeslot.kt | 37 --
.../persistence/LessonRepository.kt | 8 -
.../persistence/RoomRepository.kt | 8 -
.../persistence/TimeslotRepository.kt | 8 -
.../schooltimetabling/rest/TimeTableResource.kt | 88 ----
.../solver/TimeTableConstraintProvider.kt | 115 ----
.../src/main/kubernetes/openshift.yml | 145 ------
.../src/main/resources/META-INF/resources/app.js | 344 ------------
.../main/resources/META-INF/resources/index.html | 178 -------
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 77 ---
.../acme/kotlin/schooltimetabling/TestResources.kt | 8 -
.../rest/TimeTableResourceTest.kt | 41 --
.../solver/TimeTableConstraintProviderTest.kt | 97 ----
technology/kubernetes/.gitignore | 14 -
technology/kubernetes/README.adoc | 234 ---------
technology/kubernetes/artemis-broker.yaml | 13 -
technology/kubernetes/common/.gitignore | 14 -
technology/kubernetes/common/pom.xml | 62 ---
.../acme/common/domain/AbstractPersistable.java | 46 --
.../main/java/org/acme/common/domain/Lesson.java | 81 ---
.../src/main/java/org/acme/common/domain/Room.java | 36 --
.../java/org/acme/common/domain/TimeTable.java | 58 ---
.../main/java/org/acme/common/domain/Timeslot.java | 60 ---
.../java/org/acme/common/event/SolverEvent.java | 23 -
.../org/acme/common/event/SolverEventType.java | 6 -
.../org/acme/common/message/SolverRequest.java | 20 -
.../org/acme/common/message/SolverResponse.java | 69 ---
.../acme/common/persistence/LessonRepository.java | 19 -
.../acme/common/persistence/RoomRepository.java | 18 -
.../common/persistence/TimeTableRepository.java | 47 --
.../common/persistence/TimeslotRepository.java | 19 -
.../common/solver/TimeTableConstraintProvider.java | 104 ----
.../solver/TimeTableConstraintProviderTest.java | 95 ----
technology/kubernetes/demo-app/.gitignore | 14 -
technology/kubernetes/demo-app/pom.xml | 133 -----
.../demo-app/src/main/docker/Dockerfile.jvm | 59 ---
.../demo-app/src/main/docker/Dockerfile.native | 22 -
.../acme/demoapp/generator/DemoDataGenerator.java | 114 ----
.../main/java/org/acme/demoapp/rest/Dataset.java | 60 ---
.../org/acme/demoapp/rest/DemoDataResource.java | 148 ------
.../java/org/acme/demoapp/rest/EventResource.java | 54 --
.../demo-app/src/main/kubernetes/openshift.yml | 147 ------
.../src/main/resources/META-INF/resources/app.js | 77 ---
.../main/resources/META-INF/resources/index.html | 50 --
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 51 --
.../demoapp/InMemoryBrokerLifecycleManager.java | 25 -
.../demoapp/generator/DemoDataGeneratorTest.java | 78 ---
.../acme/demoapp/rest/DemoDataResourceTest.java | 60 ---
technology/kubernetes/demo.sh | 205 --------
technology/kubernetes/docker-compose.yml | 25 -
technology/kubernetes/pom.xml | 163 ------
.../kubernetes/school-timetabling/.gitignore | 14 -
technology/kubernetes/school-timetabling/pom.xml | 133 -----
.../src/main/docker/Dockerfile.jvm | 59 ---
.../src/main/docker/Dockerfile.native | 22 -
.../messaging/MessageHandler.java | 134 -----
.../src/main/resources/application.properties | 82 ---
.../ActiveMQEmbeddedBrokerLifecycleManager.java | 52 --
.../messaging/MessageHandlerTest.java | 163 ------
.../src/test/resources/broker.xml | 101 ----
technology/python/README.adoc | 5 -
use-cases/call-center/.dockerignore | 3 -
use-cases/call-center/.gitignore | 14 -
use-cases/call-center/.s2i/environment | 5 -
use-cases/call-center/README.adoc | 155 ------
use-cases/call-center/pom.xml | 199 -------
.../call-center/src/main/docker/Dockerfile.jvm | 59 ---
.../call-center/src/main/docker/Dockerfile.native | 22 -
.../org/acme/callcenter/data/DataGenerator.java | 70 ---
.../java/org/acme/callcenter/domain/Agent.java | 60 ---
.../main/java/org/acme/callcenter/domain/Call.java | 165 ------
.../org/acme/callcenter/domain/CallCenter.java | 69 ---
.../callcenter/domain/PreviousCallOrAgent.java | 42 --
.../java/org/acme/callcenter/domain/Skill.java | 24 -
.../acme/callcenter/rest/CallCenterResource.java | 61 ---
.../org/acme/callcenter/rest/CallResource.java | 33 --
.../acme/callcenter/rest/SimulationParameters.java | 23 -
.../acme/callcenter/rest/SimulationResource.java | 19 -
.../acme/callcenter/service/SimulationService.java | 141 -----
.../org/acme/callcenter/service/SolverService.java | 113 ----
.../solver/CallCenterConstraintsProvider.java | 33 --
.../ResponseTimeUpdatingVariableListener.java | 64 ---
.../solver/change/AddCallProblemChange.java | 20 -
.../solver/change/PinCallProblemChange.java | 25 -
.../change/ProlongCallByMinuteProblemChange.java | 26 -
.../solver/change/RemoveCallProblemChange.java | 37 --
.../src/main/resources/META-INF/resources/app.js | 303 -----------
.../main/resources/META-INF/resources/index.html | 59 ---
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../main/resources/META-INF/resources/style.css | 3 -
.../src/main/resources/application.properties | 31 --
.../solver/CallCenterConstraintProviderTest.java | 56 --
.../acme/callcenter/solver/SolverServiceTest.java | 125 -----
use-cases/employee-scheduling/.dockerignore | 3 -
use-cases/employee-scheduling/.gitignore | 14 -
use-cases/employee-scheduling/.s2i/environment | 5 -
use-cases/employee-scheduling/README.adoc | 165 ------
use-cases/employee-scheduling/pom.xml | 216 --------
.../src/main/docker/Dockerfile.jvm | 59 ---
.../src/main/docker/Dockerfile.native | 23 -
.../bootstrap/DemoDataGenerator.java | 213 --------
.../employeescheduling/domain/Availability.java | 72 ---
.../domain/AvailabilityType.java | 7 -
.../acme/employeescheduling/domain/Employee.java | 50 --
.../domain/EmployeeSchedule.java | 89 ----
.../employeescheduling/domain/ScheduleState.java | 108 ----
.../org/acme/employeescheduling/domain/Shift.java | 106 ----
.../domain/ShiftPinningFilter.java | 12 -
.../persistence/AvailabilityRepository.java | 11 -
.../persistence/EmployeeRepository.java | 11 -
.../persistence/ScheduleStateRepository.java | 11 -
.../persistence/ShiftRepository.java | 11 -
.../rest/EmployeeScheduleResource.java | 115 ----
.../EmployeeSchedulingConstraintProvider.java | 111 ----
.../src/main/kubernetes/openshift.yml | 145 ------
.../src/main/resources/META-INF/resources/app.js | 361 -------------
.../main/resources/META-INF/resources/index.html | 79 ---
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 79 ---
.../org/acme/employeescheduling/TestResources.java | 9 -
.../rest/EmployeeScheduleResourceTest.java | 41 --
.../EmployeeSchedulingConstraintProviderTest.java | 214 --------
use-cases/facility-location/.dockerignore | 3 -
use-cases/facility-location/.gitignore | 14 -
use-cases/facility-location/.s2i/environment | 5 -
use-cases/facility-location/README.adoc | 155 ------
use-cases/facility-location/pom.xml | 189 -------
.../src/main/docker/Dockerfile.jvm | 57 --
.../src/main/docker/Dockerfile.native | 27 -
.../bootstrap/DemoDataBuilder.java | 119 -----
.../bootstrap/DemoDataGenerator.java | 34 --
.../org/acme/facilitylocation/domain/Consumer.java | 84 ---
.../org/acme/facilitylocation/domain/Facility.java | 79 ---
.../FacilityLocationConstraintConfiguration.java | 20 -
.../domain/FacilityLocationProblem.java | 122 -----
.../org/acme/facilitylocation/domain/Location.java | 34 --
.../FacilityLocationProblemRepository.java | 21 -
.../acme/facilitylocation/rest/SolverResource.java | 66 ---
.../org/acme/facilitylocation/rest/Status.java | 16 -
.../solver/FacilityLocationConstraintProvider.java | 44 --
.../src/main/resources/META-INF/resources/app.js | 245 ---------
.../main/resources/META-INF/resources/favicon.ico | Bin 1150 -> 0 bytes
.../main/resources/META-INF/resources/index.html | 98 ----
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 44 --
.../bootstrap/DemoDataBuilderTest.java | 90 ----
.../FacilityLocationConstraintProviderTest.java | 89 ----
.../facilitylocation/solver/SolverManagerTest.java | 41 --
use-cases/maintenance-scheduling/.dockerignore | 3 -
use-cases/maintenance-scheduling/.gitignore | 14 -
use-cases/maintenance-scheduling/.s2i/environment | 5 -
use-cases/maintenance-scheduling/README.adoc | 165 ------
use-cases/maintenance-scheduling/pom.xml | 216 --------
.../src/main/docker/Dockerfile.jvm | 59 ---
.../src/main/docker/Dockerfile.native | 23 -
.../bootstrap/DemoDataGenerator.java | 96 ----
.../acme/maintenancescheduling/domain/Crew.java | 49 --
.../org/acme/maintenancescheduling/domain/Job.java | 132 -----
.../domain/MaintenanceSchedule.java | 87 ----
.../maintenancescheduling/domain/WorkCalendar.java | 48 --
.../persistence/CrewRepository.java | 12 -
.../persistence/JobRepository.java | 12 -
.../persistence/WorkCalendarRepository.java | 11 -
.../rest/MaintenanceScheduleResource.java | 89 ----
.../solver/EndDateUpdatingVariableListener.java | 60 ---
.../MaintenanceScheduleConstraintProvider.java | 119 -----
.../src/main/kubernetes/openshift.yml | 145 ------
.../src/main/resources/META-INF/resources/app.js | 276 ----------
.../main/resources/META-INF/resources/index.html | 78 ---
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 76 ---
.../acme/maintenancescheduling/TestResources.java | 9 -
.../rest/MaintenanceScheduleResourceTest.java | 42 --
...aintenanceSchedulingConstraintProviderTest.java | 144 -----
use-cases/order-picking/.dockerignore | 3 -
use-cases/order-picking/.gitignore | 14 -
use-cases/order-picking/.s2i/environment | 5 -
use-cases/order-picking/README.adoc | 155 ------
use-cases/order-picking/pom.xml | 196 -------
.../order-picking/src/main/docker/Dockerfile.jvm | 55 --
.../src/main/docker/Dockerfile.native | 27 -
.../orderpicking/bootstrap/DemoDataGenerator.java | 282 ----------
.../java/org/acme/orderpicking/domain/Order.java | 39 --
.../org/acme/orderpicking/domain/OrderItem.java | 70 ---
.../orderpicking/domain/OrderPickingPlanning.java | 46 --
.../orderpicking/domain/OrderPickingSolution.java | 68 ---
.../java/org/acme/orderpicking/domain/Product.java | 73 ---
.../org/acme/orderpicking/domain/Shelving.java | 54 --
.../java/org/acme/orderpicking/domain/Trolley.java | 58 ---
.../orderpicking/domain/TrolleyOrTrolleyStep.java | 37 --
.../org/acme/orderpicking/domain/TrolleyStep.java | 101 ----
.../org/acme/orderpicking/domain/Warehouse.java | 213 --------
.../orderpicking/domain/WarehouseLocation.java | 59 ---
.../persistence/OrderPickingRepository.java | 18 -
.../rest/OrderPickingSolverResource.java | 50 --
.../solver/OrderPickingConstraintProvider.java | 99 ----
.../src/main/resources/META-INF/resources/app.js | 579 ---------------------
.../main/resources/META-INF/resources/index.html | 101 ----
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../main/resources/META-INF/resources/style.css | 11 -
.../resources/META-INF/resources/tango-color.js | 51 --
.../resources/META-INF/resources/warehouse-api.js | 371 -------------
.../src/main/resources/application.properties | 32 --
.../acme/orderpicking/domain/WarehouseTest.java | 186 -------
.../solver/OrderPickingConstraintProviderTest.java | 241 ---------
use-cases/school-timetabling/.dockerignore | 3 -
use-cases/school-timetabling/.gitignore | 14 -
use-cases/school-timetabling/.s2i/environment | 5 -
use-cases/school-timetabling/README.adoc | 186 -------
use-cases/school-timetabling/build.gradle | 68 ---
use-cases/school-timetabling/pom.xml | 224 --------
.../src/main/docker/Dockerfile.jvm | 59 ---
.../src/main/docker/Dockerfile.native | 22 -
.../bootstrap/DemoDataGenerator.java | 206 --------
.../org/acme/schooltimetabling/domain/Lesson.java | 90 ----
.../org/acme/schooltimetabling/domain/Room.java | 49 --
.../acme/schooltimetabling/domain/TimeTable.java | 69 ---
.../acme/schooltimetabling/domain/Timeslot.java | 64 ---
.../persistence/LessonRepository.java | 12 -
.../persistence/RoomRepository.java | 12 -
.../persistence/TimeslotRepository.java | 12 -
.../schooltimetabling/rest/LessonResource.java | 12 -
.../acme/schooltimetabling/rest/RoomResource.java | 12 -
.../schooltimetabling/rest/TimeTableResource.java | 91 ----
.../schooltimetabling/rest/TimeslotResource.java | 12 -
.../solver/TimeTableConstraintProvider.java | 104 ----
.../src/main/kubernetes/openshift.yml | 145 ------
.../src/main/resources/META-INF/resources/app.js | 344 ------------
.../main/resources/META-INF/resources/index.html | 178 -------
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 77 ---
.../org/acme/schooltimetabling/TestResources.java | 9 -
.../schooltimetabling/rest/LessonResourceIT.java | 8 -
.../schooltimetabling/rest/LessonResourceTest.java | 50 --
.../schooltimetabling/rest/RoomResourceIT.java | 8 -
.../schooltimetabling/rest/RoomResourceTest.java | 48 --
.../rest/TimeTableResourceTest.java | 45 --
.../schooltimetabling/rest/TimeslotResourceIT.java | 8 -
.../rest/TimeslotResourceTest.java | 52 --
.../solver/TimeTableBenchmarkTest.java | 25 -
.../solver/TimeTableConstraintProviderTest.java | 100 ----
use-cases/vaccination-scheduling/.dockerignore | 3 -
use-cases/vaccination-scheduling/.gitignore | 14 -
use-cases/vaccination-scheduling/.s2i/environment | 5 -
use-cases/vaccination-scheduling/README.adoc | 155 ------
use-cases/vaccination-scheduling/pom.xml | 204 --------
.../src/main/docker/Dockerfile.jvm | 59 ---
.../src/main/docker/Dockerfile.native | 22 -
.../bootstrap/DemoDataGenerator.java | 251 ---------
.../vaccinationscheduler/domain/Appointment.java | 51 --
.../acme/vaccinationscheduler/domain/Location.java | 24 -
.../acme/vaccinationscheduler/domain/Person.java | 160 ------
.../domain/VaccinationCenter.java | 45 --
.../domain/VaccinationSchedule.java | 75 ---
.../vaccinationscheduler/domain/VaccineType.java | 55 --
.../domain/solver/PersonAssignment.java | 180 -------
.../domain/solver/VaccinationSlot.java | 95 ----
.../domain/solver/VaccinationSolution.java | 238 ---------
.../persistence/VaccinationScheduleRepository.java | 20 -
.../rest/VaccinationScheduleSolverResource.java | 129 -----
.../PersonAssignmentDifficultyComparator.java | 17 -
.../VaccinationScheduleConstraintProvider.java | 249 ---------
.../solver/geo/DistanceCalculator.java | 26 -
.../solver/geo/EuclideanDistanceCalculator.java | 23 -
.../VaccinationCustomConstructionHeuristic.java | 168 ------
.../src/main/resources/META-INF/resources/app.js | 363 -------------
.../main/resources/META-INF/resources/index.html | 77 ---
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 48 --
.../src/main/resources/solverConfig.xml | 14 -
.../domain/solver/VaccinationSolutionTest.java | 208 --------
.../VaccinationScheduleConstraintProviderTest.java | 425 ---------------
use-cases/vehicle-routing/.dockerignore | 3 -
use-cases/vehicle-routing/.gitignore | 14 -
use-cases/vehicle-routing/.s2i/environment | 5 -
use-cases/vehicle-routing/README.adoc | 155 ------
use-cases/vehicle-routing/pom.xml | 210 --------
.../vehicle-routing/src/main/docker/Dockerfile.jvm | 57 --
.../src/main/docker/Dockerfile.native | 27 -
.../vehiclerouting/bootstrap/DemoDataBuilder.java | 167 ------
.../bootstrap/DemoDataGenerator.java | 34 --
.../org/acme/vehiclerouting/domain/Customer.java | 52 --
.../java/org/acme/vehiclerouting/domain/Depot.java | 20 -
.../org/acme/vehiclerouting/domain/Location.java | 70 ---
.../org/acme/vehiclerouting/domain/Vehicle.java | 116 -----
.../domain/VehicleRoutingSolution.java | 123 -----
.../domain/geo/DistanceCalculator.java | 50 --
.../domain/geo/EuclideanDistanceCalculator.java | 23 -
.../DepotAngleCustomerDifficultyWeightFactory.java | 52 --
.../VehicleRoutingSolutionRepository.java | 21 -
.../acme/vehiclerouting/rest/SolverResource.java | 73 ---
.../java/org/acme/vehiclerouting/rest/Status.java | 17 -
.../solver/VehicleRoutingConstraintProvider.java | 41 --
.../src/main/resources/META-INF/resources/app.js | 269 ----------
.../main/resources/META-INF/resources/favicon.ico | Bin 1150 -> 0 bytes
.../main/resources/META-INF/resources/index.html | 111 ----
.../META-INF/resources/optaPlannerLogo200px.png | Bin 3467 -> 0 bytes
.../src/main/resources/application.properties | 44 --
.../bootstrap/DemoDataBuilderTest.java | 85 ---
.../geo/EuclideanDistanceCalculatorTest.java | 36 --
.../vehiclerouting/rest/SolverResourceTest.java | 42 --
.../vehiclerouting/solver/SolverManagerTest.java | 34 --
.../VehicleRoutingConstraintProviderTest.java | 69 ---
391 files changed, 29834 deletions(-)
diff --git a/hello-world/.gitignore b/hello-world/.gitignore
deleted file mode 100644
index 8edd787..0000000
--- a/hello-world/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/hello-world/README.adoc b/hello-world/README.adoc
deleted file mode 100644
index 3cda676..0000000
--- a/hello-world/README.adoc
+++ /dev/null
@@ -1,36 +0,0 @@
-= School Timetabling (Java, Maven or Gradle)
-
-Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.
-
-== Run the application
-
-. Git clone the optaplanner-quickstarts repo:
-+
-[source, shell]
-----
-$ git clone https://github.com/kiegroup/optaplanner-quickstarts.git
-...
-$ cd optaplanner-quickstarts/hello-world
-----
-
-. Start the application with Maven:
-+
-[source, shell]
-----
-$ mvn verify
-...
-$ java -jar target/hello-world-run.jar
-----
-+
-or with Gradle:
-+
-[source, shell]
-----
-$ gradle run
-----
-
-Look for the planning solution in the console log.
-
-== More information
-
-Visit https://www.optaplanner.org/[www.optaplanner.org].
diff --git a/hello-world/build.gradle b/hello-world/build.gradle
deleted file mode 100644
index a09807a..0000000
--- a/hello-world/build.gradle
+++ /dev/null
@@ -1,54 +0,0 @@
-plugins {
- id "java"
- id "application"
-}
-
-def optaplannerVersion = "9.44.0.Final"
-def logbackVersion = "1.2.11"
-def junitJupiterVersion = "5.9.0"
-def assertjVersion = "3.24.2"
-
-group = "org.acme"
-version = "1.0-SNAPSHOT"
-
-repositories {
- mavenCentral()
- mavenLocal()
-}
-
-dependencies {
- implementation platform("org.optaplanner:optaplanner-bom:${optaplannerVersion}")
- implementation "org.optaplanner:optaplanner-core"
- testImplementation "org.optaplanner:optaplanner-test"
- testImplementation "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}"
- testImplementation "org.assertj:assertj-core:${assertjVersion}"
-
- runtimeOnly "ch.qos.logback:logback-classic:${logbackVersion}"
-}
-
-java {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
-}
-
-compileJava {
- options.encoding = "UTF-8"
- options.compilerArgs << "-parameters"
-}
-
-compileTestJava {
- options.encoding = "UTF-8"
-}
-
-application {
- mainClass = "org.acme.schooltimetabling.TimeTableApp"
-}
-
-test {
- // Log the test execution results.
- testLogging {
- events "passed", "skipped", "failed"
- }
-
- useJUnitPlatform()
-}
diff --git a/hello-world/pom.xml b/hello-world/pom.xml
deleted file mode 100644
index 142fbcd..0000000
--- a/hello-world/pom.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?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">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.acme</groupId>
- <artifactId>optaplanner-hello-world-school-timetabling-quickstart</artifactId>
- <version>1.0-SNAPSHOT</version>
-
- <properties>
- <maven.compiler.release>11</maven.compiler.release>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <jar.with.dependencies.name>hello-world-run</jar.with.dependencies.name>
-
- <version.org.optaplanner>9.44.0.Final</version.org.optaplanner>
- <version.org.assertj>3.24.2</version.org.assertj>
- <version.org.junit.jupiter>5.9.0</version.org.junit.jupiter>
- <version.org.logback>1.2.11</version.org.logback>
-
- <version.compiler.plugin>3.10.1</version.compiler.plugin>
- <version.surefire.plugin>3.0.0-M8</version.surefire.plugin>
- <version.assembly.plugin>3.4.2</version.assembly.plugin>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-bom</artifactId>
- <version>${version.org.optaplanner}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.junit</groupId>
- <artifactId>junit-bom</artifactId>
- <version>${version.org.junit.jupiter}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>${version.org.logback}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-core</artifactId>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <version>${version.org.assertj}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${version.compiler.plugin}</version>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${version.surefire.plugin}</version>
- </plugin>
- <plugin> <!-- For the purposes of integration testing only. -->
- <artifactId>maven-failsafe-plugin</artifactId>
- <version>${version.surefire.plugin}</version>
- <configuration>
- <systemPropertyVariables>
- <artifactName>${jar.with.dependencies.name}</artifactName>
- </systemPropertyVariables>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${version.assembly.plugin}</version>
- <configuration>
- <finalName>${jar.with.dependencies.name}</finalName>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors> <!-- Builds a JAR with dependencies that correctly merges META-INF/service descriptors. -->
- <descriptor>src/assembly/jar-with-dependencies-and-services.xml</descriptor>
- </descriptors>
- <archive>
- <manifestEntries>
- <Main-Class>org.acme.schooltimetabling.TimeTableApp</Main-Class>
- <Multi-Release>true</Multi-Release> <!-- Some of our dependencies are multi-release JARs. -->
- </manifestEntries>
- </archive>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/hello-world/src/assembly/jar-with-dependencies-and-services.xml b/hello-world/src/assembly/jar-with-dependencies-and-services.xml
deleted file mode 100644
index d98142b..0000000
--- a/hello-world/src/assembly/jar-with-dependencies-and-services.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
- <id>jar-with-dependencies-and-services</id>
- <formats>
- <format>jar</format>
- </formats>
- <containerDescriptorHandlers>
- <containerDescriptorHandler>
- <handlerName>metaInf-services</handlerName>
- </containerDescriptorHandler>
- </containerDescriptorHandlers>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory>/</outputDirectory>
- <useProjectArtifact>true</useProjectArtifact>
- <unpack>true</unpack>
- <scope>runtime</scope>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
diff --git a/hello-world/src/main/java/org/acme/schooltimetabling/TimeTableApp.java b/hello-world/src/main/java/org/acme/schooltimetabling/TimeTableApp.java
deleted file mode 100644
index e3ec977..0000000
--- a/hello-world/src/main/java/org/acme/schooltimetabling/TimeTableApp.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.acme.schooltimetabling;
-
-import java.time.DayOfWeek;
-import java.time.Duration;
-import java.time.LocalTime;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.acme.schooltimetabling.solver.TimeTableConstraintProvider;
-import org.optaplanner.core.api.solver.Solver;
-import org.optaplanner.core.api.solver.SolverFactory;
-import org.optaplanner.core.config.solver.SolverConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TimeTableApp {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(TimeTableApp.class);
-
- public static void main(String[] args) {
- SolverFactory<TimeTable> solverFactory = SolverFactory.create(new SolverConfig()
- .withSolutionClass(TimeTable.class)
- .withEntityClasses(Lesson.class)
- .withConstraintProviderClass(TimeTableConstraintProvider.class)
- // The solver runs only for 5 seconds on this small dataset.
- // It's recommended to run for at least 5 minutes ("5m") otherwise.
- .withTerminationSpentLimit(Duration.ofSeconds(5)));
-
- // Load the problem
- TimeTable problem = generateDemoData();
-
- // Solve the problem
- Solver<TimeTable> solver = solverFactory.buildSolver();
- TimeTable solution = solver.solve(problem);
-
- // Visualize the solution
- printTimetable(solution);
- }
-
- public static TimeTable generateDemoData() {
- List<Timeslot> timeslotList = new ArrayList<>(10);
- timeslotList.add(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
-
- timeslotList.add(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotList.add(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
-
- List<Room> roomList = new ArrayList<>(3);
- roomList.add(new Room("Room A"));
- roomList.add(new Room("Room B"));
- roomList.add(new Room("Room C"));
-
- List<Lesson> lessonList = new ArrayList<>();
- long id = 0;
- lessonList.add(new Lesson(id++, "Math", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(id++, "Math", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(id++, "Physics", "M. Curie", "9th grade"));
- lessonList.add(new Lesson(id++, "Chemistry", "M. Curie", "9th grade"));
- lessonList.add(new Lesson(id++, "Biology", "C. Darwin", "9th grade"));
- lessonList.add(new Lesson(id++, "History", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(id++, "English", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(id++, "English", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(id++, "Spanish", "P. Cruz", "9th grade"));
- lessonList.add(new Lesson(id++, "Spanish", "P. Cruz", "9th grade"));
-
- lessonList.add(new Lesson(id++, "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(id++, "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(id++, "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(id++, "Physics", "M. Curie", "10th grade"));
- lessonList.add(new Lesson(id++, "Chemistry", "M. Curie", "10th grade"));
- lessonList.add(new Lesson(id++, "French", "M. Curie", "10th grade"));
- lessonList.add(new Lesson(id++, "Geography", "C. Darwin", "10th grade"));
- lessonList.add(new Lesson(id++, "History", "I. Jones", "10th grade"));
- lessonList.add(new Lesson(id++, "English", "P. Cruz", "10th grade"));
- lessonList.add(new Lesson(id++, "Spanish", "P. Cruz", "10th grade"));
-
- return new TimeTable(timeslotList, roomList, lessonList);
- }
-
- private static void printTimetable(TimeTable timeTable) {
- LOGGER.info("");
- List<Room> roomList = timeTable.getRoomList();
- List<Lesson> lessonList = timeTable.getLessonList();
- Map<Timeslot, Map<Room, List<Lesson>>> lessonMap = lessonList.stream()
- .filter(lesson -> lesson.getTimeslot() != null && lesson.getRoom() != null)
- .collect(Collectors.groupingBy(Lesson::getTimeslot, Collectors.groupingBy(Lesson::getRoom)));
- LOGGER.info("| | " + roomList.stream()
- .map(room -> String.format("%-10s", room.getName())).collect(Collectors.joining(" | ")) + " |");
- LOGGER.info("|" + "------------|".repeat(roomList.size() + 1));
- for (Timeslot timeslot : timeTable.getTimeslotList()) {
- List<List<Lesson>> cellList = roomList.stream()
- .map(room -> {
- Map<Room, List<Lesson>> byRoomMap = lessonMap.get(timeslot);
- if (byRoomMap == null) {
- return Collections.<Lesson>emptyList();
- }
- List<Lesson> cellLessonList = byRoomMap.get(room);
- if (cellLessonList == null) {
- return Collections.<Lesson>emptyList();
- }
- return cellLessonList;
- })
- .collect(Collectors.toList());
-
- LOGGER.info("| " + String.format("%-10s",
- timeslot.getDayOfWeek().toString().substring(0, 3) + " " + timeslot.getStartTime()) + " | "
- + cellList.stream().map(cellLessonList -> String.format("%-10s",
- cellLessonList.stream().map(Lesson::getSubject).collect(Collectors.joining(", "))))
- .collect(Collectors.joining(" | "))
- + " |");
- LOGGER.info("| | "
- + cellList.stream().map(cellLessonList -> String.format("%-10s",
- cellLessonList.stream().map(Lesson::getTeacher).collect(Collectors.joining(", "))))
- .collect(Collectors.joining(" | "))
- + " |");
- LOGGER.info("| | "
- + cellList.stream().map(cellLessonList -> String.format("%-10s",
- cellLessonList.stream().map(Lesson::getStudentGroup).collect(Collectors.joining(", "))))
- .collect(Collectors.joining(" | "))
- + " |");
- LOGGER.info("|" + "------------|".repeat(roomList.size() + 1));
- }
- List<Lesson> unassignedLessons = lessonList.stream()
- .filter(lesson -> lesson.getTimeslot() == null || lesson.getRoom() == null)
- .collect(Collectors.toList());
- if (!unassignedLessons.isEmpty()) {
- LOGGER.info("");
- LOGGER.info("Unassigned lessons");
- for (Lesson lesson : unassignedLessons) {
- LOGGER.info(" " + lesson.getSubject() + " - " + lesson.getTeacher() + " - " + lesson.getStudentGroup());
- }
- }
- }
-
-}
diff --git a/hello-world/src/main/java/org/acme/schooltimetabling/domain/Lesson.java b/hello-world/src/main/java/org/acme/schooltimetabling/domain/Lesson.java
deleted file mode 100644
index 5c691c4..0000000
--- a/hello-world/src/main/java/org/acme/schooltimetabling/domain/Lesson.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import org.optaplanner.core.api.domain.entity.PlanningEntity;
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-import org.optaplanner.core.api.domain.variable.PlanningVariable;
-
-@PlanningEntity
-public class Lesson {
-
- @PlanningId
- private Long id;
-
- private String subject;
- private String teacher;
- private String studentGroup;
-
- @PlanningVariable
- private Timeslot timeslot;
- @PlanningVariable
- private Room room;
-
- // No-arg constructor required for OptaPlanner
- public Lesson() {
- }
-
- public Lesson(long id, String subject, String teacher, String studentGroup) {
- this.id = id;
- this.subject = subject;
- this.teacher = teacher;
- this.studentGroup = studentGroup;
- }
-
- public Lesson(long id, String subject, String teacher, String studentGroup, Timeslot timeslot, Room room) {
- this(id, subject, teacher, studentGroup);
- this.timeslot = timeslot;
- this.room = room;
- }
-
- @Override
- public String toString() {
- return subject + "(" + id + ")";
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public Long getId() {
- return id;
- }
-
- public String getSubject() {
- return subject;
- }
-
- public String getTeacher() {
- return teacher;
- }
-
- public String getStudentGroup() {
- return studentGroup;
- }
-
- public Timeslot getTimeslot() {
- return timeslot;
- }
-
- public void setTimeslot(Timeslot timeslot) {
- this.timeslot = timeslot;
- }
-
- public Room getRoom() {
- return room;
- }
-
- public void setRoom(Room room) {
- this.room = room;
- }
-
-}
diff --git a/hello-world/src/main/java/org/acme/schooltimetabling/domain/Room.java b/hello-world/src/main/java/org/acme/schooltimetabling/domain/Room.java
deleted file mode 100644
index 58b2e47..0000000
--- a/hello-world/src/main/java/org/acme/schooltimetabling/domain/Room.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-public class Room {
-
- private String name;
-
- public Room(String name) {
- this.name = name;
- }
-
- @Override
- public String toString() {
- return name;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public String getName() {
- return name;
- }
-
-}
diff --git a/hello-world/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java b/hello-world/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java
deleted file mode 100644
index 95f53b1..0000000
--- a/hello-world/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import java.util.List;
-
-import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty;
-import org.optaplanner.core.api.domain.solution.PlanningScore;
-import org.optaplanner.core.api.domain.solution.PlanningSolution;
-import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty;
-import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-
-@PlanningSolution
-public class TimeTable {
-
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- private List<Timeslot> timeslotList;
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- private List<Room> roomList;
- @PlanningEntityCollectionProperty
- private List<Lesson> lessonList;
-
- @PlanningScore
- private HardSoftScore score;
-
- // No-arg constructor required for OptaPlanner
- public TimeTable() {
- }
-
- public TimeTable(List<Timeslot> timeslotList, List<Room> roomList, List<Lesson> lessonList) {
- this.timeslotList = timeslotList;
- this.roomList = roomList;
- this.lessonList = lessonList;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public List<Timeslot> getTimeslotList() {
- return timeslotList;
- }
-
- public List<Room> getRoomList() {
- return roomList;
- }
-
- public List<Lesson> getLessonList() {
- return lessonList;
- }
-
- public HardSoftScore getScore() {
- return score;
- }
-
-}
diff --git a/hello-world/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java b/hello-world/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java
deleted file mode 100644
index 2247a67..0000000
--- a/hello-world/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-public class Timeslot {
-
- private DayOfWeek dayOfWeek;
- private LocalTime startTime;
- private LocalTime endTime;
-
- public Timeslot(DayOfWeek dayOfWeek, LocalTime startTime, LocalTime endTime) {
- this.dayOfWeek = dayOfWeek;
- this.startTime = startTime;
- this.endTime = endTime;
- }
-
- public Timeslot(DayOfWeek dayOfWeek, LocalTime startTime) {
- this(dayOfWeek, startTime, startTime.plusMinutes(50));
- }
-
- @Override
- public String toString() {
- return dayOfWeek + " " + startTime;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public DayOfWeek getDayOfWeek() {
- return dayOfWeek;
- }
-
- public LocalTime getStartTime() {
- return startTime;
- }
-
- public LocalTime getEndTime() {
- return endTime;
- }
-
-}
diff --git a/hello-world/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java b/hello-world/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java
deleted file mode 100644
index f0d24df..0000000
--- a/hello-world/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.acme.schooltimetabling.solver;
-
-import java.time.Duration;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.score.stream.Constraint;
-import org.optaplanner.core.api.score.stream.ConstraintFactory;
-import org.optaplanner.core.api.score.stream.ConstraintProvider;
-import org.optaplanner.core.api.score.stream.Joiners;
-
-public class TimeTableConstraintProvider implements ConstraintProvider {
-
- @Override
- public Constraint[] defineConstraints(ConstraintFactory constraintFactory) {
- return new Constraint[] {
- // Hard constraints
- roomConflict(constraintFactory),
- teacherConflict(constraintFactory),
- studentGroupConflict(constraintFactory),
- // Soft constraints
- teacherRoomStability(constraintFactory),
- teacherTimeEfficiency(constraintFactory),
- studentGroupSubjectVariety(constraintFactory)
- };
- }
-
- Constraint roomConflict(ConstraintFactory constraintFactory) {
- // A room can accommodate at most one lesson at the same time.
- return constraintFactory
- // Select each pair of 2 different lessons ...
- .forEachUniquePair(Lesson.class,
- // ... in the same timeslot ...
- Joiners.equal(Lesson::getTimeslot),
- // ... in the same room ...
- Joiners.equal(Lesson::getRoom))
- // ... and penalize each pair with a hard weight.
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Room conflict");
- }
-
- Constraint teacherConflict(ConstraintFactory constraintFactory) {
- // A teacher can teach at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getTeacher))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Teacher conflict");
- }
-
- Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
- // A student can attend at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getStudentGroup))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Student group conflict");
- }
-
- Constraint teacherRoomStability(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach in a single room.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTeacher))
- .filter((lesson1, lesson2) -> lesson1.getRoom() != lesson2.getRoom())
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher room stability");
- }
-
- Constraint teacherTimeEfficiency(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach sequential lessons and dislikes gaps between lessons.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class, Joiners.equal(Lesson::getTeacher),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .reward(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher time efficiency");
- }
-
- Constraint studentGroupSubjectVariety(ConstraintFactory constraintFactory) {
- // A student group dislikes sequential lessons on the same subject.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class,
- Joiners.equal(Lesson::getSubject),
- Joiners.equal(Lesson::getStudentGroup),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Student group subject variety");
- }
-
-}
diff --git a/hello-world/src/main/resources/logback.xml b/hello-world/src/main/resources/logback.xml
deleted file mode 100644
index 212e8a0..0000000
--- a/hello-world/src/main/resources/logback.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-
- <appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d{HH:mm:ss.SSS} [%-12.12t] %-5p %m%n</pattern>
- </encoder>
- </appender>
-
- <logger name="org.optaplanner" level="info"/>
-
- <root level="info">
- <appender-ref ref="consoleAppender" />
- </root>
-
-</configuration>
diff --git a/hello-world/src/test/java/org/acme/schooltimetabling/JarWithDependenciesIT.java b/hello-world/src/test/java/org/acme/schooltimetabling/JarWithDependenciesIT.java
deleted file mode 100644
index 74938e0..0000000
--- a/hello-world/src/test/java/org/acme/schooltimetabling/JarWithDependenciesIT.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.acme.schooltimetabling;
-
-import org.assertj.core.api.Assertions;
-import org.assertj.core.api.Assumptions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.io.IOException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.concurrent.TimeUnit;
-
-class JarWithDependenciesIT {
-
- // The property is set by maven-failsafe-plugin.
- private static final Path PATH_TO_JAR_WITH_DEPENDENCIES =
- Paths.get("target", System.getProperty("artifactName") + ".jar");
-
- private static final Path PATH_TO_JAVA_EXECUTABLE_UNIX =
- Paths.get(System.getenv("JAVA_HOME"), "bin", "java");
- private static final Path PATH_TO_JAVA_EXECUTABLE_WINDOWS =
- Paths.get(System.getenv("JAVA_HOME"), "bin", "java.exe");
-
- private Path pathToJavaExecutable;
-
- @BeforeEach
- void setJavaPath() {
- if (PATH_TO_JAVA_EXECUTABLE_WINDOWS.toFile().exists()) {
- pathToJavaExecutable = PATH_TO_JAVA_EXECUTABLE_WINDOWS;
- } else if (PATH_TO_JAVA_EXECUTABLE_UNIX.toFile().exists()) {
- pathToJavaExecutable = PATH_TO_JAVA_EXECUTABLE_UNIX;
- } else {
- Assertions.fail("Neither a Windows Java binary (" + PATH_TO_JAVA_EXECUTABLE_WINDOWS + ")"
- + " nor a Unix Java binary (" + PATH_TO_JAVA_EXECUTABLE_UNIX + ") was found."
- + System.lineSeparator() + "Maybe set JAVA_HOME?");
- }
- }
-
- @Test
- void runJarWithDependencies() throws IOException {
- Assumptions.assumeThat(PATH_TO_JAR_WITH_DEPENDENCIES)
- .as("Executable JAR not found. Maybe ensure maven-assembly-plugin was run beforehand?")
- .exists();
-
- Process process = new ProcessBuilder()
- .command(pathToJavaExecutable.toString(),
- "-jar",
- PATH_TO_JAR_WITH_DEPENDENCIES.toString())
- .inheritIO()
- .start();
- try {
- process.waitFor(1, TimeUnit.MINUTES);
- if (process.isAlive()) {
- Assertions.fail("Executable JAR timed out.");
- }
- Assertions.assertThat(process.exitValue())
- .as("Executable JAR exited abnormally.")
- .isEqualTo(0);
- } catch (InterruptedException e) {
- Assertions.fail("Waiting for executable JAR to finish was interrupted.", e);
- } finally {
- process.destroyForcibly();
- }
- }
-
-}
diff --git a/hello-world/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java b/hello-world/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java
deleted file mode 100644
index c2f2687..0000000
--- a/hello-world/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.acme.schooltimetabling.solver;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.junit.jupiter.api.Test;
-import org.optaplanner.test.api.score.stream.ConstraintVerifier;
-
-class TimeTableConstraintProviderTest {
-
- private static final Room ROOM1 = new Room("Room1");
- private static final Room ROOM2 = new Room("Room2");
- private static final Timeslot TIMESLOT1 = new Timeslot(DayOfWeek.MONDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT2 = new Timeslot(DayOfWeek.TUESDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT3 = new Timeslot(DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(1));
- private static final Timeslot TIMESLOT4 = new Timeslot(DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(3));
-
- ConstraintVerifier<TimeTableConstraintProvider, TimeTable> constraintVerifier = ConstraintVerifier.build(
- new TimeTableConstraintProvider(), TimeTable.class, Lesson.class);
-
- @Test
- void roomConflict() {
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", "Group2", TIMESLOT1, ROOM1);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::roomConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherConflict() {
- String conflictingTeacher = "Teacher1";
- Lesson firstLesson = new Lesson(1, "Subject1", conflictingTeacher, "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", conflictingTeacher, "Group2", TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher2", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void studentGroupConflict() {
- String conflictingGroup = "Group1";
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", conflictingGroup, TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", conflictingGroup, TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherRoomStability() {
- String teacher = "Teacher1";
- Lesson lessonInFirstRoom = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson lessonInSameRoom = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT1, ROOM1);
- Lesson lessonInDifferentRoom = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT1, ROOM2);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherRoomStability)
- .given(lessonInFirstRoom, lessonInDifferentRoom, lessonInSameRoom)
- .penalizesBy(2);
- }
-
- @Test
- void teacherTimeEfficiency() {
- String teacher = "Teacher1";
- Lesson singleLessonOnMonday = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithGap = new Lesson(4, "Subject4", teacher, "Group4", TIMESLOT4, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherTimeEfficiency)
- .given(singleLessonOnMonday, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithGap)
- .rewardsWith(1); // Second tuesday lesson immediately follows the first.
- }
-
- @Test
- void studentGroupSubjectVariety() {
- String studentGroup = "Group1";
- String repeatedSubject = "Subject1";
- Lesson mondayLesson = new Lesson(1, repeatedSubject, "Teacher1", studentGroup, TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, repeatedSubject, "Teacher2", studentGroup, TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, repeatedSubject, "Teacher3", studentGroup, TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithDifferentSubject = new Lesson(4, "Subject2", "Teacher4", studentGroup, TIMESLOT4, ROOM1);
- Lesson lessonInAnotherGroup = new Lesson(5, repeatedSubject, "Teacher5", "Group2", TIMESLOT1, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupSubjectVariety)
- .given(mondayLesson, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithDifferentSubject,
- lessonInAnotherGroup)
- .penalizesBy(1); // Second tuesday lesson immediately follows the first.
- }
-
-}
diff --git a/technology/java-activemq-quarkus/.gitignore b/technology/java-activemq-quarkus/.gitignore
deleted file mode 100644
index 8edd787..0000000
--- a/technology/java-activemq-quarkus/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/java-activemq-quarkus/README.adoc b/technology/java-activemq-quarkus/README.adoc
deleted file mode 100644
index fce93c2..0000000
--- a/technology/java-activemq-quarkus/README.adoc
+++ /dev/null
@@ -1,142 +0,0 @@
-= School Timetabling (Java, ActiveMQ, Quarkus, Maven)
-
-The quickstart consists of two modules:
-
-* Client runs the UI and sends requests to the Solver Server via ActiveMQ.
-* Solver Server optimizes the requests sent via an ActiveMQ queue and sends results back to ActiveMQ broker.
-
-== Run the application with live coding
-
-. Git clone the optaplanner-quickstarts repo:
-+
-[source, shell]
-----
-$ git clone https://github.com/kiegroup/optaplanner-quickstarts.git
-...
-$ cd optaplanner-quickstarts/technology/java-activemq-quarkus
-----
-
-. Build the project:
-+
-[source, shell]
-----
-$ mvn clean install
-----
-+
-
-. Install https://docs.docker.com/get-docker/[docker] and https://docs.docker.com/compose/install/[docker-compose].
-
-. Start the ActiveMQ broker, the Solver Server, and Client application with the `run.sh` script, which starts all 3 processes:
-+
-[source, shell]
-----
-$ ./run.sh
-----
-+
-
-. Visit http://localhost:8080 in your browser.
-
-. Click on the *Solve* button.
-
-In case of any error, please check the log files located in `java-activemq-quarkus/target`.
-
-Then try _live coding_:
-
-. Make some changes in the source code.
-. Refresh your browser (F5).
-
-Notice that those changes are immediately in effect.
-
-== Package and run the application
-
-When you're done iterating in `quarkus:dev` mode, run the application as a conventional jar file.
-Before running any application, start the ActiveMQ broker:
-
-[source, shell]
-----
-$ docker-compose up
-----
-
-=== Package and run the Solver Server application
-
-. Compile it with Maven:
-+
-[source, shell]
-----
-$ cd solver
-$ mvn package -DskipTests
-----
-+
-. Run it:
-+
-[source, shell]
-----
-$ java -Dquarkus.http.port=8081 -jar ./target/quarkus-app/quarkus-run.jar
-----
-
-[NOTE]
-Use the custom port to avoid conflict with the Client application.
-
-=== Package and run the Client application
-
-. Compile it with Maven:
-+
-[source, shell]
-----
-$ cd client
-$ mvn package -DskipTests
-----
-+
-. Run it:
-+
-[source, shell]
-----
-$ java -jar ./target/quarkus-app/quarkus-run.jar
-----
-+
-
-. Visit http://localhost:8080 in your browser.
-
-== Run a native executable
-
-First, https://quarkus.io/guides/building-native-image#configuring-graalvm[install GraalVM and gu install the native-image tool]
-
-=== Compile and run the Solver Server application natively
-
-. Compile the Solver Server application natively:
-+
-[source, shell]
-----
-$ cd solver
-$ mvn package -Dnative -DskipTests
-----
-+
-. Run the native executable:
-+
-[source, shell]
-----
-$ ./target/*-runner -Dquarkus.http.port=8081
-----
-
-=== Compile and run the Client application natively
-
-. Compile the Client application natively:
-+
-[source, shell]
-----
-$ cd client
-$ mvn package -Dnative -DskipTests
-----
-
-. Run the native executable:
-+
-[source, shell]
-----
-$ ./target/*-runner
-----
-
-. Visit http://localhost:8080 in your browser.
-
-== More information
-
-Visit https://www.optaplanner.org/[www.optaplanner.org].
diff --git a/technology/java-activemq-quarkus/broker-00.xml b/technology/java-activemq-quarkus/broker-00.xml
deleted file mode 100644
index 81f2bb0..0000000
--- a/technology/java-activemq-quarkus/broker-00.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
- <!-- from 1.0.0 to 1.5.5 the following line should be : <core xmlns="urn:activemq:core"> -->
- <core xmlns="urn:activemq:core" xsi:schemaLocation="urn:activemq:core ">
- <addresses>
- <address name="solver_request">
- <anycast>
- <queue name="solver_request">
- <durable>true</durable>
- </queue>
- </anycast>
- </address>
- <address name="solver_response">
- <anycast>
- <queue name="solver_response">
- <durable>true</durable>
- </queue>
- </anycast>
- </address>
- </addresses>
- </core>
-</configuration>
diff --git a/technology/java-activemq-quarkus/client/.gitignore b/technology/java-activemq-quarkus/client/.gitignore
deleted file mode 100644
index 8edd787..0000000
--- a/technology/java-activemq-quarkus/client/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/java-activemq-quarkus/client/pom.xml b/technology/java-activemq-quarkus/client/pom.xml
deleted file mode 100644
index cb49cfe..0000000
--- a/technology/java-activemq-quarkus/client/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>optaplanner-activemq-quarkus-school-timetabling</artifactId>
- <groupId>org.acme</groupId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>optaplanner-activemq-quarkus-school-timetabling-client</artifactId>
- <description>ActiveMQ Quarkus School Timetabling Quickstart : Client</description>
-
- <dependencies>
- <dependency>
- <groupId>org.acme</groupId>
- <artifactId>optaplanner-activemq-quarkus-school-timetabling-common</artifactId>
- <exclusions>
- <!-- Avoid bootstrapping the optaplanner-quarkus extension. -->
- <exclusion>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-resteasy</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-resteasy-jackson</artifactId>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus-jackson</artifactId>
- </dependency>
- <!-- Messaging -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-smallrye-reactive-messaging</artifactId>
- </dependency>
- <dependency>
- <groupId>io.smallrye.reactive</groupId>
- <artifactId>smallrye-reactive-messaging-amqp</artifactId>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.smallrye.reactive</groupId>
- <artifactId>smallrye-reactive-messaging-in-memory</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- UI -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-webjars-locator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>bootstrap</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>font-awesome</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars.npm</groupId>
- <artifactId>js-joda</artifactId>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <version>${version.io.quarkus}</version>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/bootstrap/DemoDataGenerator.java b/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/bootstrap/DemoDataGenerator.java
deleted file mode 100644
index 49f6683..0000000
--- a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/bootstrap/DemoDataGenerator.java
+++ /dev/null
@@ -1,205 +0,0 @@
-package org.acme.schooltimetabling.bootstrap;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicLong;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.enterprise.event.Observes;
-import jakarta.inject.Inject;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.acme.schooltimetabling.persistence.TimeTableRepository;
-import org.eclipse.microprofile.config.inject.ConfigProperty;
-
-import io.quarkus.runtime.LaunchMode;
-import io.quarkus.runtime.StartupEvent;
-
-@ApplicationScoped
-public class DemoDataGenerator {
-
- private static final AtomicLong idGenerator = new AtomicLong();
-
- @ConfigProperty(name = "timeTable.demoData", defaultValue = "SMALL")
- DemoData demoData;
-
- @Inject
- TimeTableRepository timeTableRepository;
-
- public void generateDemoData(@Observes StartupEvent startupEvent) {
- if (LaunchMode.current() == LaunchMode.TEST) {
- return;
- }
- if (demoData == DemoData.NONE) {
- return;
- }
-
- List<Timeslot> timeslotList = new ArrayList<>(10);
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(), DayOfWeek.MONDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(), DayOfWeek.MONDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.MONDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.MONDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.MONDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
-
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.TUESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- if (demoData == DemoData.LARGE) {
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.WEDNESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.THURSDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotList.add(new Timeslot(idGenerator.incrementAndGet(),DayOfWeek.FRIDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- }
-
- List<Room> roomList = new ArrayList<>(3);
- roomList.add(new Room(idGenerator.incrementAndGet(), "Room A"));
- roomList.add(new Room(idGenerator.incrementAndGet(), "Room B"));
- roomList.add(new Room(idGenerator.incrementAndGet(), "Room C"));
- if (demoData == DemoData.LARGE) {
- roomList.add(new Room(idGenerator.incrementAndGet(), "Room D"));
- roomList.add(new Room(idGenerator.incrementAndGet(), "Room E"));
- roomList.add(new Room(idGenerator.incrementAndGet(), "Room F"));
- }
-
- List<Lesson> lessonList = new ArrayList<>();
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "9th grade"));
- if (demoData == DemoData.LARGE) {
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "I. Jones", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "9th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "9th grade"));
- }
-
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "French", "M. Curie", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "10th grade"));
- if (demoData == DemoData.LARGE) {
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "I. Jones", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "10th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "10th grade"));
-
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "French", "M. Curie", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "P. Cruz", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "11th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "11th grade"));
-
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Math", "A. Turing", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "ICT", "A. Turing", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Chemistry", "M. Curie", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "French", "M. Curie", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physics", "M. Curie", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geography", "C. Darwin", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Biology", "C. Darwin", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Geology", "C. Darwin", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "History", "I. Jones", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "English", "P. Cruz", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Spanish", "P. Cruz", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Drama", "P. Cruz", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Art", "S. Dali", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "12th grade"));
- lessonList.add(new Lesson(idGenerator.incrementAndGet(), "Physical education", "C. Lewis", "12th grade"));
- }
-
- Lesson lesson = lessonList.get(0);
- lesson.setTimeslot(timeslotList.get(0));
- lesson.setRoom(roomList.get(0));
-
- TimeTable timeTable = new TimeTable(timeslotList, roomList, lessonList);
- timeTableRepository.update(timeTable);
- }
-
- public enum DemoData {
- NONE,
- SMALL,
- LARGE
- }
-
-}
diff --git a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java b/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java
deleted file mode 100644
index 3fd2314..0000000
--- a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.acme.schooltimetabling.persistence;
-
-import java.util.Objects;
-
-import jakarta.enterprise.context.ApplicationScoped;
-
-import org.acme.schooltimetabling.domain.TimeTable;
-
-@ApplicationScoped
-public class TimeTableRepository {
-
- private TimeTable timeTable;
-
- public TimeTable get() {
- return timeTable;
- }
-
- public void update(TimeTable timeTable) {
- this.timeTable = Objects.requireNonNull(timeTable);
- }
-}
diff --git a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/rest/TimeTableResource.java b/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/rest/TimeTableResource.java
deleted file mode 100644
index 5e3a2e8..0000000
--- a/technology/java-activemq-quarkus/client/src/main/java/org/acme/schooltimetabling/rest/TimeTableResource.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.acme.schooltimetabling.rest;
-
-import jakarta.inject.Inject;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.POST;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
-
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.message.SolverRequest;
-import org.acme.schooltimetabling.message.SolverResponse;
-import org.acme.schooltimetabling.persistence.TimeTableRepository;
-import org.eclipse.microprofile.reactive.messaging.Acknowledgment;
-import org.eclipse.microprofile.reactive.messaging.Channel;
-import org.eclipse.microprofile.reactive.messaging.Emitter;
-import org.eclipse.microprofile.reactive.messaging.Incoming;
-import org.optaplanner.core.api.solver.SolverStatus;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Path("timeTable")
-public class TimeTableResource {
-
- public static final Long SINGLETON_TIME_TABLE_ID = 1L;
-
- @Inject
- TimeTableRepository timeTableRepository;
-
- @Inject
- @Channel("solver_request")
- Emitter<String> solverRequestEmitter;
-
- @Inject
- ObjectMapper objectMapper;
-
- @Incoming("solver_response")
- @Acknowledgment(Acknowledgment.Strategy.POST_PROCESSING)
- public void process(String solverResponseMessage) {
- SolverResponse solverResponse;
- try {
- solverResponse = objectMapper.readValue(solverResponseMessage, SolverResponse.class);
- } catch (JsonProcessingException ex) {
- throw new IllegalStateException("Unable to deserialize the solver response.", ex);
- }
-
- if (solverResponse.isSuccess()) {
- TimeTable timeTable = solverResponse.getTimeTable();
- timeTable.setSolverStatus(SolverStatus.NOT_SOLVING);
- timeTableRepository.update(timeTable);
- } else {
- timeTableRepository.get().setSolverStatus(SolverStatus.NOT_SOLVING);
- throw new IllegalStateException("Solving failed with exception class ("
- + solverResponse.getErrorInfo().getExceptionClassName()
- + ") and message (" + solverResponse.getErrorInfo().getExceptionMessage() + ").");
- }
- }
-
- // To try, open http://localhost:8080/timeTable
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public TimeTable getTimeTable() {
- TimeTable timeTable = timeTableRepository.get();
- return timeTable;
- }
-
- @POST
- @Path("solve")
- public void solve() throws JsonProcessingException {
- TimeTable timeTable = timeTableRepository.get();
- timeTable.setSolverStatus(SolverStatus.SOLVING_SCHEDULED);
-
- SolverRequest solverRequest = new SolverRequest(SINGLETON_TIME_TABLE_ID, timeTable);
- String solverRequestJson = objectMapper.writeValueAsString(solverRequest);
- solverRequestEmitter.send(solverRequestJson);
- }
-}
diff --git a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/app.js b/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/app.js
deleted file mode 100644
index 856fcee..0000000
--- a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/app.js
+++ /dev/null
@@ -1,261 +0,0 @@
-var autoRefreshIntervalId = null;
-const dateTimeFormatter = JSJoda.DateTimeFormatter.ofPattern('HH:mm')
-
-function refreshTimeTable() {
- $.getJSON("/timeTable", function (timeTable) {
- refreshSolvingButtons(timeTable.solverStatus != null && timeTable.solverStatus !== "NOT_SOLVING");
- $("#score").text("Score: " + (timeTable.score == null ? "?" : timeTable.score));
-
- const timeTableByRoom = $("#timeTableByRoom");
- timeTableByRoom.children().remove();
- const timeTableByTeacher = $("#timeTableByTeacher");
- timeTableByTeacher.children().remove();
- const timeTableByStudentGroup = $("#timeTableByStudentGroup");
- timeTableByStudentGroup.children().remove();
- const unassignedLessons = $("#unassignedLessons");
- unassignedLessons.children().remove();
-
- const theadByRoom = $("<thead>").appendTo(timeTableByRoom);
- const headerRowByRoom = $("<tr>").appendTo(theadByRoom);
- headerRowByRoom.append($("<th>Timeslot</th>"));
- $.each(timeTable.roomList, (index, room) => {
- headerRowByRoom
- .append($("<th/>")
- .append($("<span/>").text(room.name))
- .append($(`<button type="button" class="ml-2 mb-1 btn btn-light btn-sm p-1"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteRoom(room))));
- });
- const theadByTeacher = $("<thead>").appendTo(timeTableByTeacher);
- const headerRowByTeacher = $("<tr>").appendTo(theadByTeacher);
- headerRowByTeacher.append($("<th>Timeslot</th>"));
- const teacherList = [...new Set(timeTable.lessonList.map(lesson => lesson.teacher))];
- $.each(teacherList, (index, teacher) => {
- headerRowByTeacher
- .append($("<th/>")
- .append($("<span/>").text(teacher)));
- });
- const theadByStudentGroup = $("<thead>").appendTo(timeTableByStudentGroup);
- const headerRowByStudentGroup = $("<tr>").appendTo(theadByStudentGroup);
- headerRowByStudentGroup.append($("<th>Timeslot</th>"));
- const studentGroupList = [...new Set(timeTable.lessonList.map(lesson => lesson.studentGroup))];
- $.each(studentGroupList, (index, studentGroup) => {
- headerRowByStudentGroup
- .append($("<th/>")
- .append($("<span/>").text(studentGroup)));
- });
-
- const tbodyByRoom = $("<tbody>").appendTo(timeTableByRoom);
- const tbodyByTeacher = $("<tbody>").appendTo(timeTableByTeacher);
- const tbodyByStudentGroup = $("<tbody>").appendTo(timeTableByStudentGroup);
-
- const LocalTime = JSJoda.LocalTime;
-
- $.each(timeTable.timeslotList, (index, timeslot) => {
- const rowByRoom = $("<tr>").appendTo(tbodyByRoom);
- rowByRoom
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)
- .append($(`<button type="button" class="ml-2 mb-1 btn btn-light btn-sm p-1"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteTimeslot(timeslot)))));
-
- const rowByTeacher = $("<tr>").appendTo(tbodyByTeacher);
- rowByTeacher
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)));
- $.each(timeTable.roomList, (index, room) => {
- rowByRoom.append($("<td/>").prop("id", `timeslot${timeslot.id}room${room.id}`));
- });
- const rowByStudentGroup = $("<tr>").appendTo(tbodyByStudentGroup);
- rowByStudentGroup
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)));
-
- $.each(teacherList, (index, teacher) => {
- rowByTeacher.append($("<td/>").prop("id", `timeslot${timeslot.id}teacher${convertToId(teacher)}`));
- });
-
- $.each(studentGroupList, (index, studentGroup) => {
- rowByStudentGroup.append($("<td/>").prop("id", `timeslot${timeslot.id}studentGroup${convertToId(studentGroup)}`));
- });
- });
-
- $.each(timeTable.lessonList, (index, lesson) => {
- const color = pickColor(lesson.subject);
- const lessonElementWithoutDelete = $(`<div class="card" style="background-color: ${color}"/>`)
- .append($(`<div class="card-body p-2"/>`)
- .append($(`<h5 class="card-title mb-1"/>`).text(lesson.subject))
- .append($(`<p class="card-text ml-2 mb-1"/>`)
- .append($(`<em/>`).text(`by ${lesson.teacher}`)))
- .append($(`<small class="ml-2 mt-1 card-text text-muted align-bottom float-right"/>`).text(lesson.id))
- .append($(`<p class="card-text ml-2"/>`).text(lesson.studentGroup)));
- const lessonElement = lessonElementWithoutDelete.clone();
- lessonElement.find(".card-body").prepend(
- $(`<button type="button" class="ml-2 btn btn-light btn-sm p-1 float-right"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteLesson(lesson))
- );
- if (lesson.timeslot == null || lesson.room == null) {
- unassignedLessons.append(lessonElement);
- } else {
- $(`#timeslot${lesson.timeslot.id}room${lesson.room.id}`).append(lessonElement);
- $(`#timeslot${lesson.timeslot.id}teacher${convertToId(lesson.teacher)}`).append(lessonElementWithoutDelete.clone());
- $(`#timeslot${lesson.timeslot.id}studentGroup${convertToId(lesson.studentGroup)}`).append(lessonElementWithoutDelete.clone());
- }
- });
- });
-}
-
-function convertToId(str) {
- // Base64 encoding without padding to avoid XSS
- return btoa(str).replace(/=/g, "");
-}
-
-function solve() {
- $.post("/timeTable/solve", function () {
- refreshSolvingButtons(true);
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Start solving failed.", xhr);
- });
-}
-
-function refreshSolvingButtons(solving) {
- if (solving) {
- $("#solveButton").hide();
- $("#solvingButton").show();
- if (autoRefreshIntervalId == null) {
- autoRefreshIntervalId = setInterval(refreshTimeTable, 2000);
- }
- } else {
- $("#solveButton").show();
- $("#solvingButton").hide();
- if (autoRefreshIntervalId != null) {
- clearInterval(autoRefreshIntervalId);
- autoRefreshIntervalId = null;
- }
- }
-}
-
-function showError(title, xhr) {
- const serverErrorMessage = !xhr.responseJSON ? `${xhr.status}: ${xhr.statusText}` : xhr.responseJSON.message;
- console.error(title + "\n" + serverErrorMessage);
- const notification = $(`<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" style="min-width: 30rem"/>`)
- .append($(`<div class="toast-header bg-danger">
- <strong class="mr-auto text-dark">Error</strong>
- <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>`))
- .append($(`<div class="toast-body"/>`)
- .append($(`<p/>`).text(title))
- .append($(`<pre/>`)
- .append($(`<code/>`).text(serverErrorMessage))
- )
- );
- $("#notificationPanel").append(notification);
- notification.toast({delay: 30000});
- notification.toast('show');
-}
-
-$(document).ready(function () {
- $.ajaxSetup({
- headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json'
- }
- });
- // Extend jQuery to support $.put() and $.delete()
- jQuery.each(["put", "delete"], function (i, method) {
- jQuery[method] = function (url, data, callback, type) {
- if (jQuery.isFunction(data)) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
- return jQuery.ajax({
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- });
- };
- });
-
- $("#refreshButton").click(function () {
- refreshTimeTable();
- });
- $("#solveButton").click(function () {
- solve();
- });
-
- refreshTimeTable();
-});
-
-// ****************************************************************************
-// TangoColorFactory
-// ****************************************************************************
-
-const SEQUENCE_1 = [0x8AE234, 0xFCE94F, 0x729FCF, 0xE9B96E, 0xAD7FA8];
-const SEQUENCE_2 = [0x73D216, 0xEDD400, 0x3465A4, 0xC17D11, 0x75507B];
-
-var colorMap = new Map;
-var nextColorCount = 0;
-
-function pickColor(object) {
- let color = colorMap[object];
- if (color !== undefined) {
- return color;
- }
- color = nextColor();
- colorMap[object] = color;
- return color;
-}
-
-function nextColor() {
- let color;
- let colorIndex = nextColorCount % SEQUENCE_1.length;
- let shadeIndex = Math.floor(nextColorCount / SEQUENCE_1.length);
- if (shadeIndex === 0) {
- color = SEQUENCE_1[colorIndex];
- } else if (shadeIndex === 1) {
- color = SEQUENCE_2[colorIndex];
- } else {
- shadeIndex -= 3;
- let floorColor = SEQUENCE_2[colorIndex];
- let ceilColor = SEQUENCE_1[colorIndex];
- let base = Math.floor((shadeIndex / 2) + 1);
- let divisor = 2;
- while (base >= divisor) {
- divisor *= 2;
- }
- base = (base * 2) - divisor + 1;
- let shadePercentage = base / divisor;
- color = buildPercentageColor(floorColor, ceilColor, shadePercentage);
- }
- nextColorCount++;
- return "#" + color.toString(16);
-}
-
-function buildPercentageColor(floorColor, ceilColor, shadePercentage) {
- let red = (floorColor & 0xFF0000) + Math.floor(shadePercentage * ((ceilColor & 0xFF0000) - (floorColor & 0xFF0000))) & 0xFF0000;
- let green = (floorColor & 0x00FF00) + Math.floor(shadePercentage * ((ceilColor & 0x00FF00) - (floorColor & 0x00FF00))) & 0x00FF00;
- let blue = (floorColor & 0x0000FF) + Math.floor(shadePercentage * ((ceilColor & 0x0000FF) - (floorColor & 0x0000FF))) & 0x0000FF;
- return red | green | blue;
-}
diff --git a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/index.html b/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/index.html
deleted file mode 100644
index cd74b08..0000000
--- a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/index.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<html lang="en">
-<head>
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
- <meta content="width=device-width, initial-scale=1" name="viewport">
- <title>School timetabling - OptaPlanner Quarkus</title>
- <link rel="stylesheet" href="/webjars/bootstrap/css/bootstrap.min.css" />
- <link rel="stylesheet" href="/webjars/font-awesome/css/all.css" />
-</head>
-<body>
-<div class="container">
- <nav class="navbar navbar-expand-lg navbar-light bg-light">
- <a class="navbar-brand" href="https://www.optaplanner.org">
- <img src="optaPlannerLogo200px.png" alt="OptaPlanner logo">
- </a>
- </nav>
- <div class="sticky-top d-flex justify-content-center align-items-center" aria-live="polite" aria-atomic="true">
- <div id="notificationPanel" style="position: absolute; top: .5rem;"></div>
- </div>
- <h1>High school time table solver</h1>
- <p>Generate the optimal schedule for your teachers and students.</p>
-
- <div class="mb-2">
- <button id="refreshButton" type="button" class="btn btn-secondary">
- <span class="fas fa-refresh"></span> Refresh
- </button>
- <button id="solveButton" type="button" class="btn btn-success">
- <span class="fas fa-play"></span> Solve
- </button>
- <button id="solvingButton" type="button" disabled="true" class="btn btn-secondary">
- <span class="fas fa-hourglass-half"></span> Solving...
- </button>
- <span id="score" class="score ml-2 align-middle font-weight-bold">Score: ?</span>
-
- <div class="float-right">
- <ul class="nav nav-pills" id="myTab" role="tablist">
- <li class="nav-item">
- <a class="nav-link active" id="byRoomTab" data-toggle="tab" href="#byRoomPanel" role="tab" aria-controls="byRoomPanel" aria-selected="true">By room</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="byTeacherTab" data-toggle="tab" href="#byTeacher" role="tab" aria-controls="byTeacher" aria-selected="false">By teacher</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="byStudentGroupTab" data-toggle="tab" href="#byStudentGroup" role="tab" aria-controls="byStudentGroup" aria-selected="false">By student group</a>
- </li>
- </ul>
- </div>
- </div>
- <div class="tab-content mb-4" id="myTabContent">
- <div class="tab-pane fade show active" id="byRoomPanel" role="tabpanel" aria-labelledby="byRoomTab">
- <table class="table table-borderless table-striped timeTableSolution" id="timeTableByRoom">
- <!-- Filled in by app.js -->
- </table>
- </div>
- <div class="tab-pane fade" id="byTeacher" role="tabpanel" aria-labelledby="byTeacherTab">
- <table class="table table-borderless table-striped timeTableSolution" id="timeTableByTeacher">
- <!-- Filled in by app.js -->
- </table>
- </div>
- <div class="tab-pane fade" id="byStudentGroup" role="tabpanel" aria-labelledby="byStudentGroupTab">
- <table class="table table-borderless table-striped timeTableSolution" id="timeTableByStudentGroup">
- <!-- Filled in by app.js -->
- </table>
- </div>
- </div>
-
- <h2>Unassigned lessons</h2>
- <div id="unassignedLessons" class="card-columns"></div>
-</div>
-
-<script src="/webjars/jquery/jquery.min.js"></script>
-<script src="/webjars/bootstrap/js/bootstrap.min.js"></script>
-<script src="/webjars/js-joda/dist/js-joda.min.js"></script>
-<script src="/app.js"></script>
-</body>
-</html>
diff --git a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/optaPlannerLogo200px.png b/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/optaPlannerLogo200px.png
deleted file mode 100644
index 63abac7..0000000
Binary files a/technology/java-activemq-quarkus/client/src/main/resources/META-INF/resources/optaPlannerLogo200px.png and /dev/null differ
diff --git a/technology/java-activemq-quarkus/client/src/main/resources/application.properties b/technology/java-activemq-quarkus/client/src/main/resources/application.properties
deleted file mode 100644
index fd661cf..0000000
--- a/technology/java-activemq-quarkus/client/src/main/resources/application.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-########################
-# General properties
-########################
-# Enable CORS for runQuickstartsFromSource.sh
-quarkus.http.cors=true
-# Allow all origins in dev-mode
-%dev.quarkus.http.cors.origins=/.*/
-
-########################
-# Demo properties
-########################
-
-# The demo dataset size: NONE, SMALL, LARGE
-# timeTable.demoData=LARGE
-
-########################
-# Messaging
-########################
-
-amqp-username=quarkus
-amqp-password=quarkus
-
-# Configure the Kafka sink to write to it
-mp.messaging.outgoing.solver_request.connector=smallrye-amqp
-mp.messaging.outgoing.solver_request.durable=true
-
-# Configure the Kafka source to read from it
-mp.messaging.incoming.solver_response.connector=smallrye-amqp
-mp.messaging.incoming.solver_response.durable=true
diff --git a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/ActiveMQTestResourceLifecycleManager.java b/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/ActiveMQTestResourceLifecycleManager.java
deleted file mode 100644
index abb0251..0000000
--- a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/ActiveMQTestResourceLifecycleManager.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.acme.schooltimetabling;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
-
-import io.smallrye.reactive.messaging.memory.InMemoryConnector;
-
-public class ActiveMQTestResourceLifecycleManager implements QuarkusTestResourceLifecycleManager {
-
- @Override
- public Map<String, String> start() {
- Map<String, String> env = new HashMap<>();
- Map<String, String> solverRequestSinkProperties = InMemoryConnector.switchOutgoingChannelsToInMemory("solver_request");
- Map<String, String> solverResponseSourceProperties =
- InMemoryConnector.switchIncomingChannelsToInMemory("solver_response");
- env.putAll(solverRequestSinkProperties);
- env.putAll(solverResponseSourceProperties);
- return env;
- }
-
- @Override
- public void stop() {
- InMemoryConnector.clear();
- }
-}
diff --git a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/TimeTableResourceTest.java b/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/TimeTableResourceTest.java
deleted file mode 100644
index a8a14d2..0000000
--- a/technology/java-activemq-quarkus/client/src/test/java/org/acme/schooltimetabling/TimeTableResourceTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.acme.schooltimetabling;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Awaitility.await;
-
-import java.time.DayOfWeek;
-import java.time.Duration;
-import java.time.LocalTime;
-import java.time.temporal.ChronoUnit;
-import java.util.Collections;
-import java.util.List;
-
-import io.smallrye.reactive.messaging.memory.InMemoryConnector;
-import jakarta.enterprise.inject.Any;
-import jakarta.inject.Inject;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.acme.schooltimetabling.message.SolverRequest;
-import org.acme.schooltimetabling.message.SolverResponse;
-import org.acme.schooltimetabling.persistence.TimeTableRepository;
-import org.acme.schooltimetabling.rest.TimeTableResource;
-import org.eclipse.microprofile.reactive.messaging.Message;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Timeout;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import io.quarkus.test.common.QuarkusTestResource;
-import io.quarkus.test.junit.QuarkusTest;
-import io.smallrye.reactive.messaging.memory.InMemorySink;
-import io.smallrye.reactive.messaging.memory.InMemorySource;
-
-@QuarkusTest
-@QuarkusTestResource(ActiveMQTestResourceLifecycleManager.class)
-public class TimeTableResourceTest {
-
- private static final Duration AWAIT_TIMEOUT = Duration.of(20L, ChronoUnit.SECONDS);
-
- @Inject
- @Any
- InMemoryConnector connector;
-
- @Inject
- TimeTableResource timeTableResource;
-
- @Inject
- TimeTableRepository timeTableRepository;
-
- @Inject
- ObjectMapper objectMapper;
-
- private InMemorySink<String> solverRequestSink;
- private InMemorySource<String> solverResponseSource;
-
- @BeforeEach
- void setupChannels() {
- solverRequestSink = connector.sink("solver_request");
- solverResponseSource = connector.source("solver_response");
- prepareTestTimeTable();
- }
-
- @Test
- @Timeout(60L)
- void solveAndRetrieve() throws JsonProcessingException {
- timeTableResource.solve();
-
- await()
- .timeout(AWAIT_TIMEOUT)
- .until(solverRequestSink::received, messages -> messages.size() == 1);
-
- Message<String> solverRequestMessage = solverRequestSink.received().get(0);
- SolverRequest solverRequest = objectMapper.readValue(solverRequestMessage.getPayload(), SolverRequest.class);
-
- // Assign one lesson to simulate solving.
- TimeTable requestTimeTable = solverRequest.getTimeTable();
- Lesson firstLesson = requestTimeTable.getLessonList().get(0);
- firstLesson.setRoom(requestTimeTable.getRoomList().get(0));
- firstLesson.setTimeslot(requestTimeTable.getTimeslotList().get(0));
-
- SolverResponse solverResponse = new SolverResponse(solverRequest.getProblemId(), requestTimeTable);
- solverResponseSource.send(objectMapper.writeValueAsString(solverResponse));
-
- // Wait until the client receives the message and saves the new timetable to a database.
- await()
- .timeout(AWAIT_TIMEOUT)
- .until(timeTableResource::getTimeTable, timeTable -> timeTable.getLessonList().get(0).getRoom() != null);
-
- Lesson solvedFirstLesson = timeTableResource.getTimeTable().getLessonList().get(0);
- assertThat(solvedFirstLesson.getRoom()).isNotNull();
- assertThat(solvedFirstLesson.getTimeslot()).isNotNull();
- }
-
- private void prepareTestTimeTable() {
- List<Room> rooms = Collections.singletonList(new Room(1L, "room-A"));
- List<Timeslot> timeslots =
- Collections.singletonList(new Timeslot(1L, DayOfWeek.WEDNESDAY, LocalTime.NOON, LocalTime.NOON));
- List<Lesson> lessons = Collections.singletonList(new Lesson(1L, "Physics", "M. Curie", "12th grade"));
- timeTableRepository.update(new TimeTable(timeslots, rooms, lessons));
- }
-}
diff --git a/technology/java-activemq-quarkus/common/.gitignore b/technology/java-activemq-quarkus/common/.gitignore
deleted file mode 100644
index 8edd787..0000000
--- a/technology/java-activemq-quarkus/common/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/java-activemq-quarkus/common/pom.xml b/technology/java-activemq-quarkus/common/pom.xml
deleted file mode 100644
index cb8c204..0000000
--- a/technology/java-activemq-quarkus/common/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>optaplanner-activemq-quarkus-school-timetabling</artifactId>
- <groupId>org.acme</groupId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>optaplanner-activemq-quarkus-school-timetabling-common</artifactId>
- <description>ActiveMQ Quarkus School Timetabling Quickstart : Common</description>
-
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.jandex</groupId>
- <artifactId>jandex-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>jandex</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Lesson.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Lesson.java
deleted file mode 100644
index ed94b56..0000000
--- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Lesson.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import org.optaplanner.core.api.domain.entity.PlanningEntity;
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-import org.optaplanner.core.api.domain.variable.PlanningVariable;
-
-@PlanningEntity
-public class Lesson {
-
- @PlanningId
- private Long id;
-
- private String subject;
- private String teacher;
- private String studentGroup;
-
- @PlanningVariable
- private Timeslot timeslot;
- @PlanningVariable
- private Room room;
-
- Lesson() {
- // Required for JSON deserialization.
- }
-
- public Lesson(Long id, String subject, String teacher, String studentGroup) {
- this.id = id;
- this.subject = subject;
- this.teacher = teacher;
- this.studentGroup = studentGroup;
- }
-
- public Lesson(long id, String subject, String teacher, String studentGroup, Timeslot timeslot, Room room) {
- this(id, subject, teacher, studentGroup);
- this.timeslot = timeslot;
- this.room = room;
- }
-
- @Override
- public String toString() {
- return subject + "(" + id + ")";
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public Long getId() {
- return id;
- }
-
- public String getSubject() {
- return subject;
- }
-
- public String getTeacher() {
- return teacher;
- }
-
- public String getStudentGroup() {
- return studentGroup;
- }
-
- public Timeslot getTimeslot() {
- return timeslot;
- }
-
- public void setTimeslot(Timeslot timeslot) {
- this.timeslot = timeslot;
- }
-
- public Room getRoom() {
- return room;
- }
-
- public void setRoom(Room room) {
- this.room = room;
- }
-
-}
diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Room.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Room.java
deleted file mode 100644
index a8edc94..0000000
--- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Room.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-
-public class Room {
-
- @PlanningId
- private Long id;
-
- private String name;
-
- Room() {
- // Required for JSON deserialization.
- }
-
- public Room(long id, String name) {
- this.name = name;
- this.id = id;
- }
-
- @Override
- public String toString() {
- return name;
- }
-
- // ************************************************************************
- // Getters
- // ************************************************************************
-
- public Long getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
-}
diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java
deleted file mode 100644
index af38f39..0000000
--- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import java.util.List;
-
-import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty;
-import org.optaplanner.core.api.domain.solution.PlanningScore;
-import org.optaplanner.core.api.domain.solution.PlanningSolution;
-import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty;
-import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.solver.SolverStatus;
-
-@PlanningSolution
-public class TimeTable {
-
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- private List<Timeslot> timeslotList;
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- private List<Room> roomList;
- @PlanningEntityCollectionProperty
- private List<Lesson> lessonList;
-
- @PlanningScore
- private HardSoftScore score;
-
- // Ignored by OptaPlanner, used by the UI to display solve or stop solving button.
- private SolverStatus solverStatus;
-
-
- public TimeTable() {
- // No-arg constructor required for OptaPlanner and for JSON deserialization.
- }
-
- public TimeTable(List<Timeslot> timeslotList, List<Room> roomList, List<Lesson> lessonList) {
- this.timeslotList = timeslotList;
- this.roomList = roomList;
- this.lessonList = lessonList;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public List<Timeslot> getTimeslotList() {
- return timeslotList;
- }
-
- public List<Room> getRoomList() {
- return roomList;
- }
-
- public List<Lesson> getLessonList() {
- return lessonList;
- }
-
- public HardSoftScore getScore() {
- return score;
- }
-
- public SolverStatus getSolverStatus() {
- return solverStatus;
- }
-
- public void setSolverStatus(SolverStatus solverStatus) {
- this.solverStatus = solverStatus;
- }
-}
diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java
deleted file mode 100644
index 11de408..0000000
--- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-
-public class Timeslot {
-
- @PlanningId
- private Long id;
-
- private DayOfWeek dayOfWeek;
- private LocalTime startTime;
- private LocalTime endTime;
-
- Timeslot() {
- // Required for JSON deserialization.
- }
-
- public Timeslot(long id, DayOfWeek dayOfWeek, LocalTime startTime, LocalTime endTime) {
- this.dayOfWeek = dayOfWeek;
- this.startTime = startTime;
- this.endTime = endTime;
- this.id = id;
- }
-
- public Timeslot(long id, DayOfWeek dayOfWeek, LocalTime startTime) {
- this(id, dayOfWeek, startTime, startTime.plusMinutes(50));
- }
-
- @Override
- public String toString() {
- return dayOfWeek + " " + startTime;
- }
-
- // ************************************************************************
- // Getters
- // ************************************************************************
-
- public Long getId() {
- return id;
- }
-
- public DayOfWeek getDayOfWeek() {
- return dayOfWeek;
- }
-
- public LocalTime getStartTime() {
- return startTime;
- }
-
- public LocalTime getEndTime() {
- return endTime;
- }
-
-}
diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverRequest.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverRequest.java
deleted file mode 100644
index 9a92e57..0000000
--- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverRequest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.acme.schooltimetabling.message;
-
-import org.acme.schooltimetabling.domain.TimeTable;
-
-import io.quarkus.runtime.annotations.RegisterForReflection;
-
-@RegisterForReflection
-public class SolverRequest {
- private Long problemId;
- private TimeTable timeTable;
-
- SolverRequest() {
- // Required for JSON deserialization.
- }
-
- public SolverRequest(Long problemId, TimeTable timeTable) {
- this.problemId = problemId;
- this.timeTable = timeTable;
- }
-
- public Long getProblemId() {
- return problemId;
- }
-
- public TimeTable getTimeTable() {
- return timeTable;
- }
-}
diff --git a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverResponse.java b/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverResponse.java
deleted file mode 100644
index ab233db..0000000
--- a/technology/java-activemq-quarkus/common/src/main/java/org/acme/schooltimetabling/message/SolverResponse.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.acme.schooltimetabling.message;
-
-import org.acme.schooltimetabling.domain.TimeTable;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-import io.quarkus.runtime.annotations.RegisterForReflection;
-
-@RegisterForReflection
-public class SolverResponse {
-
- private Long problemId;
- private TimeTable timeTable;
- private ResponseStatus responseStatus;
- private ErrorInfo errorInfo;
-
- SolverResponse() {
- // Required for JSON deserialization.
- }
-
- public SolverResponse(Long problemId, TimeTable timeTable) {
- this.problemId = problemId;
- this.timeTable = timeTable;
- this.responseStatus = ResponseStatus.SUCCESS;
- }
-
- public SolverResponse(Long problemId, ErrorInfo errorInfo) {
- this.problemId = problemId;
- this.errorInfo = errorInfo;
- this.responseStatus = ResponseStatus.FAILURE;
- }
-
- public Long getProblemId() {
- return problemId;
- }
-
- public TimeTable getTimeTable() {
- return timeTable;
- }
-
- public ErrorInfo getErrorInfo() {
- return errorInfo;
- }
-
- public ResponseStatus getResponseStatus() {
- return responseStatus;
- }
-
- @JsonIgnore
- public boolean isSuccess() {
- return ResponseStatus.SUCCESS == responseStatus;
- }
-
- public enum ResponseStatus {
- SUCCESS,
- FAILURE
- }
-
- public static class ErrorInfo {
- private String exceptionClassName;
- private String exceptionMessage;
-
- ErrorInfo() {
- // Required for JSON deserialization.
- }
-
- public ErrorInfo(String exceptionClassName, String exceptionMessage) {
- this.exceptionClassName = exceptionClassName;
- this.exceptionMessage = exceptionMessage;
- }
-
- public String getExceptionClassName() {
- return exceptionClassName;
- }
-
- public String getExceptionMessage() {
- return exceptionMessage;
- }
- }
-}
diff --git a/technology/java-activemq-quarkus/docker-compose.yml b/technology/java-activemq-quarkus/docker-compose.yml
deleted file mode 100644
index 3e9464d..0000000
--- a/technology/java-activemq-quarkus/docker-compose.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-# A docker compose file to start the ActiveMQ Artemis broker.
-# more details on https://github.com/vromero/activemq-artemis-docker.
-version: '2'
-
-services:
-
- artemis:
- image: quay.io/artemiscloud/activemq-artemis-broker:latest
- ports:
- - "8161:8161"
- - "61616:61616"
- - "5672:5672"
- volumes:
- - .:/var/lib/artemis/etc-override
- environment:
- AMQ_USER: quarkus
- AMQ_PASSWORD: quarkus
-
diff --git a/technology/java-activemq-quarkus/pom.xml b/technology/java-activemq-quarkus/pom.xml
deleted file mode 100644
index 820d6cc..0000000
--- a/technology/java-activemq-quarkus/pom.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.acme</groupId>
- <artifactId>optaplanner-activemq-quarkus-school-timetabling</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <properties>
- <version.org.apache.activemq>2.28.0</version.org.apache.activemq>
- <version.io.quarkus>3.0.0.Final</version.io.quarkus>
- <version.org.optaplanner>9.44.0.Final</version.org.optaplanner>
-
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <compiler-plugin.version>3.8.1</compiler-plugin.version>
- <maven.compiler.release>11</maven.compiler.release>
- <surefire-plugin.version>3.0.0-M8</surefire-plugin.version>
- </properties>
-
- <modules>
- <module>common</module>
- <module>client</module>
- <module>solver</module>
- </modules>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <!-- Alternatively, use <artifactId>quarkus-universe-bom</artifactId>
- which includes both quarkus-bom and optaplanner-bom. -->
- <artifactId>quarkus-bom</artifactId>
- <version>${version.io.quarkus}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-bom</artifactId>
- <version>${version.org.optaplanner}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>io.quarkiverse.artemis</groupId>
- <artifactId>quarkus-artemis-jms</artifactId>
- <version>3.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.acme</groupId>
- <artifactId>optaplanner-activemq-quarkus-school-timetabling-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-amqp-protocol</artifactId>
- <version>${version.org.apache.activemq}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-server</artifactId>
- <version>${version.org.apache.activemq}</version>
- </dependency>
- <dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <version>4.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>bootstrap</artifactId>
- <version>4.5.3</version>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- <version>3.5.1</version>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>font-awesome</artifactId>
- <version>5.15.1</version>
- </dependency>
- <dependency>
- <groupId>org.webjars.npm</groupId>
- <artifactId>js-joda</artifactId>
- <version>1.11.0</version>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <version>3.24.2</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${compiler-plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <version>${version.io.quarkus}</version>
- <executions>
- <execution>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.jboss.jandex</groupId>
- <artifactId>jandex-maven-plugin</artifactId>
- <version>1.0.8</version>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire-plugin.version}</version>
- <configuration>
- <systemPropertyVariables>
- <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <profiles>
- <profile>
- <id>native</id>
- <activation>
- <property>
- <name>native</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-failsafe-plugin</artifactId>
- <version>${surefire-plugin.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
- <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <properties>
- <quarkus.package.type>native</quarkus.package.type>
- <!-- To allow application.properties to avoid using the in-memory database for native builds. -->
- <quarkus.profile>native</quarkus.profile>
- </properties>
- </profile>
- </profiles>
-
-</project>
diff --git a/technology/java-activemq-quarkus/run.sh b/technology/java-activemq-quarkus/run.sh
deleted file mode 100755
index 803bf2d..0000000
--- a/technology/java-activemq-quarkus/run.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-
-trap ctrl_c INT
-
-function ctrl_c() {
- terminate "$PID_CLIENT" "$PID_SOLVER" "$PID_DOCKER_AMQ"
- exit 0
-}
-
-function terminate() {
- for pid in "$@"
- do
- echo "Stopping a process ($pid)"
- kill "$pid"
- done
-}
-
-function wait_for_url() {
- local _application_url=$1
- local _timeout_seconds=$2
- local _increment=1
-
- local _spent=0
- echo "Waiting up to ${_timeout_seconds} seconds for ${_application_url} to become available."
- while [[ "200" != $(curl -LI "${_application_url}" -o /dev/null -w '%{http_code}' -s) && ${_spent} -lt ${_timeout_seconds} ]]
- do
- sleep ${_increment}
- _spent=$((_spent + _increment))
- done
-}
-
-function check_directory_exists() {
- local _directory=$1
- local _hint=$2
- if [ ! -d "$_directory" ]; then
- echo "The directory $_directory does not exist. $_hint"
- exit 1
-fi
-}
-
-readonly solverModule=solver
-readonly clientModule=client
-
-check_directory_exists $solverModule/target "Maybe build the project by running \"mvn clean install\"."
-check_directory_exists $clientModule/target "Maybe build the project by running \"mvn clean install\"."
-
-if [ ! -d target ]; then
- mkdir target
-fi
-
-# Check if docker-compose is available.
-if ! docker-compose --version &> /dev/null ; then
- echo "docker-compose was not detected. Please make sure that docker-compose has been properly installed."
- exit 1
-fi
-
-# Run docker-compose to start ActiveMQ broker.
-docker-compose up > target/activemq.log 2>&1 &
-readonly PID_DOCKER_AMQ=$!
-echo "Running the ActiveMQ broker via docker."
-
-# Run the solver.
-mvn clean quarkus:dev -f $solverModule -Dquarkus.http.port="$SOLVER_PORT" -Ddebug=8180 > target/solver.log 2>&1 &
-readonly PID_SOLVER=$!
-echo "Running the solver."
-
-# Run the client.
-mvn clean quarkus:dev -f $clientModule > target/client.log 2>&1 &
-readonly PID_CLIENT=$!
-echo "Running the client."
-
-# Wait for the application to start up.
-readonly URL="http://localhost:8080"
-wait_for_url "$URL" 60
-echo "Application available at $URL"
-echo "Press [Ctrl+C] to exit."
-
-echo
-if [ "$1" = "-v" ]; then
- echo "--------------- SOLVER output ---------------"
- tail -f target/solver.log
-else
- echo "To display output of the solver, invoke this script with the '-v' option. Complete logs are available in the 'target' directory."
-fi
-wait
diff --git a/technology/java-activemq-quarkus/solver/.gitignore b/technology/java-activemq-quarkus/solver/.gitignore
deleted file mode 100644
index 8edd787..0000000
--- a/technology/java-activemq-quarkus/solver/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/java-activemq-quarkus/solver/pom.xml b/technology/java-activemq-quarkus/solver/pom.xml
deleted file mode 100644
index 277d0db..0000000
--- a/technology/java-activemq-quarkus/solver/pom.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>optaplanner-activemq-quarkus-school-timetabling</artifactId>
- <groupId>org.acme</groupId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>optaplanner-activemq-quarkus-school-timetabling-solver</artifactId>
- <description>ActiveMQ Quarkus School Timetabling Quickstart : Solver Server</description>
-
- <dependencies>
- <dependency>
- <groupId>org.acme</groupId>
- <artifactId>optaplanner-activemq-quarkus-school-timetabling-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus</artifactId>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus-jackson</artifactId>
- </dependency>
- <!-- Messaging -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-smallrye-reactive-messaging</artifactId>
- </dependency>
- <dependency>
- <groupId>io.smallrye.reactive</groupId>
- <artifactId>smallrye-reactive-messaging-amqp</artifactId>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-server</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.logmanager</groupId>
- <artifactId>jboss-logmanager</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-amqp-protocol</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.quarkiverse.artemis</groupId>
- <artifactId>quarkus-artemis-jms</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-test</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <version>${version.io.quarkus}</version>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/technology/java-activemq-quarkus/solver/src/main/docker/Dockerfile.jvm b/technology/java-activemq-quarkus/solver/src/main/docker/Dockerfile.jvm
deleted file mode 100644
index f3be2ad..0000000
--- a/technology/java-activemq-quarkus/solver/src/main/docker/Dockerfile.jvm
+++ /dev/null
@@ -1,59 +0,0 @@
-####
-# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
-#
-# Before building the docker image run:
-#
-# mvn package
-#
-# Then, build the image with:
-#
-# docker build -f src/main/docker/Dockerfile.jvm -t optaplanner/activemq-school-timetabling-jvm .
-#
-# Then run the container using:
-#
-# docker run -i --rm -p 8080:8080 optaplanner/activemq-school-timetabling-jvm
-#
-# If you want to include the debug port into your docker image
-# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050
-#
-# Then run the container using :
-#
-# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" optaplanner/activemq-school-timetabling-jvm
-#
-###
-FROM registry.access.redhat.com/ubi8/ubi-minimal
-
-ARG JAVA_PACKAGE=java-11-openjdk-headless
-ARG RUN_JAVA_VERSION=1.3.8
-
-ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
-
-# Install java and the run-java script
-# Also set up permissions for user `1001`
-RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
- && microdnf update \
- && microdnf clean all \
- && mkdir /deployments \
- && chown 1001 /deployments \
- && chmod "g+rwX" /deployments \
- && chown 1001:root /deployments \
- && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
- && chown 1001 /deployments/run-java.sh \
- && chmod 540 /deployments/run-java.sh \
- && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
-
-# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
-ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
-
-# We make four distinct layers so if there are application changes the library layers can be re-used
-COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/
-COPY --chown=1001 target/quarkus-app/*.jar /deployments/
-COPY --chown=1001 target/quarkus-app/app/ /deployments/app/
-COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/
-
-EXPOSE 8080
-
-# run with user 1001
-USER 1001
-
-ENTRYPOINT [ "/deployments/run-java.sh" ]
diff --git a/technology/java-activemq-quarkus/solver/src/main/docker/Dockerfile.native b/technology/java-activemq-quarkus/solver/src/main/docker/Dockerfile.native
deleted file mode 100644
index aa712b1..0000000
--- a/technology/java-activemq-quarkus/solver/src/main/docker/Dockerfile.native
+++ /dev/null
@@ -1,22 +0,0 @@
-####
-# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode
-#
-# Before building the docker image run:
-#
-# mvn package -Pnative -Dquarkus.native.container-build=true
-#
-# Then, build the image with:
-#
-# docker build -f src/main/docker/Dockerfile.native -t optaplanner/activemq-school-timetabling .
-#
-# Then run the container using:
-#
-# docker run -i --rm --network host optaplanner/activemq-school-timetabling
-#
-###
-FROM registry.access.redhat.com/ubi8/ubi-minimal
-WORKDIR /work/
-COPY target/*-runner /work/application
-RUN chmod 775 /work
-EXPOSE 8080
-CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
diff --git a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/messaging/TimeTableMessagingHandler.java b/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/messaging/TimeTableMessagingHandler.java
deleted file mode 100644
index 74c5aaa..0000000
--- a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/messaging/TimeTableMessagingHandler.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.acme.schooltimetabling.messaging;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-import java.util.function.Consumer;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.message.SolverRequest;
-import org.acme.schooltimetabling.message.SolverResponse;
-import org.eclipse.microprofile.reactive.messaging.Channel;
-import org.eclipse.microprofile.reactive.messaging.Emitter;
-import org.eclipse.microprofile.reactive.messaging.Incoming;
-import org.eclipse.microprofile.reactive.messaging.Message;
-import org.optaplanner.core.api.solver.Solver;
-import org.optaplanner.core.api.solver.SolverFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@ApplicationScoped
-public class TimeTableMessagingHandler {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(TimeTableMessagingHandler.class);
- public static final String SOLVER_REQUEST_CHANNEL = "solver_request";
- public static final String SOLVER_RESPONSE_CHANNEL = "solver_response";
-
- Solver<TimeTable> solver;
-
- @Inject
- ObjectMapper objectMapper;
-
- @Inject
- @Channel(SOLVER_RESPONSE_CHANNEL)
- Emitter<String> solverResponseEmitter;
-
- @Inject
- TimeTableMessagingHandler(SolverFactory<TimeTable> solverFactory) {
- solver = solverFactory.buildSolver();
- }
-
- @Incoming(SOLVER_REQUEST_CHANNEL)
- public CompletionStage<Void> solve(Message<String> solverRequestMessage) {
- return CompletableFuture.runAsync(() -> {
- SolverRequest solverRequest;
- try {
- solverRequest = objectMapper.readValue(solverRequestMessage.getPayload(), SolverRequest.class);
- } catch (Throwable throwable) {
- LOGGER.warn("Unable to deserialize solver request from JSON.", throwable);
- /* Usually a bad request, which should be immediately rejected. No error response can be sent back
- as the problemId is unknown. Such a NACKed message is redirected to the DLQ (Dead letter queue).
- Catching the Throwable to make sure no unchecked exceptions are missed. */
- solverRequestMessage.nack(throwable);
- return;
- }
-
- TimeTable solution;
- try {
- solution = solver.solve(solverRequest.getTimeTable());
- replySuccess(solverRequestMessage, solverRequest.getProblemId(), solution);
- } catch (Throwable throwable) {
- LOGGER.warn("Error during processing a solver request ({}).", solverRequest.getProblemId(), throwable);
- replyFailure(solverRequestMessage, solverRequest.getProblemId(), throwable);
- }
- });
- }
-
- private void replySuccess(Message<String> solverRequestMessage, Long problemId, TimeTable solution) {
- SolverResponse solverResponse = new SolverResponse(problemId, solution);
- reply(solverRequestMessage, solverResponse, exception -> replyFailure(solverRequestMessage, problemId, exception));
- }
-
- private void replyFailure(Message<String> solverRequestMessage, Long problemId, Throwable throwable) {
- SolverResponse solverResponse =
- new SolverResponse(problemId,
- new SolverResponse.ErrorInfo(throwable.getClass().getName(), throwable.getMessage()));
- reply(solverRequestMessage, solverResponse, serializationException -> {
- throw new IllegalStateException("Unable to serialize error response.", serializationException);
- });
- }
-
- private void reply(Message<String> solverRequestMessage, SolverResponse solverResponse,
- Consumer<? super Exception> onFailure) {
- try {
- String jsonResponse = objectMapper.writeValueAsString(solverResponse);
- solverResponseEmitter.send(jsonResponse).thenAccept(x -> solverRequestMessage.ack());
- } catch (JsonProcessingException ex) {
- onFailure.accept(ex);
- }
- }
-}
diff --git a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java b/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java
deleted file mode 100644
index f0d24df..0000000
--- a/technology/java-activemq-quarkus/solver/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.acme.schooltimetabling.solver;
-
-import java.time.Duration;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.score.stream.Constraint;
-import org.optaplanner.core.api.score.stream.ConstraintFactory;
-import org.optaplanner.core.api.score.stream.ConstraintProvider;
-import org.optaplanner.core.api.score.stream.Joiners;
-
-public class TimeTableConstraintProvider implements ConstraintProvider {
-
- @Override
- public Constraint[] defineConstraints(ConstraintFactory constraintFactory) {
- return new Constraint[] {
- // Hard constraints
- roomConflict(constraintFactory),
- teacherConflict(constraintFactory),
- studentGroupConflict(constraintFactory),
- // Soft constraints
- teacherRoomStability(constraintFactory),
- teacherTimeEfficiency(constraintFactory),
- studentGroupSubjectVariety(constraintFactory)
- };
- }
-
- Constraint roomConflict(ConstraintFactory constraintFactory) {
- // A room can accommodate at most one lesson at the same time.
- return constraintFactory
- // Select each pair of 2 different lessons ...
- .forEachUniquePair(Lesson.class,
- // ... in the same timeslot ...
- Joiners.equal(Lesson::getTimeslot),
- // ... in the same room ...
- Joiners.equal(Lesson::getRoom))
- // ... and penalize each pair with a hard weight.
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Room conflict");
- }
-
- Constraint teacherConflict(ConstraintFactory constraintFactory) {
- // A teacher can teach at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getTeacher))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Teacher conflict");
- }
-
- Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
- // A student can attend at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getStudentGroup))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Student group conflict");
- }
-
- Constraint teacherRoomStability(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach in a single room.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTeacher))
- .filter((lesson1, lesson2) -> lesson1.getRoom() != lesson2.getRoom())
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher room stability");
- }
-
- Constraint teacherTimeEfficiency(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach sequential lessons and dislikes gaps between lessons.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class, Joiners.equal(Lesson::getTeacher),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .reward(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher time efficiency");
- }
-
- Constraint studentGroupSubjectVariety(ConstraintFactory constraintFactory) {
- // A student group dislikes sequential lessons on the same subject.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class,
- Joiners.equal(Lesson::getSubject),
- Joiners.equal(Lesson::getStudentGroup),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Student group subject variety");
- }
-
-}
diff --git a/technology/java-activemq-quarkus/solver/src/main/resources/application.properties b/technology/java-activemq-quarkus/solver/src/main/resources/application.properties
deleted file mode 100644
index ef0e3be..0000000
--- a/technology/java-activemq-quarkus/solver/src/main/resources/application.properties
+++ /dev/null
@@ -1,45 +0,0 @@
-########################
-# OptaPlanner properties
-########################
-
-# The solver runs for 10 seconds. To run for 5 minutes use "5m" and for 2 hours use "2h".
-quarkus.optaplanner.solver.termination.spent-limit=10s
-
-# To change how many solvers to run in parallel
-# optaplanner.solver-manager.parallel-solver-count=4
-# To run increase CPU cores usage per solver
-# quarkus.optaplanner.solver.move-thread-count=2
-
-# Temporary comment this out to detect bugs in your code (lowers performance)
-# quarkus.optaplanner.solver.environment-mode=FULL_ASSERT
-# To see what OptaPlanner is doing, turn on DEBUG or TRACE logging.
-quarkus.log.category."org.optaplanner".level=DEBUG
-%test.quarkus.log.category."org.optaplanner".level=INFO
-%prod.quarkus.log.category."org.optaplanner".level=INFO
-
-# XML file for power tweaking, defaults to solverConfig.xml (directly under src/main/resources)
-# quarkus.optaplanner.solver-config-xml=org/.../timeTableSolverConfig.xml
-
-########################
-# Test overrides
-########################
-
-# Effectively disable spent-time termination in favor of the best-score-limit
-%test.quarkus.optaplanner.solver.termination.spent-limit=1h
-%test.quarkus.optaplanner.solver.termination.best-score-limit=0hard/*soft
-
-########################
-# Messaging
-########################
-
-amqp-username=quarkus
-amqp-password=quarkus
-
-# Configure the ActiveMQ source to read from it
-mp.messaging.incoming.solver_request.connector=smallrye-amqp
-mp.messaging.incoming.solver_request.durable=true
-mp.messaging.incoming.solver_request.failure-strategy=reject
-
-# Configure the ActiveMQ sink to write to it
-mp.messaging.outgoing.solver_response.connector=smallrye-amqp
-mp.messaging.outgoing.solver_response.durable=true
diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/ActiveMQEmbeddedBroker.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/ActiveMQEmbeddedBroker.java
deleted file mode 100644
index bcdca4b..0000000
--- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/ActiveMQEmbeddedBroker.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.acme.schooltimetabling;
-
-import static org.awaitility.Awaitility.await;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.artemis.core.security.CheckType;
-import org.apache.activemq.artemis.core.security.Role;
-import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
-
-import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
-
-public class ActiveMQEmbeddedBroker implements QuarkusTestResourceLifecycleManager {
-
- private final EmbeddedActiveMQ server = new EmbeddedActiveMQ();
-
- public Map<String, String> start() {
- try {
- server.setSecurityManager(new ActiveMQSecurityManager() {
- @Override
- public boolean validateUser(String user, String password) {
- return true;
- }
-
- @Override
- public boolean validateUserAndRole(String user, String password, Set<Role> roles, CheckType checkType) {
- return true;
- }
- });
- server.start();
- await().timeout(30, TimeUnit.SECONDS).until(() -> server.getActiveMQServer().isStarted());
- } catch (Exception e) {
- throw new IllegalStateException("Unable to start embedded ActiveMQ broker.", e);
- }
- return Collections.emptyMap();
- }
-
- public void stop() {
- try {
- if (server != null) {
- server.stop();
- }
- } catch (Exception e) {
- throw new IllegalStateException("Unable to stop embedded ActiveMQ broker.", e);
- }
- }
-
-}
diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerIT.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerIT.java
deleted file mode 100644
index c241782..0000000
--- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerIT.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.acme.schooltimetabling;
-
-import io.quarkus.test.junit.QuarkusIntegrationTest;
-import org.junit.jupiter.api.Disabled;
-
-@Disabled("The native test hangs after starting the native image and before entering the first test method.")
-@QuarkusIntegrationTest
-public class TimeTableMessagingHandlerIT extends TimeTableMessagingHandlerTest {
-
-}
diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerTest.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerTest.java
deleted file mode 100644
index 7db4099..0000000
--- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/TimeTableMessagingHandlerTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package org.acme.schooltimetabling;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import jakarta.jms.ConnectionFactory;
-import jakarta.jms.Destination;
-import jakarta.jms.JMSConsumer;
-import jakarta.jms.JMSContext;
-import jakarta.jms.JMSException;
-import jakarta.jms.JMSProducer;
-import jakarta.jms.Session;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.acme.schooltimetabling.message.SolverRequest;
-import org.acme.schooltimetabling.message.SolverResponse;
-import org.acme.schooltimetabling.messaging.TimeTableMessagingHandler;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Timeout;
-import org.optaplanner.persistence.jackson.api.OptaPlannerJacksonModule;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-
-import io.quarkus.test.common.QuarkusTestResource;
-import io.quarkus.test.junit.QuarkusTest;
-
-@QuarkusTest
-@QuarkusTestResource(ActiveMQEmbeddedBroker.class)
-public class TimeTableMessagingHandlerTest {
-
- private static final long TEST_TIMEOUT_SECONDS = 60L;
- private static final int MESSAGE_RECEIVE_TIMEOUT_SECONDS = 10;
-
- private ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
- // Native test does not support @Inject.
- private ObjectMapper objectMapper = new ObjectMapper()
- .registerModule(new JavaTimeModule())
- .registerModule(OptaPlannerJacksonModule.createModule());
-
- @Test
- @Timeout(TEST_TIMEOUT_SECONDS)
- void solve() {
- long problemId = 1L;
- TimeTable unsolvedTimeTable = createTestTimeTable();
- sendSolverRequest(new SolverRequest(problemId, unsolvedTimeTable));
- SolverResponse solverResponse = receiveSolverResponse(MESSAGE_RECEIVE_TIMEOUT_SECONDS);
-
- assertThat(SolverResponse.ResponseStatus.SUCCESS == solverResponse.getResponseStatus());
- assertThat(problemId == solverResponse.getProblemId());
- assertThat(solverResponse.getTimeTable().getLessonList()).hasSameSizeAs(unsolvedTimeTable.getLessonList());
- assertThat(solverResponse.getTimeTable().getScore().isFeasible()).isTrue();
- }
-
- @Test
- @Timeout(TEST_TIMEOUT_SECONDS)
- void solvingThrowsException() {
- long problemId = 10L;
-
- // OptaPlanner doesn't tolerate a null planningId.
- TimeTable timeTableWithIncorrectLesson = new TimeTable(
- Arrays.asList(new Timeslot(1L, DayOfWeek.MONDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30))),
- Arrays.asList(new Room(1L, "room-A")),
- Arrays.asList(new Lesson(null, "Math", "A. Touring", "10th grade")));
-
- sendSolverRequest(new SolverRequest(problemId, timeTableWithIncorrectLesson));
-
- SolverResponse solverResponse = receiveSolverResponse(MESSAGE_RECEIVE_TIMEOUT_SECONDS);
- assertThat(SolverResponse.ResponseStatus.FAILURE == solverResponse.getResponseStatus());
- assertThat(problemId == solverResponse.getProblemId());
- assertThat(solverResponse.getErrorInfo().getExceptionClassName()).isEqualTo(IllegalArgumentException.class.getName());
- assertThat(solverResponse.getErrorInfo().getExceptionMessage()).startsWith("The planningId (null)");
- }
-
- @Test
- @Timeout(TEST_TIMEOUT_SECONDS)
- void badRequest_DLQ() {
- final String wrongMessage = "Bad request!";
- sendMessage(wrongMessage);
- String messageFromDLQ = receiveMessage("DLQ", 10);
- assertThat(messageFromDLQ).isEqualTo(wrongMessage);
- }
-
- private SolverResponse receiveSolverResponse(int timeoutSeconds) {
- String solverResponsePayload = receiveMessage(TimeTableMessagingHandler.SOLVER_RESPONSE_CHANNEL, timeoutSeconds);
- try {
- return objectMapper.readValue(solverResponsePayload, SolverResponse.class);
- } catch (JsonProcessingException e) {
- throw new RuntimeException(e);
- }
-
- }
-
- private String receiveMessage(String queueName, int timeoutSeconds) {
- try (JMSContext context = connectionFactory.createContext("quarkus", "quarkus", Session.AUTO_ACKNOWLEDGE)) {
- JMSConsumer consumer = context.createConsumer(context.createQueue(queueName));
- jakarta.jms.Message message = consumer.receive(timeoutSeconds * 1_000);
- return message.getBody(String.class);
- } catch (JMSException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sendSolverRequest(SolverRequest solverRequest) {
- try {
- String message = objectMapper.writeValueAsString(solverRequest);
- sendMessage(message);
- } catch (JsonProcessingException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sendMessage(String message) {
- try (JMSContext context = connectionFactory.createContext("quarkus", "quarkus", Session.AUTO_ACKNOWLEDGE)) {
- JMSProducer producer = context.createProducer();
- Destination solverRequestQueue = context.createQueue(TimeTableMessagingHandler.SOLVER_REQUEST_CHANNEL);
- producer.send(solverRequestQueue, message);
- }
- }
-
- private TimeTable createTestTimeTable() {
- List<Room> rooms = Collections.singletonList(new Room(1L, "room-A"));
- List<Timeslot> timeslots = Arrays.asList(
- new Timeslot(1L, DayOfWeek.MONDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30)),
- new Timeslot(2L, DayOfWeek.TUESDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30)),
- new Timeslot(3L, DayOfWeek.WEDNESDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(30)));
- List<Lesson> lessons = Arrays.asList(
- new Lesson(1L, "Math", "A. Touring", "10th grade"),
- new Lesson(2L, "Biology", "C. Darwin", "11th grade"),
- new Lesson(3L, "Physics", "M. Curie", "12th grade"));
- return new TimeTable(timeslots, rooms, lessons);
- }
-}
diff --git a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java b/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java
deleted file mode 100644
index 0f081ba..0000000
--- a/technology/java-activemq-quarkus/solver/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.acme.schooltimetabling.solver;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import jakarta.inject.Inject;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.junit.jupiter.api.Test;
-import org.optaplanner.test.api.score.stream.ConstraintVerifier;
-
-import io.quarkus.test.junit.QuarkusTest;
-
-@QuarkusTest
-class TimeTableConstraintProviderTest {
-
- private static final Room ROOM1 = new Room(1, "Room1");
- private static final Room ROOM2 = new Room(2, "Room2");
- private static final Timeslot TIMESLOT1 = new Timeslot(1, DayOfWeek.MONDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT2 = new Timeslot(2, DayOfWeek.TUESDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT3 = new Timeslot(3, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(1));
- private static final Timeslot TIMESLOT4 = new Timeslot(4, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(3));
-
- @Inject
- ConstraintVerifier<TimeTableConstraintProvider, TimeTable> constraintVerifier;
-
- @Test
- void roomConflict() {
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", "Group2", TIMESLOT1, ROOM1);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::roomConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherConflict() {
- String conflictingTeacher = "Teacher1";
- Lesson firstLesson = new Lesson(1, "Subject1", conflictingTeacher, "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", conflictingTeacher, "Group2", TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher2", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void studentGroupConflict() {
- String conflictingGroup = "Group1";
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", conflictingGroup, TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", conflictingGroup, TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherRoomStability() {
- String teacher = "Teacher1";
- Lesson lessonInFirstRoom = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson lessonInSameRoom = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT1, ROOM1);
- Lesson lessonInDifferentRoom = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT1, ROOM2);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherRoomStability)
- .given(lessonInFirstRoom, lessonInDifferentRoom, lessonInSameRoom)
- .penalizesBy(2);
- }
-
- @Test
- void teacherTimeEfficiency() {
- String teacher = "Teacher1";
- Lesson singleLessonOnMonday = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithGap = new Lesson(4, "Subject4", teacher, "Group4", TIMESLOT4, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherTimeEfficiency)
- .given(singleLessonOnMonday, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithGap)
- .rewardsWith(1); // Second tuesday lesson immediately follows the first.
- }
-
- @Test
- void studentGroupSubjectVariety() {
- String studentGroup = "Group1";
- String repeatedSubject = "Subject1";
- Lesson mondayLesson = new Lesson(1, repeatedSubject, "Teacher1", studentGroup, TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, repeatedSubject, "Teacher2", studentGroup, TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, repeatedSubject, "Teacher3", studentGroup, TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithDifferentSubject = new Lesson(4, "Subject2", "Teacher4", studentGroup, TIMESLOT4, ROOM1);
- Lesson lessonInAnotherGroup = new Lesson(5, repeatedSubject, "Teacher5", "Group2", TIMESLOT1, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupSubjectVariety)
- .given(mondayLesson, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithDifferentSubject,
- lessonInAnotherGroup)
- .penalizesBy(1); // Second tuesday lesson immediately follows the first.
- }
-
-}
diff --git a/technology/java-activemq-quarkus/solver/src/test/resources/application.properties b/technology/java-activemq-quarkus/solver/src/test/resources/application.properties
deleted file mode 100644
index 444cdde..0000000
--- a/technology/java-activemq-quarkus/solver/src/test/resources/application.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-########################
-# OptaPlanner properties
-########################
-
-%test.quarkus.optaplanner.solver.termination.spent-limit=1h
-%test.quarkus.optaplanner.solver.termination.best-score-limit=0hard/*soft
-
-########################
-# Messaging
-########################
-
-quarkus.artemis.url=tcp://localhost:61616
-
-# Configure the ActiveMQ source (we read from it)
-mp.messaging.incoming.solver_request.connector=smallrye-amqp
-mp.messaging.incoming.solver_request.durable=true
-mp.messaging.incoming.solver_request.failure-strategy=reject
-
-# Configure the ActiveMQ sink (we write to it)
-mp.messaging.outgoing.solver_response.connector=smallrye-amqp
-mp.messaging.outgoing.solver_response.durable=true
\ No newline at end of file
diff --git a/technology/java-activemq-quarkus/solver/src/test/resources/broker.xml b/technology/java-activemq-quarkus/solver/src/test/resources/broker.xml
deleted file mode 100644
index 034d080..0000000
--- a/technology/java-activemq-quarkus/solver/src/test/resources/broker.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version='1.0'?>
-<configuration xmlns="urn:activemq"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
-
- <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:activemq:core ">
-
- <name>0.0.0.0</name>
-
- <persistence-enabled>false</persistence-enabled>
- <journal-type>NIO</journal-type>
- <paging-directory>target/data/paging</paging-directory>
- <bindings-directory>target/data/bindings</bindings-directory>
- <journal-directory>target/data/journal</journal-directory>
- <large-messages-directory>target/data/large-messages</large-messages-directory>
- <journal-datasync>true</journal-datasync>
- <journal-min-files>2</journal-min-files>
- <journal-pool-files>10</journal-pool-files>
- <journal-device-block-size>4096</journal-device-block-size>
- <journal-file-size>10M</journal-file-size>
- <journal-buffer-timeout>48000</journal-buffer-timeout>
- <journal-max-io>1</journal-max-io>
-
- <disk-scan-period>5000</disk-scan-period>
- <max-disk-usage>99</max-disk-usage>
- <critical-analyzer>false</critical-analyzer>
- <critical-analyzer-timeout>120000</critical-analyzer-timeout>
- <critical-analyzer-check-period>60000</critical-analyzer-check-period>
- <critical-analyzer-policy>HALT</critical-analyzer-policy>
- <page-sync-timeout>48000</page-sync-timeout>
-
- <acceptors>
- <!-- Acceptor for every supported protocol -->
- <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true</acceptor>
-
- <!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
- <acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true</acceptor>
- </acceptors>
-
- <security-settings>
- <security-setting match="#">
- <permission type="createNonDurableQueue" roles="amq"/>
- <permission type="deleteNonDurableQueue" roles="amq"/>
- <permission type="createDurableQueue" roles="amq"/>
- <permission type="deleteDurableQueue" roles="amq"/>
- <permission type="createAddress" roles="amq"/>
- <permission type="deleteAddress" roles="amq"/>
- <permission type="consume" roles="amq"/>
- <permission type="browse" roles="amq"/>
- <permission type="send" roles="amq"/>
- <!-- we need this otherwise ./artemis data imp wouldn't work -->
- <permission type="manage" roles="amq"/>
- </security-setting>
- </security-settings>
-
- <address-settings>
- <!-- if you define auto-create on certain queues, management has to be auto-create -->
- <address-setting match="activemq.management#">
- <dead-letter-address>DLQ</dead-letter-address>
- <expiry-address>ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
- <!-- with -1 only the global-max-size is in use for limiting -->
- <max-size-bytes>-1</max-size-bytes>
- <message-counter-history-day-limit>10</message-counter-history-day-limit>
- <address-full-policy>PAGE</address-full-policy>
- <auto-create-queues>true</auto-create-queues>
- <auto-create-addresses>true</auto-create-addresses>
- <auto-create-jms-queues>true</auto-create-jms-queues>
- <auto-create-jms-topics>true</auto-create-jms-topics>
- </address-setting>
- <!--default for catch all-->
- <address-setting match="#">
- <dead-letter-address>DLQ</dead-letter-address>
- <expiry-address>ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
- <!-- with -1 only the global-max-size is in use for limiting -->
- <max-size-bytes>-1</max-size-bytes>
- <message-counter-history-day-limit>10</message-counter-history-day-limit>
- <address-full-policy>PAGE</address-full-policy>
- <auto-create-queues>true</auto-create-queues>
- <auto-create-addresses>true</auto-create-addresses>
- <auto-create-jms-queues>true</auto-create-jms-queues>
- <auto-create-jms-topics>true</auto-create-jms-topics>
- </address-setting>
- </address-settings>
-
- <addresses>
- <address name="DLQ">
- <anycast>
- <queue name="DLQ"/>
- </anycast>
- </address>
- <address name="ExpiryQueue">
- <anycast>
- <queue name="ExpiryQueue"/>
- </anycast>
- </address>
- <address name="solver_request">
- <anycast>
- <queue name="solver_request">
- <durable>true</durable>
- </queue>
- </anycast>
- </address>
- <address name="solver_response">
- <anycast>
- <queue name="solver_response">
- <durable>true</durable>
- </queue>
- </anycast>
- </address>
-
- </addresses>
- </core>
-</configuration>
diff --git a/technology/java-quarkus/README.adoc b/technology/java-quarkus/README.adoc
deleted file mode 100644
index 8593d0e..0000000
--- a/technology/java-quarkus/README.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= School Timetabling (Java, Quarkus, Maven or Gradle)
-
-All quickstarts in the `use-cases` directory use Quarkus.
-
-link:../../use-cases/school-timetabling/[Take a look at the Quarkus School Timetabling quickstart.]
diff --git a/technology/java-spring-boot/.gitignore b/technology/java-spring-boot/.gitignore
deleted file mode 100644
index 0fc97d4..0000000
--- a/technology/java-spring-boot/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.mvn
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/java-spring-boot/README.adoc b/technology/java-spring-boot/README.adoc
deleted file mode 100644
index ae342bf..0000000
--- a/technology/java-spring-boot/README.adoc
+++ /dev/null
@@ -1,84 +0,0 @@
-= School Timetabling (Java, Spring Boot, Maven or Gradle)
-
-Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.
-
-image::../../build/quickstarts-showcase/src/main/resources/META-INF/resources/screenshot/quarkus-school-timetabling-screenshot.png[]
-
-* <<run,Run the application>>
-
-[[run]]
-== Run the application
-
-. Git clone the optaplanner-quickstarts repo and navigate to this directory:
-+
-[source, shell]
-----
-$ git clone https://github.com/kiegroup/optaplanner-quickstarts.git
-...
-$ cd optaplanner-quickstarts/technology/java-spring-boot
-----
-
-. Start the application with Maven:
-+
-[source, shell]
-----
-$ mvn spring-boot:run
-----
-+
-or with Gradle:
-+
-[source, shell]
-----
-$ gradle bootRun
-----
-
-. Visit http://localhost:8080 in your browser.
-
-. Click on the *Solve* button.
-
-[[package]]
-== Run the packaged application
-
-When you're ready to deploy the application,
-package the project to run as a conventional jar file.
-
-. Build it with Maven:
-+
-[source, shell]
-----
-$ mvn package
-----
-+
-or with Gradle:
-+
-[source, shell]
-----
-$ gradle clean build
-----
-
-. Run the Maven output:
-+
-[source, shell]
-----
-$ java -jar target/optaplanner-spring-boot-school-timetabling-quickstart-1.0-SNAPSHOT.jar
-----
-+
-or the Gradle output:
-+
-[source, shell]
-----
-$ java -jar build/libs/optaplanner-spring-boot-school-timetabling-quickstart-1.0-SNAPSHOT.jar
-----
-+
-[NOTE]
-====
-To run it on port 8081 instead, add `-Dserver.port=8081`.
-====
-
-. Visit http://localhost:8080 in your browser.
-
-. Click on the *Solve* button.
-
-== More information
-
-Visit https://www.optaplanner.org/[www.optaplanner.org].
diff --git a/technology/java-spring-boot/build.gradle b/technology/java-spring-boot/build.gradle
deleted file mode 100644
index 5d640a9..0000000
--- a/technology/java-spring-boot/build.gradle
+++ /dev/null
@@ -1,47 +0,0 @@
-plugins {
- id "org.springframework.boot" version "3.0.7"
- id "io.spring.dependency-management" version "1.0.11.RELEASE"
- id "java"
-}
-
-def optaplannerVersion = "9.44.0.Final"
-def assertjVersion = "3.24.2"
-
-group = "org.acme"
-archivesBaseName = "optaplanner-spring-boot-school-timetabling-quickstart"
-version = "1.0-SNAPSHOT"
-sourceCompatibility = "17"
-
-repositories {
- mavenCentral()
- mavenLocal()
-}
-
-dependencies {
- implementation "org.springframework.boot:spring-boot-starter-web"
- implementation "org.springframework.boot:spring-boot-starter-data-rest"
- implementation "org.springframework.boot:spring-boot-starter-data-jpa"
- testImplementation("org.springframework.boot:spring-boot-starter-test")
- testImplementation "io.rest-assured:rest-assured"
- testImplementation "org.awaitility:awaitility"
-
- implementation platform("org.optaplanner:optaplanner-bom:${optaplannerVersion}")
- implementation "org.optaplanner:optaplanner-spring-boot-starter"
- testImplementation("org.optaplanner:optaplanner-test")
- testImplementation("org.optaplanner:optaplanner-benchmark")
- testImplementation "org.assertj:assertj-core:${assertjVersion}"
-
- runtimeOnly "com.h2database:h2"
- runtimeOnly "org.webjars:webjars-locator:0.37"
- runtimeOnly "org.webjars:bootstrap:4.3.1"
- runtimeOnly "org.webjars:font-awesome:5.11.2"
- runtimeOnly "org.webjars.npm:js-joda:1.11.0"
-}
-
-test {
- useJUnitPlatform()
- // Log the test execution results.
- testLogging {
- events "passed", "skipped", "failed"
- }
-}
diff --git a/technology/java-spring-boot/pom.xml b/technology/java-spring-boot/pom.xml
deleted file mode 100644
index d4cc666..0000000
--- a/technology/java-spring-boot/pom.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?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">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.acme</groupId>
- <artifactId>optaplanner-spring-boot-school-timetabling-quickstart</artifactId>
- <version>1.0-SNAPSHOT</version>
-
- <properties>
- <maven.compiler.release>17</maven.compiler.release>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
- <version.org.optaplanner>9.44.0.Final</version.org.optaplanner>
- <version.org.springframework.boot>3.0.7</version.org.springframework.boot>
-
- <version.compiler.plugin>3.8.1</version.compiler.plugin>
- <version.surefire.plugin>3.0.0-M8</version.surefire.plugin>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-dependencies</artifactId>
- <version>${version.org.springframework.boot}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-bom</artifactId>
- <version>${version.org.optaplanner}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-rest</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-spring-boot-starter</artifactId>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-benchmark</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-test</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>
-
- <!-- UI -->
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>webjars-locator</artifactId>
- <version>0.37</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>bootstrap</artifactId>
- <version>4.5.3</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- <version>3.5.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>font-awesome</artifactId>
- <version>5.15.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars.npm</groupId>
- <artifactId>js-joda</artifactId>
- <version>1.11.0</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${version.compiler.plugin}</version>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${version.surefire.plugin}</version>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>${version.org.springframework.boot}</version>
- <executions>
- <!-- Repackage the archive produced by maven-jar-plugin into an executable JAR file. -->
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/TimeTableSpringBootApp.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/TimeTableSpringBootApp.java
deleted file mode 100644
index 8f751b7..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/TimeTableSpringBootApp.java
+++ /dev/null
@@ -1,198 +0,0 @@
-package org.acme.schooltimetabling;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.acme.schooltimetabling.persistence.LessonRepository;
-import org.acme.schooltimetabling.persistence.RoomRepository;
-import org.acme.schooltimetabling.persistence.TimeslotRepository;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.data.domain.Sort;
-
-@SpringBootApplication
-public class TimeTableSpringBootApp {
-
- public static void main(String[] args) {
- SpringApplication.run(TimeTableSpringBootApp.class, args);
- }
-
- @Value("${timeTable.demoData:SMALL}")
- private DemoData demoData;
-
- @Bean
- public CommandLineRunner demoData(
- TimeslotRepository timeslotRepository,
- RoomRepository roomRepository,
- LessonRepository lessonRepository) {
- return (args) -> {
- if (demoData == DemoData.NONE) {
- return;
- }
-
- timeslotRepository.save(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.MONDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.TUESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- if (demoData == DemoData.LARGE) {
- timeslotRepository.save(new Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.THURSDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.THURSDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.THURSDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.THURSDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.THURSDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.FRIDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.FRIDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.FRIDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.FRIDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)));
- timeslotRepository.save(new Timeslot(DayOfWeek.FRIDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)));
- }
-
- roomRepository.save(new Room("Room A"));
- roomRepository.save(new Room("Room B"));
- roomRepository.save(new Room("Room C"));
- if (demoData == DemoData.LARGE) {
- roomRepository.save(new Room("Room D"));
- roomRepository.save(new Room("Room E"));
- roomRepository.save(new Room("Room F"));
- }
-
- lessonRepository.save(new Lesson("Math", "A. Turing", "9th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "9th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "9th grade"));
- lessonRepository.save(new Lesson("Chemistry", "M. Curie", "9th grade"));
- lessonRepository.save(new Lesson("Biology", "C. Darwin", "9th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "9th grade"));
- lessonRepository.save(new Lesson("English", "I. Jones", "9th grade"));
- lessonRepository.save(new Lesson("English", "I. Jones", "9th grade"));
- lessonRepository.save(new Lesson("Spanish", "P. Cruz", "9th grade"));
- lessonRepository.save(new Lesson("Spanish", "P. Cruz", "9th grade"));
- if (demoData == DemoData.LARGE) {
- lessonRepository.save(new Lesson("Math", "A. Turing", "9th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "9th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "9th grade"));
- lessonRepository.save(new Lesson("ICT", "A. Turing", "9th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "9th grade"));
- lessonRepository.save(new Lesson("Geography", "C. Darwin", "9th grade"));
- lessonRepository.save(new Lesson("Geology", "C. Darwin", "9th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "9th grade"));
- lessonRepository.save(new Lesson("English", "I. Jones", "9th grade"));
- lessonRepository.save(new Lesson("Drama", "I. Jones", "9th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "9th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "9th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "9th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "9th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "9th grade"));
- }
-
- lessonRepository.save(new Lesson("Math", "A. Turing", "10th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "10th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "10th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "10th grade"));
- lessonRepository.save(new Lesson("Chemistry", "M. Curie", "10th grade"));
- lessonRepository.save(new Lesson("French", "M. Curie", "10th grade"));
- lessonRepository.save(new Lesson("Geography", "C. Darwin", "10th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "10th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "10th grade"));
- lessonRepository.save(new Lesson("Spanish", "P. Cruz", "10th grade"));
- if (demoData == DemoData.LARGE) {
- lessonRepository.save(new Lesson("Math", "A. Turing", "10th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "10th grade"));
- lessonRepository.save(new Lesson("ICT", "A. Turing", "10th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "10th grade"));
- lessonRepository.save(new Lesson("Biology", "C. Darwin", "10th grade"));
- lessonRepository.save(new Lesson("Geology", "C. Darwin", "10th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "10th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "10th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "10th grade"));
- lessonRepository.save(new Lesson("Drama", "I. Jones", "10th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "10th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "10th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "10th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "10th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "10th grade"));
-
- lessonRepository.save(new Lesson("Math", "A. Turing", "11th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "11th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "11th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "11th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "11th grade"));
- lessonRepository.save(new Lesson("ICT", "A. Turing", "11th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "11th grade"));
- lessonRepository.save(new Lesson("Chemistry", "M. Curie", "11th grade"));
- lessonRepository.save(new Lesson("French", "M. Curie", "11th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "11th grade"));
- lessonRepository.save(new Lesson("Geography", "C. Darwin", "11th grade"));
- lessonRepository.save(new Lesson("Biology", "C. Darwin", "11th grade"));
- lessonRepository.save(new Lesson("Geology", "C. Darwin", "11th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "11th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "11th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "11th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "11th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "11th grade"));
- lessonRepository.save(new Lesson("Spanish", "P. Cruz", "11th grade"));
- lessonRepository.save(new Lesson("Drama", "P. Cruz", "11th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "11th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "11th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "11th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "11th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "11th grade"));
-
- lessonRepository.save(new Lesson("Math", "A. Turing", "12th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "12th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "12th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "12th grade"));
- lessonRepository.save(new Lesson("Math", "A. Turing", "12th grade"));
- lessonRepository.save(new Lesson("ICT", "A. Turing", "12th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "12th grade"));
- lessonRepository.save(new Lesson("Chemistry", "M. Curie", "12th grade"));
- lessonRepository.save(new Lesson("French", "M. Curie", "12th grade"));
- lessonRepository.save(new Lesson("Physics", "M. Curie", "12th grade"));
- lessonRepository.save(new Lesson("Geography", "C. Darwin", "12th grade"));
- lessonRepository.save(new Lesson("Biology", "C. Darwin", "12th grade"));
- lessonRepository.save(new Lesson("Geology", "C. Darwin", "12th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "12th grade"));
- lessonRepository.save(new Lesson("History", "I. Jones", "12th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "12th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "12th grade"));
- lessonRepository.save(new Lesson("English", "P. Cruz", "12th grade"));
- lessonRepository.save(new Lesson("Spanish", "P. Cruz", "12th grade"));
- lessonRepository.save(new Lesson("Drama", "P. Cruz", "12th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "12th grade"));
- lessonRepository.save(new Lesson("Art", "S. Dali", "12th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "12th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "12th grade"));
- lessonRepository.save(new Lesson("Physical education", "C. Lewis", "12th grade"));
- }
-
- Lesson lesson = lessonRepository.findAll(Sort.by("id")).iterator().next();
- lesson.setTimeslot(timeslotRepository.findAll(Sort.by("id")).iterator().next());
- lesson.setRoom(roomRepository.findAll(Sort.by("id")).iterator().next());
-
- lessonRepository.save(lesson);
- };
- }
-
- public enum DemoData {
- NONE,
- SMALL,
- LARGE
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Lesson.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Lesson.java
deleted file mode 100644
index b9f6e08..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Lesson.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.GeneratedValue;
-import jakarta.persistence.Id;
-import jakarta.persistence.ManyToOne;
-
-import org.optaplanner.core.api.domain.entity.PlanningEntity;
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-import org.optaplanner.core.api.domain.variable.PlanningVariable;
-
-@PlanningEntity
-@Entity
-public class Lesson {
-
- @PlanningId
- @Id @GeneratedValue
- private Long id;
-
- private String subject;
- private String teacher;
- private String studentGroup;
-
- @PlanningVariable
- @ManyToOne
- private Timeslot timeslot;
-
- @PlanningVariable
- @ManyToOne
- private Room room;
-
- // No-arg constructor required for Hibernate and OptaPlanner
- public Lesson() {
- }
-
- public Lesson(String subject, String teacher, String studentGroup) {
- this.subject = subject;
- this.teacher = teacher;
- this.studentGroup = studentGroup;
- }
-
- public Lesson(long id, String subject, String teacher, String studentGroup, Timeslot timeslot, Room room) {
- this(subject, teacher, studentGroup);
- this.id = id;
- this.timeslot = timeslot;
- this.room = room;
- }
-
- @Override
- public String toString() {
- return subject + "(" + id + ")";
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public Long getId() {
- return id;
- }
-
- public String getSubject() {
- return subject;
- }
-
- public String getTeacher() {
- return teacher;
- }
-
- public String getStudentGroup() {
- return studentGroup;
- }
-
- public Timeslot getTimeslot() {
- return timeslot;
- }
-
- public void setTimeslot(Timeslot timeslot) {
- this.timeslot = timeslot;
- }
-
- public Room getRoom() {
- return room;
- }
-
- public void setRoom(Room room) {
- this.room = room;
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Room.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Room.java
deleted file mode 100644
index 7ba07a5..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Room.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.GeneratedValue;
-import jakarta.persistence.Id;
-
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-
-@Entity
-public class Room {
-
- @PlanningId
- @Id @GeneratedValue
- private Long id;
-
- private String name;
-
- // No-arg constructor required for Hibernate
- public Room() {
- }
-
- public Room(String name) {
- this.name = name;
- }
-
- public Room(long id, String name) {
- this(name);
- this.id = id;
- }
-
- @Override
- public String toString() {
- return name;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public Long getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java
deleted file mode 100644
index 6add628..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/TimeTable.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import java.util.List;
-
-import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty;
-import org.optaplanner.core.api.domain.solution.PlanningScore;
-import org.optaplanner.core.api.domain.solution.PlanningSolution;
-import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty;
-import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.solver.SolverStatus;
-
-@PlanningSolution
-public class TimeTable {
-
- @ValueRangeProvider
- @ProblemFactCollectionProperty
- private List<Timeslot> timeslotList;
-
- @ValueRangeProvider
- @ProblemFactCollectionProperty
- private List<Room> roomList;
-
- @PlanningEntityCollectionProperty
- private List<Lesson> lessonList;
-
- @PlanningScore
- private HardSoftScore score;
-
- // Ignored by OptaPlanner, used by the UI to display solve or stop solving button
- private SolverStatus solverStatus;
-
- // No-arg constructor required for OptaPlanner
- public TimeTable() {
- }
-
- public TimeTable(List<Timeslot> timeslotList, List<Room> roomList,
- List<Lesson> lessonList) {
- this.timeslotList = timeslotList;
- this.roomList = roomList;
- this.lessonList = lessonList;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public List<Timeslot> getTimeslotList() {
- return timeslotList;
- }
-
- public List<Room> getRoomList() {
- return roomList;
- }
-
- public List<Lesson> getLessonList() {
- return lessonList;
- }
-
- public HardSoftScore getScore() {
- return score;
- }
-
- public SolverStatus getSolverStatus() {
- return solverStatus;
- }
-
- public void setSolverStatus(SolverStatus solverStatus) {
- this.solverStatus = solverStatus;
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java
deleted file mode 100644
index 1bddfe2..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/domain/Timeslot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.acme.schooltimetabling.domain;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.GeneratedValue;
-import jakarta.persistence.Id;
-
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-
-@Entity
-public class Timeslot {
-
- @PlanningId
- @Id @GeneratedValue
- private Long id;
-
- private DayOfWeek dayOfWeek;
- private LocalTime startTime;
- private LocalTime endTime;
-
- // No-arg constructor required for Hibernate
- public Timeslot() {
- }
-
- public Timeslot(DayOfWeek dayOfWeek, LocalTime startTime, LocalTime endTime) {
- this.dayOfWeek = dayOfWeek;
- this.startTime = startTime;
- this.endTime = endTime;
- }
-
- public Timeslot(long id, DayOfWeek dayOfWeek, LocalTime startTime) {
- this(dayOfWeek, startTime, startTime.plusMinutes(50));
- this.id = id;
- }
-
- @Override
- public String toString() {
- return dayOfWeek + " " + startTime;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public Long getId() {
- return id;
- }
-
- public DayOfWeek getDayOfWeek() {
- return dayOfWeek;
- }
-
- public LocalTime getStartTime() {
- return startTime;
- }
-
- public LocalTime getEndTime() {
- return endTime;
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/LessonRepository.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/LessonRepository.java
deleted file mode 100644
index 99c6c19..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/LessonRepository.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.acme.schooltimetabling.persistence;
-
-import java.util.List;
-
-import org.springframework.data.repository.CrudRepository;
-import org.springframework.data.repository.PagingAndSortingRepository;
-
-import org.acme.schooltimetabling.domain.Lesson;
-
-public interface LessonRepository extends CrudRepository<Lesson, Long>, PagingAndSortingRepository<Lesson, Long> {
-
- @Override
- List<Lesson> findAll();
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/RoomRepository.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/RoomRepository.java
deleted file mode 100644
index 7591982..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/RoomRepository.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.acme.schooltimetabling.persistence;
-
-import java.util.List;
-
-import org.springframework.data.repository.CrudRepository;
-import org.springframework.data.repository.PagingAndSortingRepository;
-
-import org.acme.schooltimetabling.domain.Room;
-
-public interface RoomRepository extends CrudRepository<Room, Long>, PagingAndSortingRepository<Room, Long> {
-
- @Override
- List<Room> findAll();
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java
deleted file mode 100644
index ed6ad3b..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/TimeTableRepository.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.acme.schooltimetabling.persistence;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.TimeTable;
-
-@Service
-@Transactional
-public class TimeTableRepository {
-
- // There is only one time table, so there is only timeTableId (= problemId).
- public static final Long SINGLETON_TIME_TABLE_ID = 1L;
-
- @Autowired
- private TimeslotRepository timeslotRepository;
- @Autowired
- private RoomRepository roomRepository;
- @Autowired
- private LessonRepository lessonRepository;
-
- public TimeTable findById(Long id) {
- if (!SINGLETON_TIME_TABLE_ID.equals(id)) {
- throw new IllegalStateException("There is no timeTable with id (" + id + ").");
- }
- // Occurs in a single transaction, so each initialized lesson references the same timeslot/room instance
- // that is contained by the timeTable's timeslotList/roomList.
- return new TimeTable(
- timeslotRepository.findAll(),
- roomRepository.findAll(),
- lessonRepository.findAll());
- }
-
- public void save(TimeTable timeTable) {
- for (Lesson lesson : timeTable.getLessonList()) {
- // TODO this is awfully naive: optimistic locking causes issues if called by the SolverManager
- lessonRepository.findById(lesson.getId()).ifPresent(attachedLesson -> {
- attachedLesson.setTimeslot(lesson.getTimeslot());
- attachedLesson.setRoom(lesson.getRoom());
- });
- }
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/TimeslotRepository.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/TimeslotRepository.java
deleted file mode 100644
index 525f0e2..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/persistence/TimeslotRepository.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.acme.schooltimetabling.persistence;
-
-import java.util.List;
-
-import org.acme.schooltimetabling.domain.Room;
-import org.springframework.data.repository.CrudRepository;
-import org.springframework.data.repository.PagingAndSortingRepository;
-
-import org.acme.schooltimetabling.domain.Timeslot;
-
-public interface TimeslotRepository extends CrudRepository<Timeslot, Long>, PagingAndSortingRepository<Timeslot, Long> {
-
- @Override
- List<Timeslot> findAll();
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/rest/TimeTableController.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/rest/TimeTableController.java
deleted file mode 100644
index 2c48079..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/rest/TimeTableController.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.acme.schooltimetabling.rest;
-
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.persistence.TimeTableRepository;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.solver.SolutionManager;
-import org.optaplanner.core.api.solver.SolverManager;
-import org.optaplanner.core.api.solver.SolverStatus;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/timeTable")
-public class TimeTableController {
-
- @Autowired
- private TimeTableRepository timeTableRepository;
- @Autowired
- private SolverManager<TimeTable, Long> solverManager;
- @Autowired
- private SolutionManager<TimeTable, HardSoftScore> solutionManager;
-
- // To try, GET http://localhost:8080/timeTable
- @GetMapping()
- public TimeTable getTimeTable() {
- // Get the solver status before loading the solution
- // to avoid the race condition that the solver terminates between them
- SolverStatus solverStatus = getSolverStatus();
- TimeTable solution = timeTableRepository.findById(TimeTableRepository.SINGLETON_TIME_TABLE_ID);
- solutionManager.update(solution); // Sets the score
- solution.setSolverStatus(solverStatus);
- return solution;
- }
-
- @PostMapping("/solve")
- public void solve() {
- solverManager.solveAndListen(TimeTableRepository.SINGLETON_TIME_TABLE_ID,
- timeTableRepository::findById,
- timeTableRepository::save);
- }
-
- public SolverStatus getSolverStatus() {
- return solverManager.getSolverStatus(TimeTableRepository.SINGLETON_TIME_TABLE_ID);
- }
-
- @PostMapping("/stopSolving")
- public void stopSolving() {
- solverManager.terminateEarly(TimeTableRepository.SINGLETON_TIME_TABLE_ID);
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java b/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java
deleted file mode 100644
index 6267e2c..0000000
--- a/technology/java-spring-boot/src/main/java/org/acme/schooltimetabling/solver/TimeTableConstraintProvider.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.acme.schooltimetabling.solver;
-
-import java.time.Duration;
-
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.score.stream.Constraint;
-import org.optaplanner.core.api.score.stream.ConstraintFactory;
-import org.optaplanner.core.api.score.stream.ConstraintProvider;
-import org.optaplanner.core.api.score.stream.Joiners;
-
-import org.acme.schooltimetabling.domain.Lesson;
-
-public class TimeTableConstraintProvider implements ConstraintProvider {
-
- @Override
- public Constraint[] defineConstraints(ConstraintFactory constraintFactory) {
- return new Constraint[] {
- // Hard constraints
- roomConflict(constraintFactory),
- teacherConflict(constraintFactory),
- studentGroupConflict(constraintFactory),
- // Soft constraints
- teacherRoomStability(constraintFactory),
- teacherTimeEfficiency(constraintFactory),
- studentGroupSubjectVariety(constraintFactory)
- };
- }
-
- Constraint roomConflict(ConstraintFactory constraintFactory) {
- // A room can accommodate at most one lesson at the same time.
- return constraintFactory
- // Select each pair of 2 different lessons ...
- .forEachUniquePair(Lesson.class,
- // ... in the same timeslot ...
- Joiners.equal(Lesson::getTimeslot),
- // ... in the same room ...
- Joiners.equal(Lesson::getRoom))
- // ... and penalize each pair with a hard weight.
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Room conflict");
- }
-
- Constraint teacherConflict(ConstraintFactory constraintFactory) {
- // A teacher can teach at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getTeacher))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Teacher conflict");
- }
-
- Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
- // A student can attend at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getStudentGroup))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Student group conflict");
- }
-
- Constraint teacherRoomStability(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach in a single room.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTeacher))
- .filter((lesson1, lesson2) -> lesson1.getRoom() != lesson2.getRoom())
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher room stability");
- }
-
- Constraint teacherTimeEfficiency(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach sequential lessons and dislikes gaps between lessons.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class, Joiners.equal(Lesson::getTeacher),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .reward(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher time efficiency");
- }
-
- Constraint studentGroupSubjectVariety(ConstraintFactory constraintFactory) {
- // A student group dislikes sequential lessons on the same subject.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class,
- Joiners.equal(Lesson::getSubject),
- Joiners.equal(Lesson::getStudentGroup),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Student group subject variety");
- }
-
-}
diff --git a/technology/java-spring-boot/src/main/resources/application.properties b/technology/java-spring-boot/src/main/resources/application.properties
deleted file mode 100644
index b43b834..0000000
--- a/technology/java-spring-boot/src/main/resources/application.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-########################
-# OptaPlanner properties
-########################
-
-# The solver runs for 30 seconds. To run for 5 minutes use "5m" and for 2 hours use "2h".
-optaplanner.solver.termination.spent-limit=30s
-
-# When benchmarking, each individual solver runs for 15 seconds. To run for 5 minutes use "5m" and for 2 hours use "2h".
-optaplanner.benchmark.solver.termination.spent-limit=15s
-
-# To change how many solvers to run in parallel
-# optaplanner.solver-manager.parallel-solver-count=4
-# To run increase CPU cores usage per solver
-# optaplanner.solver.move-thread-count=2
-
-# Temporary comment this out to detect bugs in your code (lowers performance)
-# optaplanner.solver.environment-mode=FULL_ASSERT
-# To see what OptaPlanner is doing, turn on DEBUG or TRACE logging.
-logging.level.org.optaplanner=DEBUG
-
-# XML file for power tweaking, defaults to solverConfig.xml (directly under src/main/resources)
-# optaplanner.solver-config-xml=org/.../timeTableSolverConfig.xml
-
-########################
-# Spring Boot properties
-########################
-
-# Make it easier to read OptaPlanner logging
-logging.pattern.console=%d{HH:mm:ss.SSS} %clr(${LOG_LEVEL_PATTERN:%5p}) %blue([%-15.15t]) %m%n
diff --git a/technology/java-spring-boot/src/main/resources/static/app.js b/technology/java-spring-boot/src/main/resources/static/app.js
deleted file mode 100644
index 97bd630..0000000
--- a/technology/java-spring-boot/src/main/resources/static/app.js
+++ /dev/null
@@ -1,344 +0,0 @@
-var autoRefreshIntervalId = null;
-const dateTimeFormatter = JSJoda.DateTimeFormatter.ofPattern('HH:mm')
-
-function refreshTimeTable() {
- $.getJSON("/timeTable", function (timeTable) {
- refreshSolvingButtons(timeTable.solverStatus != null && timeTable.solverStatus !== "NOT_SOLVING");
- $("#score").text("Score: " + (timeTable.score == null ? "?" : timeTable.score));
-
- const timeTableByRoom = $("#timeTableByRoom");
- timeTableByRoom.children().remove();
- const timeTableByTeacher = $("#timeTableByTeacher");
- timeTableByTeacher.children().remove();
- const timeTableByStudentGroup = $("#timeTableByStudentGroup");
- timeTableByStudentGroup.children().remove();
- const unassignedLessons = $("#unassignedLessons");
- unassignedLessons.children().remove();
-
- const theadByRoom = $("<thead>").appendTo(timeTableByRoom);
- const headerRowByRoom = $("<tr>").appendTo(theadByRoom);
- headerRowByRoom.append($("<th>Timeslot</th>"));
- $.each(timeTable.roomList, (index, room) => {
- headerRowByRoom
- .append($("<th/>")
- .append($("<span/>").text(room.name))
- .append($(`<button type="button" class="ml-2 mb-1 btn btn-light btn-sm p-1"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteRoom(room))));
- });
- const theadByTeacher = $("<thead>").appendTo(timeTableByTeacher);
- const headerRowByTeacher = $("<tr>").appendTo(theadByTeacher);
- headerRowByTeacher.append($("<th>Timeslot</th>"));
- const teacherList = [...new Set(timeTable.lessonList.map(lesson => lesson.teacher))];
- $.each(teacherList, (index, teacher) => {
- headerRowByTeacher
- .append($("<th/>")
- .append($("<span/>").text(teacher)));
- });
- const theadByStudentGroup = $("<thead>").appendTo(timeTableByStudentGroup);
- const headerRowByStudentGroup = $("<tr>").appendTo(theadByStudentGroup);
- headerRowByStudentGroup.append($("<th>Timeslot</th>"));
- const studentGroupList = [...new Set(timeTable.lessonList.map(lesson => lesson.studentGroup))];
- $.each(studentGroupList, (index, studentGroup) => {
- headerRowByStudentGroup
- .append($("<th/>")
- .append($("<span/>").text(studentGroup)));
- });
-
- const tbodyByRoom = $("<tbody>").appendTo(timeTableByRoom);
- const tbodyByTeacher = $("<tbody>").appendTo(timeTableByTeacher);
- const tbodyByStudentGroup = $("<tbody>").appendTo(timeTableByStudentGroup);
-
- const LocalTime = JSJoda.LocalTime;
-
- $.each(timeTable.timeslotList, (index, timeslot) => {
- const rowByRoom = $("<tr>").appendTo(tbodyByRoom);
- rowByRoom
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)
- .append($(`<button type="button" class="ml-2 mb-1 btn btn-light btn-sm p-1"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteTimeslot(timeslot)))));
- $.each(timeTable.roomList, (index, room) => {
- rowByRoom.append($("<td/>").prop("id", `timeslot${timeslot.id}room${room.id}`));
- });
-
- const rowByTeacher = $("<tr>").appendTo(tbodyByTeacher);
- rowByTeacher
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)));
- $.each(teacherList, (index, teacher) => {
- rowByTeacher.append($("<td/>").prop("id", `timeslot${timeslot.id}teacher${convertToId(teacher)}`));
- });
-
- const rowByStudentGroup = $("<tr>").appendTo(tbodyByStudentGroup);
- rowByStudentGroup
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)));
- $.each(studentGroupList, (index, studentGroup) => {
- rowByStudentGroup.append($("<td/>").prop("id", `timeslot${timeslot.id}studentGroup${convertToId(studentGroup)}`));
- });
- });
-
- $.each(timeTable.lessonList, (index, lesson) => {
- const color = pickColor(lesson.subject);
- const lessonElementWithoutDelete = $(`<div class="card" style="background-color: ${color}"/>`)
- .append($(`<div class="card-body p-2"/>`)
- .append($(`<h5 class="card-title mb-1"/>`).text(lesson.subject))
- .append($(`<p class="card-text ml-2 mb-1"/>`)
- .append($(`<em/>`).text(`by ${lesson.teacher}`)))
- .append($(`<small class="ml-2 mt-1 card-text text-muted align-bottom float-right"/>`).text(lesson.id))
- .append($(`<p class="card-text ml-2"/>`).text(lesson.studentGroup)));
- const lessonElement = lessonElementWithoutDelete.clone();
- lessonElement.find(".card-body").prepend(
- $(`<button type="button" class="ml-2 btn btn-light btn-sm p-1 float-right"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteLesson(lesson))
- );
- if (lesson.timeslot == null || lesson.room == null) {
- unassignedLessons.append(lessonElement);
- } else {
- $(`#timeslot${lesson.timeslot.id}room${lesson.room.id}`).append(lessonElement);
- $(`#timeslot${lesson.timeslot.id}teacher${convertToId(lesson.teacher)}`).append(lessonElementWithoutDelete.clone());
- $(`#timeslot${lesson.timeslot.id}studentGroup${convertToId(lesson.studentGroup)}`).append(lessonElementWithoutDelete.clone());
- }
- });
- });
-}
-
-function convertToId(str) {
- // Base64 encoding without padding to avoid XSS
- return btoa(str).replace(/=/g, "");
-}
-
-function solve() {
- $.post("/timeTable/solve", function () {
- refreshSolvingButtons(true);
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Start solving failed.", xhr);
- });
-}
-
-function refreshSolvingButtons(solving) {
- if (solving) {
- $("#solveButton").hide();
- $("#stopSolvingButton").show();
- if (autoRefreshIntervalId == null) {
- autoRefreshIntervalId = setInterval(refreshTimeTable, 2000);
- }
- } else {
- $("#solveButton").show();
- $("#stopSolvingButton").hide();
- if (autoRefreshIntervalId != null) {
- clearInterval(autoRefreshIntervalId);
- autoRefreshIntervalId = null;
- }
- }
-}
-
-function stopSolving() {
- $.post("/timeTable/stopSolving", function () {
- refreshSolvingButtons(false);
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Stop solving failed.", xhr);
- });
-}
-
-function addLesson() {
- var subject = $("#lesson_subject").val().trim();
- $.post("/lessons", JSON.stringify({
- "subject": subject,
- "teacher": $("#lesson_teacher").val().trim(),
- "studentGroup": $("#lesson_studentGroup").val().trim()
- }), function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Adding lesson (" + subject + ") failed.", xhr);
- });
- $('#lessonDialog').modal('toggle');
-}
-
-function deleteLesson(lesson) {
- $.delete("/lessons/" + lesson.id, function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Deleting lesson (" + lesson.name + ") failed.", xhr);
- });
-}
-
-function addTimeslot() {
- $.post("/timeslots", JSON.stringify({
- "dayOfWeek": $("#timeslot_dayOfWeek").val().trim().toUpperCase(),
- "startTime": $("#timeslot_startTime").val().trim(),
- "endTime": $("#timeslot_endTime").val().trim()
- }), function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Adding timeslot failed.", xhr);
- });
- $('#timeslotDialog').modal('toggle');
-}
-
-function deleteTimeslot(timeslot) {
- $.delete("/timeslots/" + timeslot.id, function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Deleting timeslot (" + timeslot.name + ") failed.", xhr);
- });
-}
-
-function addRoom() {
- var name = $("#room_name").val().trim();
- $.post("/rooms", JSON.stringify({
- "name": name
- }), function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Adding room (" + name + ") failed.", xhr);
- });
- $("#roomDialog").modal('toggle');
-}
-
-function deleteRoom(room) {
- $.delete("/rooms/" + room.id, function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Deleting room (" + room.name + ") failed.", xhr);
- });
-}
-
-function showError(title, xhr) {
- const serverErrorMessage = !xhr.responseJSON ? `${xhr.status}: ${xhr.statusText}` : xhr.responseJSON.message;
- console.error(title + "\n" + serverErrorMessage);
- const notification = $(`<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" style="min-width: 30rem"/>`)
- .append($(`<div class="toast-header bg-danger">
- <strong class="mr-auto text-dark">Error</strong>
- <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>`))
- .append($(`<div class="toast-body"/>`)
- .append($(`<p/>`).text(title))
- .append($(`<pre/>`)
- .append($(`<code/>`).text(serverErrorMessage))
- )
- );
- $("#notificationPanel").append(notification);
- notification.toast({delay: 30000});
- notification.toast('show');
-}
-
-$(document).ready(function () {
- $.ajaxSetup({
- headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json'
- }
- });
- // Extend jQuery to support $.put() and $.delete()
- jQuery.each(["put", "delete"], function (i, method) {
- jQuery[method] = function (url, data, callback, type) {
- if (jQuery.isFunction(data)) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
- return jQuery.ajax({
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- });
- };
- });
-
- $("#refreshButton").click(function () {
- refreshTimeTable();
- });
- $("#solveButton").click(function () {
- solve();
- });
- $("#stopSolvingButton").click(function () {
- stopSolving();
- });
- $("#addLessonSubmitButton").click(function () {
- addLesson();
- });
- $("#addTimeslotSubmitButton").click(function () {
- addTimeslot();
- });
- $("#addRoomSubmitButton").click(function () {
- addRoom();
- });
-
- refreshTimeTable();
-});
-
-// ****************************************************************************
-// TangoColorFactory
-// ****************************************************************************
-
-const SEQUENCE_1 = [0x8AE234, 0xFCE94F, 0x729FCF, 0xE9B96E, 0xAD7FA8];
-const SEQUENCE_2 = [0x73D216, 0xEDD400, 0x3465A4, 0xC17D11, 0x75507B];
-
-var colorMap = new Map;
-var nextColorCount = 0;
-
-function pickColor(object) {
- let color = colorMap[object];
- if (color !== undefined) {
- return color;
- }
- color = nextColor();
- colorMap[object] = color;
- return color;
-}
-
-function nextColor() {
- let color;
- let colorIndex = nextColorCount % SEQUENCE_1.length;
- let shadeIndex = Math.floor(nextColorCount / SEQUENCE_1.length);
- if (shadeIndex === 0) {
- color = SEQUENCE_1[colorIndex];
- } else if (shadeIndex === 1) {
- color = SEQUENCE_2[colorIndex];
- } else {
- shadeIndex -= 3;
- let floorColor = SEQUENCE_2[colorIndex];
- let ceilColor = SEQUENCE_1[colorIndex];
- let base = Math.floor((shadeIndex / 2) + 1);
- let divisor = 2;
- while (base >= divisor) {
- divisor *= 2;
- }
- base = (base * 2) - divisor + 1;
- let shadePercentage = base / divisor;
- color = buildPercentageColor(floorColor, ceilColor, shadePercentage);
- }
- nextColorCount++;
- return "#" + color.toString(16);
-}
-
-function buildPercentageColor(floorColor, ceilColor, shadePercentage) {
- let red = (floorColor & 0xFF0000) + Math.floor(shadePercentage * ((ceilColor & 0xFF0000) - (floorColor & 0xFF0000))) & 0xFF0000;
- let green = (floorColor & 0x00FF00) + Math.floor(shadePercentage * ((ceilColor & 0x00FF00) - (floorColor & 0x00FF00))) & 0x00FF00;
- let blue = (floorColor & 0x0000FF) + Math.floor(shadePercentage * ((ceilColor & 0x0000FF) - (floorColor & 0x0000FF))) & 0x0000FF;
- return red | green | blue;
-}
diff --git a/technology/java-spring-boot/src/main/resources/static/index.html b/technology/java-spring-boot/src/main/resources/static/index.html
deleted file mode 100644
index 083c05c..0000000
--- a/technology/java-spring-boot/src/main/resources/static/index.html
+++ /dev/null
@@ -1,179 +0,0 @@
-<html lang="en">
-<head>
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
- <meta content="width=device-width, initial-scale=1" name="viewport">
- <title>School timetabling - OptaPlanner Spring Boot</title>
- <link rel="stylesheet" href="/webjars/bootstrap/css/bootstrap.min.css" />
- <link rel="stylesheet" href="/webjars/font-awesome/css/all.css" />
-</head>
-<body>
-<div class="container">
- <nav class="navbar navbar-expand-lg navbar-light bg-light">
- <a class="navbar-brand" href="https://www.optaplanner.org">
- <img src="optaPlannerLogo200px.png" alt="OptaPlanner logo">
- </a>
- </nav>
- <div class="sticky-top d-flex justify-content-center align-items-center" aria-live="polite" aria-atomic="true">
- <div id="notificationPanel" style="position: absolute; top: .5rem;"></div>
- </div>
- <h1>High school time table solver</h1>
- <p>Generate the optimal schedule for your teachers and students.</p>
-
- <div class="mb-2">
- <button id="refreshButton" type="button" class="btn btn-secondary">
- <span class="fas fa-refresh"></span> Refresh
- </button>
- <button id="solveButton" type="button" class="btn btn-success">
- <span class="fas fa-play"></span> Solve
- </button>
- <button id="stopSolvingButton" type="button" class="btn btn-danger">
- <span class="fas fa-stop"></span> Stop solving
- </button>
- <!-- <button type="button" class="float-right btn btn-warning"><span class="fas fa-stop"></span> Terminate</button>-->
- <span id="score" class="score ml-2 align-middle font-weight-bold">Score: ?</span>
-
- <div class="float-right">
- <ul class="nav nav-pills" id="myTab" role="tablist">
- <li class="nav-item">
- <a class="nav-link active" id="byRoomTab" data-toggle="tab" href="#byRoomPanel" role="tab" aria-controls="byRoomPanel" aria-selected="true">By room</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="byTeacherTab" data-toggle="tab" href="#byTeacher" role="tab" aria-controls="byTeacher" aria-selected="false">By teacher</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="byStudentGroupTab" data-toggle="tab" href="#byStudentGroup" role="tab" aria-controls="byStudentGroup" aria-selected="false">By student group</a>
- </li>
- </ul>
- </div>
- </div>
- <div class="tab-content" id="myTabContent">
- <div class="tab-pane fade show active" id="byRoomPanel" role="tabpanel" aria-labelledby="byRoomTab">
- <table class="table table-borderless table-striped" id="timeTableByRoom">
- <!-- Filled in by app.js -->
- </table>
- </div>
- <div class="tab-pane fade" id="byTeacher" role="tabpanel" aria-labelledby="byTeacherTab">
- <table class="table table-borderless table-striped" id="timeTableByTeacher">
- <!-- Filled in by app.js -->
- </table>
- </div>
- <div class="tab-pane fade" id="byStudentGroup" role="tabpanel" aria-labelledby="byStudentGroupTab">
- <table class="table table-borderless table-striped" id="timeTableByStudentGroup">
- <!-- Filled in by app.js -->
- </table>
- </div>
- </div>
- <div class="mb-4">
- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#lessonDialog">
- <span class="fas fa-plus"></span> Add lesson
- </button>
- <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#timeslotDialog">
- <span class="fas fa-plus"></span> Add timeslot
- </button>
- <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#roomDialog">
- <span class="fas fa-plus"></span> Add room
- </button>
- </div>
-
- <h2>Unassigned lessons</h2>
- <div id="unassignedLessons" class="card-columns"></div>
-</div>
-
-
-<div class="modal fade" id="lessonDialog" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4>Add a lesson</h4>
- <button type="button" class="close" data-dismiss="modal">
- <span>×</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label for="lesson_subject">Subject</label>
- <input type="text" class="form-control" id="lesson_subject" required value="Music">
- </div>
- <div class="form-group">
- <label for="lesson_teacher">Teacher</label>
- <input type="text" class="form-control" id="lesson_teacher" required value="B. May">
- </div>
- <div class="form-group">
- <label for="lesson_studentGroup">Student group</label>
- <input type="text" class="form-control" id="lesson_studentGroup" required value="11th grade">
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="addLessonSubmitButton">Submit new lesson</button>
- </div>
- </div>
- </div>
- </div>
-</div>
-<div class="modal fade" id="timeslotDialog" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4>Add a timeslot</h4>
- <button type="button" class="close" data-dismiss="modal">
- <span>×</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label for="timeslot_dayOfWeek">Day of week</label>
- <select class="form-control" id="timeslot_dayOfWeek" required>
- <option>Monday</option>
- <option>Tuesday</option>
- <option selected="selected">Wednesday</option>
- <option>Thursday</option>
- <option>Friday</option>
- <option>Saturday</option>
- <option>Sunday</option>
- </select>
- </div>
- <div class="form-group">
- <label for="timeslot_startTime">Start time</label>
- <input type="time" class="form-control" id="timeslot_startTime" required value="08:30"/>
- </div>
- <div class="form-group">
- <label for="timeslot_endTime">End time</label>
- <input type="time" class="form-control" id="timeslot_endTime" required value="09:30">
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="addTimeslotSubmitButton">Submit new timeslot</button>
- </div>
- </div>
- </div>
- </div>
-</div>
-<div class="modal fade" id="roomDialog" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4>Add a room</h4>
- <button type="button" class="close" data-dismiss="modal">
- <span>×</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label for="room_name">Name</label>
- <input type="text" class="form-control" id="room_name" required value="Room D">
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="addRoomSubmitButton">Submit new room</button>
- </div>
- </div>
- </div>
- </div>
-</div>
-
-<script src="/webjars/jquery/jquery.min.js"></script>
-<script src="/webjars/bootstrap/js/bootstrap.min.js"></script>
-<script src="/webjars/js-joda/dist/js-joda.min.js"></script>
-<script src="/app.js"></script>
-</body>
-</html>
diff --git a/technology/java-spring-boot/src/main/resources/static/optaPlannerLogo200px.png b/technology/java-spring-boot/src/main/resources/static/optaPlannerLogo200px.png
deleted file mode 100644
index 63abac7..0000000
Binary files a/technology/java-spring-boot/src/main/resources/static/optaPlannerLogo200px.png and /dev/null differ
diff --git a/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/rest/TimeTableControllerTest.java b/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/rest/TimeTableControllerTest.java
deleted file mode 100644
index 1991a35..0000000
--- a/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/rest/TimeTableControllerTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.acme.schooltimetabling.rest;
-
-import static io.restassured.RestAssured.get;
-import static io.restassured.RestAssured.given;
-import static org.awaitility.Awaitility.await;
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
-
-import io.restassured.http.ContentType;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Timeout;
-import org.optaplanner.core.api.solver.SolverStatus;
-import org.springframework.boot.test.context.SpringBootTest;
-import java.time.Duration;
-
-@SpringBootTest(properties = {
- // Effectively disable spent-time termination in favor of the best-score-limit
- "optaplanner.solver.termination.spent-limit=1h",
- "optaplanner.solver.termination.best-score-limit=0hard/*soft" },
- webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
-public class TimeTableControllerTest {
-
- @Test
- @Timeout(600_000)
- public void solveDemoDataUntilFeasible() {
- given()
- .contentType(ContentType.JSON)
- .when().post("/timeTable/solve")
- .then()
- .statusCode(200);
-
- await()
- .atMost(Duration.ofMinutes(1))
- .pollDelay(Duration.ofSeconds(5))
- .pollInterval(Duration.ofSeconds(5))
- .until(() -> SolverStatus.NOT_SOLVING.name().equals(get("/timeTable").body().path("solverStatus")));
-
- get("/timeTable").then().assertThat()
- .body("solverStatus", equalTo(SolverStatus.NOT_SOLVING.name()))
- .body("timeslotList", is(not(empty())))
- .body("roomList", is(not(empty())))
- .body("lessonList", is(not(empty())))
- .body("lessonList.timeslot", not(nullValue()))
- .body("lessonList.room", not(nullValue()));
- }
-
-}
diff --git a/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/solver/TimeTableBenchmarkTest.java b/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/solver/TimeTableBenchmarkTest.java
deleted file mode 100644
index 853969e..0000000
--- a/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/solver/TimeTableBenchmarkTest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.acme.schooltimetabling.solver;
-
-import org.acme.schooltimetabling.rest.TimeTableController;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Timeout;
-import org.optaplanner.benchmark.api.PlannerBenchmarkFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-public class TimeTableBenchmarkTest {
-
- @Autowired
- private TimeTableController timeTableController;
-
- @Autowired
- private PlannerBenchmarkFactory benchmarkFactory;
-
- @Test
- @Timeout(600_000)
- public void benchmark() {
- benchmarkFactory.buildPlannerBenchmark(timeTableController.getTimeTable()).benchmark();
- }
-}
diff --git a/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java b/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java
deleted file mode 100644
index a25b254..0000000
--- a/technology/java-spring-boot/src/test/java/org/acme/schooltimetabling/solver/TimeTableConstraintProviderTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.acme.schooltimetabling.solver;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import org.acme.schooltimetabling.domain.Lesson;
-import org.acme.schooltimetabling.domain.Room;
-import org.acme.schooltimetabling.domain.TimeTable;
-import org.acme.schooltimetabling.domain.Timeslot;
-import org.junit.jupiter.api.Test;
-import org.optaplanner.test.api.score.stream.ConstraintVerifier;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-class TimeTableConstraintProviderTest {
-
- private static final Room ROOM1 = new Room(1, "Room1");
- private static final Room ROOM2 = new Room(2, "Room2");
- private static final Timeslot TIMESLOT1 = new Timeslot(1, DayOfWeek.MONDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT2 = new Timeslot(2, DayOfWeek.TUESDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT3 = new Timeslot(3, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(1));
- private static final Timeslot TIMESLOT4 = new Timeslot(4, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(3));
-
- @Autowired
- ConstraintVerifier<TimeTableConstraintProvider, TimeTable> constraintVerifier;
-
- @Test
- void roomConflict() {
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", "Group2", TIMESLOT1, ROOM1);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::roomConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherConflict() {
- String conflictingTeacher = "Teacher1";
- Lesson firstLesson = new Lesson(1, "Subject1", conflictingTeacher, "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", conflictingTeacher, "Group2", TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher2", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void studentGroupConflict() {
- String conflictingGroup = "Group1";
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", conflictingGroup, TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", conflictingGroup, TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherRoomStability() {
- String teacher = "Teacher1";
- Lesson lessonInFirstRoom = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson lessonInSameRoom = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT1, ROOM1);
- Lesson lessonInDifferentRoom = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT1, ROOM2);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherRoomStability)
- .given(lessonInFirstRoom, lessonInDifferentRoom, lessonInSameRoom)
- .penalizesBy(2);
- }
-
- @Test
- void teacherTimeEfficiency() {
- String teacher = "Teacher1";
- Lesson singleLessonOnMonday = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithGap = new Lesson(4, "Subject4", teacher, "Group4", TIMESLOT4, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherTimeEfficiency)
- .given(singleLessonOnMonday, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithGap)
- .rewardsWith(1); // Second tuesday lesson immediately follows the first.
- }
-
- @Test
- void studentGroupSubjectVariety() {
- String studentGroup = "Group1";
- String repeatedSubject = "Subject1";
- Lesson mondayLesson = new Lesson(1, repeatedSubject, "Teacher1", studentGroup, TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, repeatedSubject, "Teacher2", studentGroup, TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, repeatedSubject, "Teacher3", studentGroup, TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithDifferentSubject = new Lesson(4, "Subject2", "Teacher4", studentGroup, TIMESLOT4, ROOM1);
- Lesson lessonInAnotherGroup = new Lesson(5, repeatedSubject, "Teacher5", "Group2", TIMESLOT1, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupSubjectVariety)
- .given(mondayLesson, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithDifferentSubject,
- lessonInAnotherGroup)
- .penalizesBy(1); // Second tuesday lesson immediately follows the first.
- }
-
-}
diff --git a/technology/kotlin-quarkus/.dockerignore b/technology/kotlin-quarkus/.dockerignore
deleted file mode 100644
index 221ee37..0000000
--- a/technology/kotlin-quarkus/.dockerignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*
-!target/*-runner
-!target/quarkus-app/*
\ No newline at end of file
diff --git a/technology/kotlin-quarkus/.gitignore b/technology/kotlin-quarkus/.gitignore
deleted file mode 100644
index 2c78f65..0000000
--- a/technology/kotlin-quarkus/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-!.s2i
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/kotlin-quarkus/.s2i/environment b/technology/kotlin-quarkus/.s2i/environment
deleted file mode 100644
index 6b32f83..0000000
--- a/technology/kotlin-quarkus/.s2i/environment
+++ /dev/null
@@ -1,5 +0,0 @@
-MAVEN_S2I_ARTIFACT_DIRS=target/quarkus-app
-S2I_SOURCE_DEPLOYMENTS_FILTER=app lib quarkus quarkus-run.jar
-JAVA_OPTIONS=-Dquarkus.http.host=0.0.0.0
-AB_JOLOKIA_OFF=true
-JAVA_APP_JAR=/deployments/quarkus-run.jar
diff --git a/technology/kotlin-quarkus/README.adoc b/technology/kotlin-quarkus/README.adoc
deleted file mode 100644
index d5c5bdf..0000000
--- a/technology/kotlin-quarkus/README.adoc
+++ /dev/null
@@ -1,170 +0,0 @@
-= School Timetabling (Kotlin, Quarkus, Maven)
-
-Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.
-
-image::../../build/quickstarts-showcase/src/main/resources/META-INF/resources/screenshot/quarkus-school-timetabling-screenshot.png[]
-
-* <<run,Run the application>>
-* <<package,Run the packaged application>>
-* <<cloud,Host it in the cloud>>
-* <<native,Run it native>>
-
-[[run]]
-== Run the application
-
-. Git clone the optaplanner-quickstarts repo and navigate to this directory:
-+
-[source, shell]
-----
-$ git clone https://github.com/kiegroup/optaplanner-quickstarts.git
-...
-$ cd optaplanner-quickstarts/technology/kotlin-quarkus
-----
-
-. Start the application with Maven:
-+
-[source, shell]
-----
-$ mvn quarkus:dev
-----
-
-. 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.
-
-
-[[package]]
-== Run the packaged application
-
-When you're done iterating in `quarkus:dev` mode,
-package the application to run as a conventional jar file.
-
-. Compile it with Maven:
-+
-[source, shell]
-----
-$ mvn package
-----
-
-. Run it:
-+
-[source, shell]
-----
-$ java -jar ./target/quarkus-app/quarkus-run.jar
-----
-+
-[NOTE]
-====
-Even though it's written in Kotlin, it can run with the `java` command.
-====
-+
-[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.
-
-
-[[cloud]]
-== Host it in the cloud
-
-To allow others to try this application in their browser,
-host it in the cloud and share the url with them.
-
-=== Host it on OpenShift (Kubernetes)
-
-https://www.redhat.com/en/technologies/cloud-computing/openshift[Red Hat OpenShift] is an open source Kubernetes cloud service
-which is ideal to host OptaPlanner applications.
-
-To deploy the application on OpenShift:
-
-. https://developers.redhat.com/developer-sandbox[Get a free Developer Sandbox account for OpenShift] and _launch_ the Developer Sandbox.
-. In the OpenShift web console, verify that the top left combobox is set to _Developer_ (not _Administrator_).
-. In the menu, select *Add* to create an application.
-. Under *Git Repository*, click *Import from Git* and fill in these parameters:
-.. Set *Git Repo URL* to `https://github.com/kiegroup/optaplanner-quickstarts`
-.. Under _Show advanced Git options_, set *Context dir* to `/technology/kotlin-quarkus`
-.. Press the *Create* button.
-. In the _Topology_ view, there is a new deployment:
-.. Wait a minute until the build completes (watch the bottom left icon until it turns green).
-.. Open the URL (click on the top right icon).
-. Click on the *Solve* button.
-
-=== Host it on OpenShift using native build
-
-Requirements:
-
-- Install https://podman.io/[Podman] or https://www.docker.com/[Docker]
-- Install https://docs.openshift.com/container-platform/latest/cli_reference/openshift_cli/getting-started-cli.html[OpenShift Client (oc) tools]
-
-To deploy the application on OpenShift using the native build:
-
-. https://developers.redhat.com/developer-sandbox[Get a free Developer Sandbox account for OpenShift] and _launch_ the Developer Sandbox.
-. In the OpenShift web console, verify that the top left combobox is set to _Developer_ (not _Administrator_).
-. In the OpenShift web console, click your username (in the upper right corner) and select the "Copy login command" option.
-. In a bash terminal on your local machine, paste the login command.
-. In a local clone of the repo, navigate to the `technology/kotlin-quarkus` directory.
-. Run the command below:
-+
-[source, shell]
-----
-$ mvn clean package -DskipTests -Dopenshift-native -Dquarkus.kubernetes.deploy=true -Dquarkus.native.container-build=true
-----
-+
-. When the command is finished, you should see two pods in the Topology view: one for the _ephemeral_ Postgres database (data will not be saved), and one for the _native_ Quarkus application. If you click the Quarkus' application link (small bubble with link icon at the top right of the Quarkus' application bubble), you will be navigated to the application. Alternatively, you can get the route from bash with the following command:
-+
-[source, shell]
-----
-$ oc get routes
-----
-
-
-[[native]]
-== Run it native
-
-To increase startup performance for serverless deployments,
-build the application as a native executable:
-
-. https://quarkus.io/guides/building-native-image#configuring-graalvm[Install GraalVM and gu install the native-image tool]
-
-. Compile it natively. This takes a few minutes:
-+
-[source, shell]
-----
-$ mvn package -Dnative -DskipTests
-----
-
-. Run a database. By default, `application.properties` is configured for H2:
-.. Download the http://www.h2database.com/html/download.html[H2 database] (Platform-independent zip) and unzip it.
-.. Start the H2 server with the option `-ifNotExists` (not recommended in production):
-+
-[source, shell]
-----
-$ cd h2/bin
-$ java -cp h2*.jar org.h2.tools.Server -ifNotExists
-----
-
-. Run the native executable:
-+
-[source, shell]
-----
-$ ./target/*-runner
-----
-
-. Visit http://localhost:8080 in your browser.
-
-. Click on the *Solve* button.
-
-== More information
-
-Visit https://www.optaplanner.org/[www.optaplanner.org].
diff --git a/technology/kotlin-quarkus/pom.xml b/technology/kotlin-quarkus/pom.xml
deleted file mode 100644
index dfa5556..0000000
--- a/technology/kotlin-quarkus/pom.xml
+++ /dev/null
@@ -1,279 +0,0 @@
-<?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">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.acme</groupId>
- <artifactId>optaplanner-kotlin-quarkus-school-timetabling-quickstart</artifactId>
- <version>1.0-SNAPSHOT</version>
-
- <properties>
- <maven.compiler.release>11</maven.compiler.release>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
- <version.io.quarkus>3.0.0.Final</version.io.quarkus>
- <version.kotlin>1.8.20</version.kotlin>
- <version.org.optaplanner>9.44.0.Final</version.org.optaplanner>
-
- <version.compiler.plugin>3.8.1</version.compiler.plugin>
- <version.surefire.plugin>3.0.0-M8</version.surefire.plugin>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <!-- Alternatively, use <artifactId>quarkus-universe-bom</artifactId>
- which includes both quarkus-bom and optaplanner-bom. -->
- <artifactId>quarkus-bom</artifactId>
- <version>${version.io.quarkus}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-bom</artifactId>
- <version>${version.org.optaplanner}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib-jdk8</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-kotlin</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-resteasy</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-resteasy-jackson</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-hibernate-orm-panache</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-hibernate-orm-panache-kotlin</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-jdbc-h2</artifactId>
- </dependency>
- <!-- TODO Add RoomResource etc to add/remove rooms, timeslots and lessons -->
- <!-- Blocked by https://github.com/quarkusio/quarkus/issues/12235 -->
-<!-- <dependency>-->
-<!-- <groupId>io.quarkus</groupId>-->
-<!-- <artifactId>quarkus-hibernate-orm-rest-data-panache</artifactId>-->
-<!-- </dependency>-->
-<!-- <dependency>-->
-<!-- <groupId>io.quarkus</groupId>-->
-<!-- <artifactId>quarkus-hibernate-orm-rest-data-panache-kotlin</artifactId>-->
-<!-- </dependency>-->
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus</artifactId>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus-jackson</artifactId>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-test-h2</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.rest-assured</groupId>
- <artifactId>kotlin-extensions</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- UI -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-webjars-locator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>bootstrap</artifactId>
- <version>4.5.3</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- <version>3.5.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>font-awesome</artifactId>
- <version>5.15.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars.npm</groupId>
- <artifactId>js-joda</artifactId>
- <version>1.11.0</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>src/main/kotlin</sourceDirectory>
- <testSourceDirectory>src/test/kotlin</testSourceDirectory>
- <plugins>
- <plugin>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <version>${version.io.quarkus}</version>
- <executions>
- <execution>
- <goals>
- <goal>generate-code</goal>
- <goal>generate-code-tests</goal>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${version.compiler.plugin}</version>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${version.surefire.plugin}</version>
- <configuration>
- <systemPropertyVariables>
- <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-maven-plugin</artifactId>
- <version>${version.kotlin}</version>
- <executions>
- <execution>
- <id>compile</id>
- <goals>
- <goal>compile</goal>
- </goals>
- </execution>
- <execution>
- <id>test-compile</id>
- <goals>
- <goal>test-compile</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-maven-allopen</artifactId>
- <version>${version.kotlin}</version>
- </dependency>
- </dependencies>
- <configuration>
- <javaParameters>true</javaParameters>
- <jvmTarget>11</jvmTarget>
- <compilerPlugins>
- <plugin>all-open</plugin>
- </compilerPlugins>
- <pluginOptions>
- <option>all-open:annotation=jakarta.ws.rs.Path</option>
- <option>all-open:annotation=jakarta.enterprise.context.ApplicationScoped</option>
- <option>all-open:annotation=io.quarkus.test.junit.QuarkusTest</option>
- </pluginOptions>
- </configuration>
- </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.package.type>native</quarkus.package.type>
- <!-- To allow application.properties to avoid using the in-memory database for native builds. -->
- <quarkus.profile>native</quarkus.profile>
- </properties>
- </profile>
- <profile>
- <id>openshift-native</id> <!-- Optional for use in OpenShift. -->
- <activation>
- <property>
- <name>openshift-native</name>
- </property>
- </activation>
- <properties>
- <quarkus.package.type>native</quarkus.package.type>
- <quarkus.profile>openshift-native</quarkus.profile>
- </properties>
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-openshift</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-jdbc-postgresql</artifactId>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
-</project>
diff --git a/technology/kotlin-quarkus/src/main/docker/Dockerfile.jvm b/technology/kotlin-quarkus/src/main/docker/Dockerfile.jvm
deleted file mode 100644
index 9af71d3..0000000
--- a/technology/kotlin-quarkus/src/main/docker/Dockerfile.jvm
+++ /dev/null
@@ -1,57 +0,0 @@
-####
-# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
-#
-# Before building the container image run:
-#
-# mvn package
-#
-# Then, build the image with:
-#
-# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/kotlin-quarkus-school-timetabling-jvm .
-#
-# Then run the container using:
-#
-# docker run -i --rm -p 8080:8080 quarkus/kotlin-quarkus-school-timetabling-jvm
-#
-# If you want to include the debug port into your docker image
-# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050
-#
-# Then run the container using :
-#
-# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/kotlin-quarkus-school-timetabling-jvm
-#
-###
-FROM registry.access.redhat.com/ubi8/ubi-minimal
-
-ARG JAVA_PACKAGE=java-11-openjdk-headless
-ARG RUN_JAVA_VERSION=1.3.8
-
-ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
-
-# Install java and the run-java script
-# Also set up permissions for user `1001`
-RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
- && microdnf update \
- && microdnf clean all \
- && mkdir /deployments \
- && chown 1001 /deployments \
- && chmod "g+rwX" /deployments \
- && chown 1001:root /deployments \
- && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
- && chown 1001 /deployments/run-java.sh \
- && chmod 540 /deployments/run-java.sh \
- && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
-
-# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
-ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
-
-# We make four distinct layers so if there are application changes the library layers can be re-used
-COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/
-COPY --chown=1001 target/quarkus-app/*.jar /deployments/
-COPY --chown=1001 target/quarkus-app/app/ /deployments/app/
-COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/
-
-EXPOSE 8080
-USER 1001
-
-ENTRYPOINT [ "/deployments/run-java.sh" ]
\ No newline at end of file
diff --git a/technology/kotlin-quarkus/src/main/docker/Dockerfile.native b/technology/kotlin-quarkus/src/main/docker/Dockerfile.native
deleted file mode 100644
index d4e5472..0000000
--- a/technology/kotlin-quarkus/src/main/docker/Dockerfile.native
+++ /dev/null
@@ -1,27 +0,0 @@
-####
-# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode
-#
-# Before building the container image run:
-#
-# mvn package -Pnative -Dquarkus.native.container-build=true
-#
-# Then, build the image with:
-#
-# docker build -f src/main/docker/Dockerfile.native -t quarkus/kotlin-quarkus-school-timetabling .
-#
-# Then run the container using:
-#
-# docker run -i --rm -p 8080:8080 quarkus/kotlin-quarkus-school-timetabling
-#
-###
-FROM registry.access.redhat.com/ubi8/ubi-minimal
-WORKDIR /work/
-RUN chown 1001 /work \
- && chmod "g+rwX" /work \
- && chown 1001:root /work
-COPY --chown=1001:root target/*-runner /work/application
-
-EXPOSE 8080
-USER 1001
-
-CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
\ No newline at end of file
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/bootstrap/DemoDataGenerator.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/bootstrap/DemoDataGenerator.kt
deleted file mode 100644
index 4e98a30..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/bootstrap/DemoDataGenerator.kt
+++ /dev/null
@@ -1,208 +0,0 @@
-package org.acme.kotlin.schooltimetabling.bootstrap
-
-import io.quarkus.runtime.StartupEvent
-import org.acme.kotlin.schooltimetabling.domain.Lesson
-import org.acme.kotlin.schooltimetabling.domain.Room
-import org.acme.kotlin.schooltimetabling.domain.Timeslot
-import org.acme.kotlin.schooltimetabling.persistence.LessonRepository
-import org.acme.kotlin.schooltimetabling.persistence.RoomRepository
-import org.acme.kotlin.schooltimetabling.persistence.TimeslotRepository
-import org.eclipse.microprofile.config.inject.ConfigProperty
-import java.time.DayOfWeek
-import java.time.LocalTime
-import jakarta.enterprise.context.ApplicationScoped
-import jakarta.enterprise.event.Observes
-import jakarta.inject.Inject
-import jakarta.transaction.Transactional
-
-
-@ApplicationScoped
-class DemoDataGenerator {
-
- @ConfigProperty(name = "timeTable.demoData", defaultValue = "SMALL")
- lateinit var demoData: DemoData
-
- @Inject
- lateinit var timeslotRepository: TimeslotRepository
- @Inject
- lateinit var roomRepository: RoomRepository
- @Inject
- lateinit var lessonRepository: LessonRepository
-
- @Transactional
- fun generateDemoData(@Observes startupEvent: StartupEvent) {
- if (demoData == DemoData.NONE) {
- return
- }
-
- val timeslotList: MutableList<Timeslot> = mutableListOf(
- Timeslot(DayOfWeek.MONDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)),
- Timeslot(DayOfWeek.MONDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)),
- Timeslot(DayOfWeek.MONDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)),
- Timeslot(DayOfWeek.MONDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)),
- Timeslot(DayOfWeek.MONDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)),
-
- Timeslot(DayOfWeek.TUESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)),
- Timeslot(DayOfWeek.TUESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)),
- Timeslot(DayOfWeek.TUESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)),
- Timeslot(DayOfWeek.TUESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)),
- Timeslot(DayOfWeek.TUESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)))
-
- if (demoData == DemoData.LARGE) {
- timeslotList.addAll(listOf(
- Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)),
- Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)),
- Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)),
- Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)),
- Timeslot(DayOfWeek.WEDNESDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)),
- Timeslot(DayOfWeek.THURSDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)),
- Timeslot(DayOfWeek.THURSDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)),
- Timeslot(DayOfWeek.THURSDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)),
- Timeslot(DayOfWeek.THURSDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)),
- Timeslot(DayOfWeek.THURSDAY, LocalTime.of(14, 30), LocalTime.of(15, 30)),
- Timeslot(DayOfWeek.FRIDAY, LocalTime.of(8, 30), LocalTime.of(9, 30)),
- Timeslot(DayOfWeek.FRIDAY, LocalTime.of(9, 30), LocalTime.of(10, 30)),
- Timeslot(DayOfWeek.FRIDAY, LocalTime.of(10, 30), LocalTime.of(11, 30)),
- Timeslot(DayOfWeek.FRIDAY, LocalTime.of(13, 30), LocalTime.of(14, 30)),
- Timeslot(DayOfWeek.FRIDAY, LocalTime.of(14, 30), LocalTime.of(15, 30))))
- }
- timeslotRepository.persist(timeslotList)
-
-
- val roomList: MutableList<Room> = mutableListOf(
- Room("Room A"),
- Room("Room B"),
- Room("Room C"))
- if (demoData == DemoData.LARGE) {
- roomList.addAll(listOf(
- Room("Room D"),
- Room("Room E"),
- Room("Room F")))
- }
- roomRepository.persist(roomList)
-
-
- val lessonList: MutableList<Lesson> = mutableListOf(
- Lesson("Math", "A. Turing", "9th grade"),
- Lesson("Math", "A. Turing", "9th grade"),
- Lesson("Physics", "M. Curie", "9th grade"),
- Lesson("Chemistry", "M. Curie", "9th grade"),
- Lesson("Biology", "C. Darwin", "9th grade"),
- Lesson("History", "I. Jones", "9th grade"),
- Lesson("English", "I. Jones", "9th grade"),
- Lesson("English", "I. Jones", "9th grade"),
- Lesson("Spanish", "P. Cruz", "9th grade"),
- Lesson("Spanish", "P. Cruz", "9th grade"))
- if (demoData == DemoData.LARGE) {
- lessonList.addAll(listOf(
- Lesson("Math", "A. Turing", "9th grade"),
- Lesson("Math", "A. Turing", "9th grade"),
- Lesson("Math", "A. Turing", "9th grade"),
- Lesson("ICT", "A. Turing", "9th grade"),
- Lesson("Physics", "M. Curie", "9th grade"),
- Lesson("Geography", "C. Darwin", "9th grade"),
- Lesson("Geology", "C. Darwin", "9th grade"),
- Lesson("History", "I. Jones", "9th grade"),
- Lesson("English", "I. Jones", "9th grade"),
- Lesson("Drama", "I. Jones", "9th grade"),
- Lesson("Art", "S. Dali", "9th grade"),
- Lesson("Art", "S. Dali", "9th grade"),
- Lesson("Physical education", "C. Lewis", "9th grade"),
- Lesson("Physical education", "C. Lewis", "9th grade"),
- Lesson("Physical education", "C. Lewis", "9th grade")))
- }
-
- lessonList.addAll(listOf(
- Lesson("Math", "A. Turing", "10th grade"),
- Lesson("Math", "A. Turing", "10th grade"),
- Lesson("Math", "A. Turing", "10th grade"),
- Lesson("Physics", "M. Curie", "10th grade"),
- Lesson("Chemistry", "M. Curie", "10th grade"),
- Lesson("French", "M. Curie", "10th grade"),
- Lesson("Geography", "C. Darwin", "10th grade"),
- Lesson("History", "I. Jones", "10th grade"),
- Lesson("English", "P. Cruz", "10th grade"),
- Lesson("Spanish", "P. Cruz", "10th grade")))
- if (demoData == DemoData.LARGE) {
- lessonList.addAll(listOf(
- Lesson("Math", "A. Turing", "10th grade"),
- Lesson("Math", "A. Turing", "10th grade"),
- Lesson("ICT", "A. Turing", "10th grade"),
- Lesson("Physics", "M. Curie", "10th grade"),
- Lesson("Biology", "C. Darwin", "10th grade"),
- Lesson("Geology", "C. Darwin", "10th grade"),
- Lesson("History", "I. Jones", "10th grade"),
- Lesson("English", "P. Cruz", "10th grade"),
- Lesson("English", "P. Cruz", "10th grade"),
- Lesson("Drama", "I. Jones", "10th grade"),
- Lesson("Art", "S. Dali", "10th grade"),
- Lesson("Art", "S. Dali", "10th grade"),
- Lesson("Physical education", "C. Lewis", "10th grade"),
- Lesson("Physical education", "C. Lewis", "10th grade"),
- Lesson("Physical education", "C. Lewis", "10th grade"),
-
- Lesson("Math", "A. Turing", "11th grade"),
- Lesson("Math", "A. Turing", "11th grade"),
- Lesson("Math", "A. Turing", "11th grade"),
- Lesson("Math", "A. Turing", "11th grade"),
- Lesson("Math", "A. Turing", "11th grade"),
- Lesson("ICT", "A. Turing", "11th grade"),
- Lesson("Physics", "M. Curie", "11th grade"),
- Lesson("Chemistry", "M. Curie", "11th grade"),
- Lesson("French", "M. Curie", "11th grade"),
- Lesson("Physics", "M. Curie", "11th grade"),
- Lesson("Geography", "C. Darwin", "11th grade"),
- Lesson("Biology", "C. Darwin", "11th grade"),
- Lesson("Geology", "C. Darwin", "11th grade"),
- Lesson("History", "I. Jones", "11th grade"),
- Lesson("History", "I. Jones", "11th grade"),
- Lesson("English", "P. Cruz", "11th grade"),
- Lesson("English", "P. Cruz", "11th grade"),
- Lesson("English", "P. Cruz", "11th grade"),
- Lesson("Spanish", "P. Cruz", "11th grade"),
- Lesson("Drama", "P. Cruz", "11th grade"),
- Lesson("Art", "S. Dali", "11th grade"),
- Lesson("Art", "S. Dali", "11th grade"),
- Lesson("Physical education", "C. Lewis", "11th grade"),
- Lesson("Physical education", "C. Lewis", "11th grade"),
- Lesson("Physical education", "C. Lewis", "11th grade"),
-
- Lesson("Math", "A. Turing", "12th grade"),
- Lesson("Math", "A. Turing", "12th grade"),
- Lesson("Math", "A. Turing", "12th grade"),
- Lesson("Math", "A. Turing", "12th grade"),
- Lesson("Math", "A. Turing", "12th grade"),
- Lesson("ICT", "A. Turing", "12th grade"),
- Lesson("Physics", "M. Curie", "12th grade"),
- Lesson("Chemistry", "M. Curie", "12th grade"),
- Lesson("French", "M. Curie", "12th grade"),
- Lesson("Physics", "M. Curie", "12th grade"),
- Lesson("Geography", "C. Darwin", "12th grade"),
- Lesson("Biology", "C. Darwin", "12th grade"),
- Lesson("Geology", "C. Darwin", "12th grade"),
- Lesson("History", "I. Jones", "12th grade"),
- Lesson("History", "I. Jones", "12th grade"),
- Lesson("English", "P. Cruz", "12th grade"),
- Lesson("English", "P. Cruz", "12th grade"),
- Lesson("English", "P. Cruz", "12th grade"),
- Lesson("Spanish", "P. Cruz", "12th grade"),
- Lesson("Drama", "P. Cruz", "12th grade"),
- Lesson("Art", "S. Dali", "12th grade"),
- Lesson("Art", "S. Dali", "12th grade"),
- Lesson("Physical education", "C. Lewis", "12th grade"),
- Lesson("Physical education", "C. Lewis", "12th grade"),
- Lesson("Physical education", "C. Lewis", "12th grade")))
- }
-
- val lesson: Lesson = lessonList[0]
- lesson.timeslot = timeslotList[0]
- lesson.room = roomList[0]
-
- lessonRepository.persist(lessonList)
- }
-
- enum class DemoData {
- NONE, SMALL, LARGE
- }
-
-}
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Lesson.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Lesson.kt
deleted file mode 100644
index 6fdc953..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Lesson.kt
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.acme.kotlin.schooltimetabling.domain
-
-import org.optaplanner.core.api.domain.entity.PlanningEntity
-import org.optaplanner.core.api.domain.lookup.PlanningId
-import org.optaplanner.core.api.domain.variable.PlanningVariable
-import jakarta.persistence.Entity
-import jakarta.persistence.GeneratedValue
-import jakarta.persistence.Id
-import jakarta.persistence.ManyToOne
-
-
-@PlanningEntity
-@Entity
-class Lesson {
-
- @PlanningId
- @Id
- @GeneratedValue
- var id: Long? = null
-
- lateinit var subject: String
- lateinit var teacher: String
- lateinit var studentGroup: String
-
- @PlanningVariable
- @ManyToOne
- var timeslot: Timeslot? = null
- @PlanningVariable
- @ManyToOne
- var room: Room? = null
-
- // No-arg constructor required for Hibernate and OptaPlanner
- constructor()
-
- constructor(subject: String, teacher: String, studentGroup: String) {
- this.subject = subject.trim()
- this.teacher = teacher.trim()
- this.studentGroup = studentGroup.trim()
- }
-
- constructor(id: Long?, subject: String, teacher: String, studentGroup: String, timeslot: Timeslot?, room: Room?)
- : this(subject, teacher, studentGroup) {
- this.id = id
- this.timeslot = timeslot
- this.room = room
- }
-
-
- override fun toString(): String = "$subject($id)"
-
-}
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Room.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Room.kt
deleted file mode 100644
index 8781317..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Room.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.acme.kotlin.schooltimetabling.domain
-
-import jakarta.persistence.Entity
-import jakarta.persistence.GeneratedValue
-import jakarta.persistence.Id
-
-
-@Entity
-class Room {
-
- @Id
- @GeneratedValue
- var id: Long? = null
-
- lateinit var name: String
-
- // No-arg constructor required for Hibernate
- constructor()
-
- constructor(name: String) {
- this.name = name
- }
-
- constructor(id: Long?, name: String)
- : this(name) {
- this.id = id
- }
-
- override fun toString(): String = name
-
-}
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/TimeTable.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/TimeTable.kt
deleted file mode 100644
index d138262..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/TimeTable.kt
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.acme.kotlin.schooltimetabling.domain
-
-import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty
-import org.optaplanner.core.api.domain.solution.PlanningScore
-import org.optaplanner.core.api.domain.solution.PlanningSolution
-import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty
-import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore
-import org.optaplanner.core.api.solver.SolverStatus
-
-@PlanningSolution
-class TimeTable {
-
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- lateinit var timeslotList: List<Timeslot>
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- lateinit var roomList: List<Room>
- @PlanningEntityCollectionProperty
- lateinit var lessonList: List<Lesson>
-
- @PlanningScore
- var score: HardSoftScore? = null
-
- // Ignored by OptaPlanner, used by the UI to display solve or stop solving button
- var solverStatus: SolverStatus? = null
-
- // No-arg constructor required for OptaPlanner
- constructor() {}
-
- constructor(timeslotList: List<Timeslot>, roomList: List<Room>, lessonList: List<Lesson>) {
- this.timeslotList = timeslotList
- this.roomList = roomList
- this.lessonList = lessonList
- }
-
-}
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Timeslot.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Timeslot.kt
deleted file mode 100644
index 1affa12..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/domain/Timeslot.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.acme.kotlin.schooltimetabling.domain
-
-import java.time.DayOfWeek
-import java.time.LocalTime
-import jakarta.persistence.Entity
-import jakarta.persistence.GeneratedValue
-import jakarta.persistence.Id
-
-
-@Entity
-class Timeslot {
-
- @Id
- @GeneratedValue
- var id: Long? = null
-
- lateinit var dayOfWeek: DayOfWeek
- lateinit var startTime: LocalTime
- lateinit var endTime: LocalTime
-
- // No-arg constructor required for Hibernate
- constructor()
-
- constructor(dayOfWeek: DayOfWeek, startTime: LocalTime, endTime: LocalTime) {
- this.dayOfWeek = dayOfWeek
- this.startTime = startTime
- this.endTime = endTime
- }
-
- constructor(id: Long?, dayOfWeek: DayOfWeek, startTime: LocalTime, endTime: LocalTime)
- : this(dayOfWeek, startTime, endTime) {
- this.id = id
- }
-
- override fun toString(): String = "$dayOfWeek $startTime"
-
-}
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/LessonRepository.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/LessonRepository.kt
deleted file mode 100644
index 2630efa..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/LessonRepository.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.acme.kotlin.schooltimetabling.persistence
-
-import io.quarkus.hibernate.orm.panache.kotlin.PanacheRepository
-import org.acme.kotlin.schooltimetabling.domain.Lesson
-import jakarta.enterprise.context.ApplicationScoped
-
-@ApplicationScoped
-class LessonRepository : PanacheRepository<Lesson>
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/RoomRepository.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/RoomRepository.kt
deleted file mode 100644
index c4e788e..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/RoomRepository.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.acme.kotlin.schooltimetabling.persistence
-
-import io.quarkus.hibernate.orm.panache.kotlin.PanacheRepository
-import org.acme.kotlin.schooltimetabling.domain.Room
-import jakarta.enterprise.context.ApplicationScoped
-
-@ApplicationScoped
-class RoomRepository : PanacheRepository<Room>
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/TimeslotRepository.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/TimeslotRepository.kt
deleted file mode 100644
index 25ef263..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/persistence/TimeslotRepository.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.acme.kotlin.schooltimetabling.persistence
-
-import io.quarkus.hibernate.orm.panache.kotlin.PanacheRepository
-import org.acme.kotlin.schooltimetabling.domain.Timeslot
-import jakarta.enterprise.context.ApplicationScoped
-
-@ApplicationScoped
-class TimeslotRepository : PanacheRepository<Timeslot>
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/rest/TimeTableResource.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/rest/TimeTableResource.kt
deleted file mode 100644
index a4219bd..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/rest/TimeTableResource.kt
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.acme.kotlin.schooltimetabling.rest
-
-import io.quarkus.panache.common.Sort
-import org.acme.kotlin.schooltimetabling.domain.Lesson
-import org.acme.kotlin.schooltimetabling.domain.TimeTable
-import org.acme.kotlin.schooltimetabling.persistence.LessonRepository
-import org.acme.kotlin.schooltimetabling.persistence.RoomRepository
-import org.acme.kotlin.schooltimetabling.persistence.TimeslotRepository
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore
-import org.optaplanner.core.api.solver.SolutionManager
-import org.optaplanner.core.api.solver.SolverManager
-import org.optaplanner.core.api.solver.SolverStatus
-import jakarta.inject.Inject
-import jakarta.transaction.Transactional
-import jakarta.ws.rs.GET
-import jakarta.ws.rs.POST
-import jakarta.ws.rs.Path
-
-
-@Path("timeTable")
-class TimeTableResource {
-
- val SINGLETON_TIME_TABLE_ID = 1L
-
- @Inject
- lateinit var timeslotRepository: TimeslotRepository
- @Inject
- lateinit var roomRepository: RoomRepository
- @Inject
- lateinit var lessonRepository: LessonRepository
-
- @Inject
- lateinit var solverManager: SolverManager<TimeTable, Long>
- @Inject
- lateinit var solutionManager: SolutionManager<TimeTable, HardSoftScore>
-
- // To try, open http://localhost:8080/timeTable
- @GET
- fun getTimeTable(): TimeTable {
- // Get the solver status before loading the solution
- // to avoid the race condition that the solver terminates between them
- val solverStatus = getSolverStatus()
- val solution: TimeTable = findById(SINGLETON_TIME_TABLE_ID)
- solutionManager.update(solution) // Sets the score
- solution.solverStatus = solverStatus
- return solution
- }
-
- @POST
- @Path("solve")
- fun solve() {
- solverManager.solveAndListen(SINGLETON_TIME_TABLE_ID,
- this::findById,
- this::save)
- }
-
- fun getSolverStatus(): SolverStatus {
- return solverManager.getSolverStatus(SINGLETON_TIME_TABLE_ID)
- }
-
- @POST
- @Path("stopSolving")
- fun stopSolving() {
- solverManager.terminateEarly(SINGLETON_TIME_TABLE_ID)
- }
-
- @Transactional
- protected fun findById(id: Long): TimeTable {
- check(SINGLETON_TIME_TABLE_ID == id) { "There is no timeTable with id ($id)." }
- // Occurs in a single transaction, so each initialized lesson references the same timeslot/room instance
- // that is contained by the timeTable's timeslotList/roomList.
- return TimeTable(
- timeslotRepository.listAll(Sort.by("dayOfWeek").and("startTime").and("endTime").and("id")),
- roomRepository.listAll(Sort.by("name").and("id")),
- lessonRepository.listAll(Sort.by("subject").and("teacher").and("studentGroup").and("id")))
- }
-
- @Transactional
- protected fun save(timeTable: TimeTable) {
- for (lesson in timeTable.lessonList) {
- // TODO this is awfully naive: optimistic locking causes issues if called by the SolverManager
- val attachedLesson: Lesson = lessonRepository.findById(lesson.id!!)!!
- attachedLesson.timeslot = lesson.timeslot
- attachedLesson.room = lesson.room
- }
- }
-
-}
diff --git a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/solver/TimeTableConstraintProvider.kt b/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/solver/TimeTableConstraintProvider.kt
deleted file mode 100644
index 556d20a..0000000
--- a/technology/kotlin-quarkus/src/main/kotlin/org/acme/kotlin/schooltimetabling/solver/TimeTableConstraintProvider.kt
+++ /dev/null
@@ -1,115 +0,0 @@
-package org.acme.kotlin.schooltimetabling.solver
-
-import org.acme.kotlin.schooltimetabling.domain.Lesson
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore
-import org.optaplanner.core.api.score.stream.Constraint
-import org.optaplanner.core.api.score.stream.ConstraintFactory
-import org.optaplanner.core.api.score.stream.ConstraintProvider
-import org.optaplanner.core.api.score.stream.Joiners
-import java.time.Duration
-
-class TimeTableConstraintProvider : ConstraintProvider {
-
- override fun defineConstraints(constraintFactory: ConstraintFactory): Array<Constraint>? {
- return arrayOf(
- // Hard constraints
- roomConflict(constraintFactory),
- teacherConflict(constraintFactory),
- studentGroupConflict(constraintFactory),
- // Soft constraints
- teacherRoomStability(constraintFactory),
- teacherTimeEfficiency(constraintFactory),
- studentGroupSubjectVariety(constraintFactory)
- )
- }
-
- fun roomConflict(constraintFactory: ConstraintFactory): Constraint {
- // A room can accommodate at most one lesson at the same time.
- return constraintFactory
- // Select each pair of 2 different lessons ...
- .forEachUniquePair(
- Lesson::class.java,
- // ... in the same timeslot ...
- Joiners.equal(Lesson::timeslot),
- // ... in the same room ...
- Joiners.equal(Lesson::room)
- )
- // ... and penalize each pair with a hard weight.
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Room conflict");
- }
-
- fun teacherConflict(constraintFactory: ConstraintFactory): Constraint {
- // A teacher can teach at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(
- Lesson::class.java,
- Joiners.equal(Lesson::timeslot),
- Joiners.equal(Lesson::teacher)
- )
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Teacher conflict");
- }
-
- fun studentGroupConflict(constraintFactory: ConstraintFactory): Constraint {
- // A student can attend at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(
- Lesson::class.java,
- Joiners.equal(Lesson::timeslot),
- Joiners.equal(Lesson::studentGroup)
- )
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Student group conflict");
- }
-
- fun teacherRoomStability(constraintFactory: ConstraintFactory): Constraint {
- // A teacher prefers to teach in a single room.
- return constraintFactory
- .forEachUniquePair(
- Lesson::class.java,
- Joiners.equal(Lesson::teacher)
- )
- .filter { lesson1: Lesson, lesson2: Lesson -> lesson1.room !== lesson2.room }
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher room stability");
- }
-
- fun teacherTimeEfficiency(constraintFactory: ConstraintFactory): Constraint {
- // A teacher prefers to teach sequential lessons and dislikes gaps between lessons.
- return constraintFactory
- .forEach(Lesson::class.java)
- .join(Lesson::class.java,
- Joiners.equal(Lesson::teacher),
- Joiners.equal { lesson: Lesson -> lesson.timeslot?.dayOfWeek })
- .filter { lesson1: Lesson, lesson2: Lesson ->
- val between = Duration.between(
- lesson1.timeslot?.endTime,
- lesson2.timeslot?.startTime
- )
- !between.isNegative && between.compareTo(Duration.ofMinutes(30)) <= 0
- }
- .reward(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher time efficiency");
- }
-
- fun studentGroupSubjectVariety(constraintFactory: ConstraintFactory): Constraint {
- // A student group dislikes sequential lessons on the same subject.
- return constraintFactory
- .forEach(Lesson::class.java)
- .join(Lesson::class.java,
- Joiners.equal(Lesson::subject),
- Joiners.equal(Lesson::studentGroup),
- Joiners.equal { lesson: Lesson -> lesson.timeslot?.dayOfWeek })
- .filter { lesson1: Lesson, lesson2: Lesson ->
- val between = Duration.between(
- lesson1.timeslot?.endTime,
- lesson2.timeslot?.startTime
- )
- !between.isNegative && between.compareTo(Duration.ofMinutes(30)) <= 0
- }
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Student group subject variety");
- }
-
-}
diff --git a/technology/kotlin-quarkus/src/main/kubernetes/openshift.yml b/technology/kotlin-quarkus/src/main/kubernetes/openshift.yml
deleted file mode 100644
index 6e3e6c6..0000000
--- a/technology/kotlin-quarkus/src/main/kubernetes/openshift.yml
+++ /dev/null
@@ -1,145 +0,0 @@
-apiVersion: v1
-items:
- - apiVersion: v1
- kind: Secret
- metadata:
- annotations:
- template.openshift.io/expose-database_name: '{.data[''database-name'']}'
- template.openshift.io/expose-password: '{.data[''database-password'']}'
- template.openshift.io/expose-username: '{.data[''database-user'']}'
- labels:
- app: postgresql
- app.kubernetes.io/component: postgresql
- app.kubernetes.io/instance: postgresql
- app.kubernetes.io/part-of: kotlin-school-timetabling
- template: postgresql-ephemeral-template
- name: postgresql-kotlin-school-timetabling
- stringData:
- database-name: app
- database-password: app
- database-user: app
- - apiVersion: v1
- kind: Service
- metadata:
- annotations:
- openshift.io/generated-by: OpenShiftNewApp
- template.openshift.io/expose-uri: postgres://{.spec.clusterIP}:{.spec.ports[?(.name=="postgresql")].port}
- labels:
- app: postgresql
- app.kubernetes.io/component: postgresql
- app.kubernetes.io/instance: postgresql
- app.kubernetes.io/part-of: kotlin-school-timetabling
- template: postgresql-ephemeral-template
- name: postgresql-kotlin-school-timetabling
- spec:
- ports:
- - name: postgresql-kotlin-school-timetabling
- port: 5432
- protocol: TCP
- targetPort: 5432
- selector:
- name: postgresql
- sessionAffinity: None
- type: ClusterIP
- status:
- loadBalancer: {}
- - apiVersion: apps.openshift.io/v1
- kind: DeploymentConfig
- metadata:
- annotations:
- openshift.io/generated-by: OpenShiftNewApp
- template.alpha.openshift.io/wait-for-ready: "true"
- labels:
- app: postgresql
- app.kubernetes.io/component: postgresql
- app.kubernetes.io/instance: postgresql
- app.kubernetes.io/part-of: kotlin-school-timetabling
- template: postgresql-ephemeral-template
- name: postgresql-kotlin-school-timetabling
- spec:
- replicas: 1
- selector:
- name: postgresql
- strategy:
- resources: {}
- type: Recreate
- template:
- metadata:
- annotations:
- openshift.io/generated-by: OpenShiftNewApp
- creationTimestamp: null
- labels:
- name: postgresql
- spec:
- containers:
- - env:
- - name: POSTGRESQL_USER
- valueFrom:
- secretKeyRef:
- key: database-user
- name: postgresql-kotlin-school-timetabling
- - name: POSTGRESQL_PASSWORD
- valueFrom:
- secretKeyRef:
- key: database-password
- name: postgresql-kotlin-school-timetabling
- - name: POSTGRESQL_DATABASE
- valueFrom:
- secretKeyRef:
- key: database-name
- name: postgresql-kotlin-school-timetabling
- image: ' '
- imagePullPolicy: IfNotPresent
- livenessProbe:
- exec:
- command:
- - /usr/libexec/check-container
- - --live
- initialDelaySeconds: 120
- timeoutSeconds: 10
- name: postgresql
- ports:
- - containerPort: 5432
- protocol: TCP
- readinessProbe:
- exec:
- command:
- - /usr/libexec/check-container
- initialDelaySeconds: 5
- timeoutSeconds: 1
- resources:
- limits:
- memory: 512Mi
- securityContext:
- capabilities: {}
- privileged: false
- terminationMessagePath: /dev/termination-log
- volumeMounts:
- - mountPath: /var/lib/pgsql/data
- name: postgresql-data
- dnsPolicy: ClusterFirst
- restartPolicy: Always
- volumes:
- - emptyDir: {}
- name: postgresql-data
- test: false
- triggers:
- - imageChangeParams:
- automatic: true
- containerNames:
- - postgresql
- from:
- kind: ImageStreamTag
- name: postgresql:10-el8
- namespace: openshift
- type: ImageChange
- - type: ConfigChange
- status:
- availableReplicas: 0
- latestVersion: 0
- observedGeneration: 0
- replicas: 0
- unavailableReplicas: 0
- updatedReplicas: 0
-kind: List
-metadata: {}
\ No newline at end of file
diff --git a/technology/kotlin-quarkus/src/main/resources/META-INF/resources/app.js b/technology/kotlin-quarkus/src/main/resources/META-INF/resources/app.js
deleted file mode 100644
index 97bd630..0000000
--- a/technology/kotlin-quarkus/src/main/resources/META-INF/resources/app.js
+++ /dev/null
@@ -1,344 +0,0 @@
-var autoRefreshIntervalId = null;
-const dateTimeFormatter = JSJoda.DateTimeFormatter.ofPattern('HH:mm')
-
-function refreshTimeTable() {
- $.getJSON("/timeTable", function (timeTable) {
- refreshSolvingButtons(timeTable.solverStatus != null && timeTable.solverStatus !== "NOT_SOLVING");
- $("#score").text("Score: " + (timeTable.score == null ? "?" : timeTable.score));
-
- const timeTableByRoom = $("#timeTableByRoom");
- timeTableByRoom.children().remove();
- const timeTableByTeacher = $("#timeTableByTeacher");
- timeTableByTeacher.children().remove();
- const timeTableByStudentGroup = $("#timeTableByStudentGroup");
- timeTableByStudentGroup.children().remove();
- const unassignedLessons = $("#unassignedLessons");
- unassignedLessons.children().remove();
-
- const theadByRoom = $("<thead>").appendTo(timeTableByRoom);
- const headerRowByRoom = $("<tr>").appendTo(theadByRoom);
- headerRowByRoom.append($("<th>Timeslot</th>"));
- $.each(timeTable.roomList, (index, room) => {
- headerRowByRoom
- .append($("<th/>")
- .append($("<span/>").text(room.name))
- .append($(`<button type="button" class="ml-2 mb-1 btn btn-light btn-sm p-1"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteRoom(room))));
- });
- const theadByTeacher = $("<thead>").appendTo(timeTableByTeacher);
- const headerRowByTeacher = $("<tr>").appendTo(theadByTeacher);
- headerRowByTeacher.append($("<th>Timeslot</th>"));
- const teacherList = [...new Set(timeTable.lessonList.map(lesson => lesson.teacher))];
- $.each(teacherList, (index, teacher) => {
- headerRowByTeacher
- .append($("<th/>")
- .append($("<span/>").text(teacher)));
- });
- const theadByStudentGroup = $("<thead>").appendTo(timeTableByStudentGroup);
- const headerRowByStudentGroup = $("<tr>").appendTo(theadByStudentGroup);
- headerRowByStudentGroup.append($("<th>Timeslot</th>"));
- const studentGroupList = [...new Set(timeTable.lessonList.map(lesson => lesson.studentGroup))];
- $.each(studentGroupList, (index, studentGroup) => {
- headerRowByStudentGroup
- .append($("<th/>")
- .append($("<span/>").text(studentGroup)));
- });
-
- const tbodyByRoom = $("<tbody>").appendTo(timeTableByRoom);
- const tbodyByTeacher = $("<tbody>").appendTo(timeTableByTeacher);
- const tbodyByStudentGroup = $("<tbody>").appendTo(timeTableByStudentGroup);
-
- const LocalTime = JSJoda.LocalTime;
-
- $.each(timeTable.timeslotList, (index, timeslot) => {
- const rowByRoom = $("<tr>").appendTo(tbodyByRoom);
- rowByRoom
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)
- .append($(`<button type="button" class="ml-2 mb-1 btn btn-light btn-sm p-1"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteTimeslot(timeslot)))));
- $.each(timeTable.roomList, (index, room) => {
- rowByRoom.append($("<td/>").prop("id", `timeslot${timeslot.id}room${room.id}`));
- });
-
- const rowByTeacher = $("<tr>").appendTo(tbodyByTeacher);
- rowByTeacher
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)));
- $.each(teacherList, (index, teacher) => {
- rowByTeacher.append($("<td/>").prop("id", `timeslot${timeslot.id}teacher${convertToId(teacher)}`));
- });
-
- const rowByStudentGroup = $("<tr>").appendTo(tbodyByStudentGroup);
- rowByStudentGroup
- .append($(`<th class="align-middle"/>`)
- .append($("<span/>").text(`
- ${timeslot.dayOfWeek.charAt(0) + timeslot.dayOfWeek.slice(1).toLowerCase()}
- ${LocalTime.parse(timeslot.startTime).format(dateTimeFormatter)}
- -
- ${LocalTime.parse(timeslot.endTime).format(dateTimeFormatter)}
- `)));
- $.each(studentGroupList, (index, studentGroup) => {
- rowByStudentGroup.append($("<td/>").prop("id", `timeslot${timeslot.id}studentGroup${convertToId(studentGroup)}`));
- });
- });
-
- $.each(timeTable.lessonList, (index, lesson) => {
- const color = pickColor(lesson.subject);
- const lessonElementWithoutDelete = $(`<div class="card" style="background-color: ${color}"/>`)
- .append($(`<div class="card-body p-2"/>`)
- .append($(`<h5 class="card-title mb-1"/>`).text(lesson.subject))
- .append($(`<p class="card-text ml-2 mb-1"/>`)
- .append($(`<em/>`).text(`by ${lesson.teacher}`)))
- .append($(`<small class="ml-2 mt-1 card-text text-muted align-bottom float-right"/>`).text(lesson.id))
- .append($(`<p class="card-text ml-2"/>`).text(lesson.studentGroup)));
- const lessonElement = lessonElementWithoutDelete.clone();
- lessonElement.find(".card-body").prepend(
- $(`<button type="button" class="ml-2 btn btn-light btn-sm p-1 float-right"/>`)
- .append($(`<small class="fas fa-trash"/>`)
- ).click(() => deleteLesson(lesson))
- );
- if (lesson.timeslot == null || lesson.room == null) {
- unassignedLessons.append(lessonElement);
- } else {
- $(`#timeslot${lesson.timeslot.id}room${lesson.room.id}`).append(lessonElement);
- $(`#timeslot${lesson.timeslot.id}teacher${convertToId(lesson.teacher)}`).append(lessonElementWithoutDelete.clone());
- $(`#timeslot${lesson.timeslot.id}studentGroup${convertToId(lesson.studentGroup)}`).append(lessonElementWithoutDelete.clone());
- }
- });
- });
-}
-
-function convertToId(str) {
- // Base64 encoding without padding to avoid XSS
- return btoa(str).replace(/=/g, "");
-}
-
-function solve() {
- $.post("/timeTable/solve", function () {
- refreshSolvingButtons(true);
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Start solving failed.", xhr);
- });
-}
-
-function refreshSolvingButtons(solving) {
- if (solving) {
- $("#solveButton").hide();
- $("#stopSolvingButton").show();
- if (autoRefreshIntervalId == null) {
- autoRefreshIntervalId = setInterval(refreshTimeTable, 2000);
- }
- } else {
- $("#solveButton").show();
- $("#stopSolvingButton").hide();
- if (autoRefreshIntervalId != null) {
- clearInterval(autoRefreshIntervalId);
- autoRefreshIntervalId = null;
- }
- }
-}
-
-function stopSolving() {
- $.post("/timeTable/stopSolving", function () {
- refreshSolvingButtons(false);
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Stop solving failed.", xhr);
- });
-}
-
-function addLesson() {
- var subject = $("#lesson_subject").val().trim();
- $.post("/lessons", JSON.stringify({
- "subject": subject,
- "teacher": $("#lesson_teacher").val().trim(),
- "studentGroup": $("#lesson_studentGroup").val().trim()
- }), function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Adding lesson (" + subject + ") failed.", xhr);
- });
- $('#lessonDialog').modal('toggle');
-}
-
-function deleteLesson(lesson) {
- $.delete("/lessons/" + lesson.id, function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Deleting lesson (" + lesson.name + ") failed.", xhr);
- });
-}
-
-function addTimeslot() {
- $.post("/timeslots", JSON.stringify({
- "dayOfWeek": $("#timeslot_dayOfWeek").val().trim().toUpperCase(),
- "startTime": $("#timeslot_startTime").val().trim(),
- "endTime": $("#timeslot_endTime").val().trim()
- }), function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Adding timeslot failed.", xhr);
- });
- $('#timeslotDialog').modal('toggle');
-}
-
-function deleteTimeslot(timeslot) {
- $.delete("/timeslots/" + timeslot.id, function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Deleting timeslot (" + timeslot.name + ") failed.", xhr);
- });
-}
-
-function addRoom() {
- var name = $("#room_name").val().trim();
- $.post("/rooms", JSON.stringify({
- "name": name
- }), function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Adding room (" + name + ") failed.", xhr);
- });
- $("#roomDialog").modal('toggle');
-}
-
-function deleteRoom(room) {
- $.delete("/rooms/" + room.id, function () {
- refreshTimeTable();
- }).fail(function (xhr, ajaxOptions, thrownError) {
- showError("Deleting room (" + room.name + ") failed.", xhr);
- });
-}
-
-function showError(title, xhr) {
- const serverErrorMessage = !xhr.responseJSON ? `${xhr.status}: ${xhr.statusText}` : xhr.responseJSON.message;
- console.error(title + "\n" + serverErrorMessage);
- const notification = $(`<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" style="min-width: 30rem"/>`)
- .append($(`<div class="toast-header bg-danger">
- <strong class="mr-auto text-dark">Error</strong>
- <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>`))
- .append($(`<div class="toast-body"/>`)
- .append($(`<p/>`).text(title))
- .append($(`<pre/>`)
- .append($(`<code/>`).text(serverErrorMessage))
- )
- );
- $("#notificationPanel").append(notification);
- notification.toast({delay: 30000});
- notification.toast('show');
-}
-
-$(document).ready(function () {
- $.ajaxSetup({
- headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json'
- }
- });
- // Extend jQuery to support $.put() and $.delete()
- jQuery.each(["put", "delete"], function (i, method) {
- jQuery[method] = function (url, data, callback, type) {
- if (jQuery.isFunction(data)) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
- return jQuery.ajax({
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- });
- };
- });
-
- $("#refreshButton").click(function () {
- refreshTimeTable();
- });
- $("#solveButton").click(function () {
- solve();
- });
- $("#stopSolvingButton").click(function () {
- stopSolving();
- });
- $("#addLessonSubmitButton").click(function () {
- addLesson();
- });
- $("#addTimeslotSubmitButton").click(function () {
- addTimeslot();
- });
- $("#addRoomSubmitButton").click(function () {
- addRoom();
- });
-
- refreshTimeTable();
-});
-
-// ****************************************************************************
-// TangoColorFactory
-// ****************************************************************************
-
-const SEQUENCE_1 = [0x8AE234, 0xFCE94F, 0x729FCF, 0xE9B96E, 0xAD7FA8];
-const SEQUENCE_2 = [0x73D216, 0xEDD400, 0x3465A4, 0xC17D11, 0x75507B];
-
-var colorMap = new Map;
-var nextColorCount = 0;
-
-function pickColor(object) {
- let color = colorMap[object];
- if (color !== undefined) {
- return color;
- }
- color = nextColor();
- colorMap[object] = color;
- return color;
-}
-
-function nextColor() {
- let color;
- let colorIndex = nextColorCount % SEQUENCE_1.length;
- let shadeIndex = Math.floor(nextColorCount / SEQUENCE_1.length);
- if (shadeIndex === 0) {
- color = SEQUENCE_1[colorIndex];
- } else if (shadeIndex === 1) {
- color = SEQUENCE_2[colorIndex];
- } else {
- shadeIndex -= 3;
- let floorColor = SEQUENCE_2[colorIndex];
- let ceilColor = SEQUENCE_1[colorIndex];
- let base = Math.floor((shadeIndex / 2) + 1);
- let divisor = 2;
- while (base >= divisor) {
- divisor *= 2;
- }
- base = (base * 2) - divisor + 1;
- let shadePercentage = base / divisor;
- color = buildPercentageColor(floorColor, ceilColor, shadePercentage);
- }
- nextColorCount++;
- return "#" + color.toString(16);
-}
-
-function buildPercentageColor(floorColor, ceilColor, shadePercentage) {
- let red = (floorColor & 0xFF0000) + Math.floor(shadePercentage * ((ceilColor & 0xFF0000) - (floorColor & 0xFF0000))) & 0xFF0000;
- let green = (floorColor & 0x00FF00) + Math.floor(shadePercentage * ((ceilColor & 0x00FF00) - (floorColor & 0x00FF00))) & 0x00FF00;
- let blue = (floorColor & 0x0000FF) + Math.floor(shadePercentage * ((ceilColor & 0x0000FF) - (floorColor & 0x0000FF))) & 0x0000FF;
- return red | green | blue;
-}
diff --git a/technology/kotlin-quarkus/src/main/resources/META-INF/resources/index.html b/technology/kotlin-quarkus/src/main/resources/META-INF/resources/index.html
deleted file mode 100644
index fed3fea..0000000
--- a/technology/kotlin-quarkus/src/main/resources/META-INF/resources/index.html
+++ /dev/null
@@ -1,178 +0,0 @@
-<html lang="en">
-<head>
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
- <meta content="width=device-width, initial-scale=1" name="viewport">
- <title>School timetabling - OptaPlanner Kotlin Quarkus</title>
- <link rel="stylesheet" href="/webjars/bootstrap/css/bootstrap.min.css" />
- <link rel="stylesheet" href="/webjars/font-awesome/css/all.css" />
-</head>
-<body>
-<div class="container">
- <nav class="navbar navbar-expand-lg navbar-light bg-light">
- <a class="navbar-brand" href="https://www.optaplanner.org">
- <img src="optaPlannerLogo200px.png" alt="OptaPlanner logo">
- </a>
- </nav>
- <div class="sticky-top d-flex justify-content-center align-items-center" aria-live="polite" aria-atomic="true">
- <div id="notificationPanel" style="position: absolute; top: .5rem;"></div>
- </div>
- <h1>High school time table solver</h1>
- <p>Generate the optimal schedule for your teachers and students.</p>
-
- <div class="mb-2">
- <button id="refreshButton" type="button" class="btn btn-secondary">
- <span class="fas fa-refresh"></span> Refresh
- </button>
- <button id="solveButton" type="button" class="btn btn-success">
- <span class="fas fa-play"></span> Solve
- </button>
- <button id="stopSolvingButton" type="button" class="btn btn-danger">
- <span class="fas fa-stop"></span> Stop solving
- </button>
- <span id="score" class="score ml-2 align-middle font-weight-bold">Score: ?</span>
-
- <div class="float-right">
- <ul class="nav nav-pills" id="myTab" role="tablist">
- <li class="nav-item">
- <a class="nav-link active" id="byRoomTab" data-toggle="tab" href="#byRoomPanel" role="tab" aria-controls="byRoomPanel" aria-selected="true">By room</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="byTeacherTab" data-toggle="tab" href="#byTeacher" role="tab" aria-controls="byTeacher" aria-selected="false">By teacher</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="byStudentGroupTab" data-toggle="tab" href="#byStudentGroup" role="tab" aria-controls="byStudentGroup" aria-selected="false">By student group</a>
- </li>
- </ul>
- </div>
- </div>
- <div class="tab-content" id="myTabContent">
- <div class="tab-pane fade show active" id="byRoomPanel" role="tabpanel" aria-labelledby="byRoomTab">
- <table class="table table-borderless table-striped" id="timeTableByRoom">
- <!-- Filled in by app.js -->
- </table>
- </div>
- <div class="tab-pane fade" id="byTeacher" role="tabpanel" aria-labelledby="byTeacherTab">
- <table class="table table-borderless table-striped" id="timeTableByTeacher">
- <!-- Filled in by app.js -->
- </table>
- </div>
- <div class="tab-pane fade" id="byStudentGroup" role="tabpanel" aria-labelledby="byStudentGroupTab">
- <table class="table table-borderless table-striped" id="timeTableByStudentGroup">
- <!-- Filled in by app.js -->
- </table>
- </div>
- </div>
- <div class="mb-4">
- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#lessonDialog">
- <span class="fas fa-plus"></span> Add lesson
- </button>
- <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#timeslotDialog">
- <span class="fas fa-plus"></span> Add timeslot
- </button>
- <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#roomDialog">
- <span class="fas fa-plus"></span> Add room
- </button>
- </div>
-
- <h2>Unassigned lessons</h2>
- <div id="unassignedLessons" class="card-columns"></div>
-</div>
-
-
-<div class="modal fade" id="lessonDialog" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4>Add a lesson</h4>
- <button type="button" class="close" data-dismiss="modal">
- <span>×</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label for="lesson_subject">Subject</label>
- <input type="text" class="form-control" id="lesson_subject" required value="Music">
- </div>
- <div class="form-group">
- <label for="lesson_teacher">Teacher</label>
- <input type="text" class="form-control" id="lesson_teacher" required value="B. May">
- </div>
- <div class="form-group">
- <label for="lesson_studentGroup">Student group</label>
- <input type="text" class="form-control" id="lesson_studentGroup" required value="11th grade">
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="addLessonSubmitButton">Submit new lesson</button>
- </div>
- </div>
- </div>
- </div>
-</div>
-<div class="modal fade" id="timeslotDialog" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4>Add a timeslot</h4>
- <button type="button" class="close" data-dismiss="modal">
- <span>×</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label for="timeslot_dayOfWeek">Day of week</label>
- <select class="form-control" id="timeslot_dayOfWeek" required>
- <option>Monday</option>
- <option>Tuesday</option>
- <option selected="selected">Wednesday</option>
- <option>Thursday</option>
- <option>Friday</option>
- <option>Saturday</option>
- <option>Sunday</option>
- </select>
- </div>
- <div class="form-group">
- <label for="timeslot_startTime">Start time</label>
- <input type="time" class="form-control" id="timeslot_startTime" required value="08:30"/>
- </div>
- <div class="form-group">
- <label for="timeslot_endTime">End time</label>
- <input type="time" class="form-control" id="timeslot_endTime" required value="09:30">
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="addTimeslotSubmitButton">Submit new timeslot</button>
- </div>
- </div>
- </div>
- </div>
-</div>
-<div class="modal fade" id="roomDialog" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4>Add a room</h4>
- <button type="button" class="close" data-dismiss="modal">
- <span>×</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label for="room_name">Name</label>
- <input type="text" class="form-control" id="room_name" required value="Room D">
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="addRoomSubmitButton">Submit new room</button>
- </div>
- </div>
- </div>
- </div>
-</div>
-
-<script src="/webjars/jquery/jquery.min.js"></script>
-<script src="/webjars/bootstrap/js/bootstrap.min.js"></script>
-<script src="/webjars/js-joda/dist/js-joda.min.js"></script>
-<script src="/app.js"></script>
-</body>
-</html>
diff --git a/technology/kotlin-quarkus/src/main/resources/META-INF/resources/optaPlannerLogo200px.png b/technology/kotlin-quarkus/src/main/resources/META-INF/resources/optaPlannerLogo200px.png
deleted file mode 100644
index 63abac7..0000000
Binary files a/technology/kotlin-quarkus/src/main/resources/META-INF/resources/optaPlannerLogo200px.png and /dev/null differ
diff --git a/technology/kotlin-quarkus/src/main/resources/application.properties b/technology/kotlin-quarkus/src/main/resources/application.properties
deleted file mode 100644
index e7abebd..0000000
--- a/technology/kotlin-quarkus/src/main/resources/application.properties
+++ /dev/null
@@ -1,77 +0,0 @@
-########################
-# General properties
-########################
-# Enable CORS for runQuickstartsFromSource.sh
-quarkus.http.cors=true
-# Allow all origins in dev-mode
-%dev.quarkus.http.cors.origins=/.*/
-
-########################
-# Demo properties
-########################
-
-# The demo dataset size: NONE, SMALL, LARGE
-# timeTable.demoData=LARGE
-
-########################
-# OptaPlanner properties
-########################
-
-# The solver runs for 30 seconds. To run for 5 minutes use "5m" and for 2 hours use "2h".
-quarkus.optaplanner.solver.termination.spent-limit=30s
-
-# To change how many solvers to run in parallel
-# optaplanner.solver-manager.parallel-solver-count=4
-# To run increase CPU cores usage per solver
-# quarkus.optaplanner.solver.move-thread-count=2
-
-# Temporary comment this out to detect bugs in your code (lowers performance)
-# quarkus.optaplanner.solver.environment-mode=FULL_ASSERT
-# To see what OptaPlanner is doing, turn on DEBUG or TRACE logging.
-quarkus.log.category."org.optaplanner".level=DEBUG
-%test.quarkus.log.category."org.optaplanner".level=INFO
-%prod.quarkus.log.category."org.optaplanner".level=INFO
-
-# XML file for power tweaking, defaults to solverConfig.xml (directly under src/main/resources)
-# quarkus.optaplanner.solver-config-xml=org/.../timeTableSolverConfig.xml
-
-########################
-# Database properties
-########################
-
-# "jdbc:h2:mem" doesn't work in native mode, but native mode uses %prod properties
-quarkus.datasource.db-kind=h2
-quarkus.datasource.jdbc.url=jdbc:h2:mem:school-timetabling;DB_CLOSE_DELAY=-1
-quarkus.hibernate-orm.database.generation=drop-and-create
-
-########################
-# Test overrides
-########################
-
-%test.quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:school-timetabling
-
-# Effectively disable spent-time termination in favor of the best-score-limit
-%test.quarkus.optaplanner.solver.termination.spent-limit=1h
-%test.quarkus.optaplanner.solver.termination.best-score-limit=0hard/*soft
-
-########################
-# Native overrides
-########################
-
-# In pom.xml, the "native" maven profile triggers the "native" quarkus profile.
-%native.quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:school-timetabling
-
-########################
-# Optional overrides for use in OpenShift
-########################
-%openshift-native.quarkus.openshift.name=kotlin-school-timetabling
-%openshift-native.quarkus.openshift.part-of=kotlin-school-timetabling
-%openshift-native.quarkus.openshift.route.expose=true
-%openshift-native.quarkus.datasource.db-kind=postgresql
-%openshift-native.quarkus.datasource.jdbc.url=jdbc:postgresql://postgresql-kotlin-school-timetabling/app
-
-# Note: Do not store username and password in application.properties for a production application;
-# Use .env or environment variables instead
-%openshift-native.quarkus.datasource.username=app
-%openshift-native.quarkus.datasource.password=app
-
diff --git a/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/TestResources.kt b/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/TestResources.kt
deleted file mode 100644
index 552f8fa..0000000
--- a/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/TestResources.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.acme.kotlin.schooltimetabling
-
-import io.quarkus.test.common.QuarkusTestResource
-import io.quarkus.test.h2.H2DatabaseTestResource
-
-
-@QuarkusTestResource(H2DatabaseTestResource::class)
-class TestResources
diff --git a/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/rest/TimeTableResourceTest.kt b/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/rest/TimeTableResourceTest.kt
deleted file mode 100644
index 95bf2cc..0000000
--- a/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/rest/TimeTableResourceTest.kt
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.acme.kotlin.schooltimetabling.rest
-
-import io.quarkus.test.junit.QuarkusTest
-import io.restassured.RestAssured.get
-import io.restassured.RestAssured.given
-import io.restassured.http.ContentType
-import org.awaitility.Awaitility.await
-import org.hamcrest.Matchers
-import org.junit.jupiter.api.Test
-import org.optaplanner.core.api.solver.SolverStatus
-import java.time.Duration
-
-@QuarkusTest
-class TimeTableResourceTest {
-
- @Test
- fun solveDemoDataUntilFeasible() {
- given()
- .contentType(ContentType.JSON)
- .`when`().post("/timeTable/solve")
- .then()
- .statusCode(204)
-
- await()
- .atMost(Duration.ofMinutes(1))
- .pollDelay(Duration.ofSeconds(5))
- .pollInterval(Duration.ofSeconds(5))
- .until {
- SolverStatus.NOT_SOLVING.name == get("/timeTable").body().path("solverStatus")
- }
-
- get("/timeTable").then().assertThat()
- .body("solverStatus", Matchers.equalTo(SolverStatus.NOT_SOLVING.name))
- .body("timeslotList", Matchers.`is`(Matchers.not(Matchers.empty<Any>())))
- .body("roomList", Matchers.`is`(Matchers.not(Matchers.empty<Any>())))
- .body("lessonList", Matchers.`is`(Matchers.not(Matchers.empty<Any>())))
- .body("lessonList.timeslot", Matchers.not(Matchers.nullValue()))
- .body("lessonList.room", Matchers.not(Matchers.nullValue()))
- }
-
-}
diff --git a/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/solver/TimeTableConstraintProviderTest.kt b/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/solver/TimeTableConstraintProviderTest.kt
deleted file mode 100644
index af42a7c..0000000
--- a/technology/kotlin-quarkus/src/test/kotlin/org/acme/kotlin/schooltimetabling/solver/TimeTableConstraintProviderTest.kt
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.acme.kotlin.schooltimetabling.solver
-
-import io.quarkus.test.junit.QuarkusTest
-import org.acme.kotlin.schooltimetabling.domain.Lesson
-import org.acme.kotlin.schooltimetabling.domain.Room
-import org.acme.kotlin.schooltimetabling.domain.TimeTable
-import org.acme.kotlin.schooltimetabling.domain.Timeslot
-import org.junit.jupiter.api.Test
-import org.optaplanner.test.api.score.stream.ConstraintVerifier
-import java.time.DayOfWeek
-import java.time.LocalTime
-import jakarta.inject.Inject
-
-@QuarkusTest
-class TimeTableConstraintProviderTest {
-
- val ROOM1: Room = Room(1, "Room1")
- val ROOM2: Room = Room(2, "Room2")
- val TIMESLOT1: Timeslot = Timeslot(1, DayOfWeek.MONDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(50))
- val TIMESLOT2: Timeslot = Timeslot(2, DayOfWeek.TUESDAY, LocalTime.NOON, LocalTime.NOON.plusMinutes(50))
- val TIMESLOT3: Timeslot = Timeslot(3, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(1), LocalTime.NOON.plusHours(1).plusMinutes(50))
- val TIMESLOT4: Timeslot = Timeslot(4, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(3), LocalTime.NOON.plusHours(3).plusMinutes(50))
-
- @Inject
- lateinit var constraintVerifier: ConstraintVerifier<TimeTableConstraintProvider, TimeTable>;
-
- @Test
- fun roomConflict() {
- val firstLesson = Lesson(1, "Subject1", "Teacher1", "Group1", TIMESLOT1, ROOM1)
- val conflictingLesson = Lesson(2, "Subject2", "Teacher2", "Group2", TIMESLOT1, ROOM1)
- val nonConflictingLesson = Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1)
- constraintVerifier.verifyThat(TimeTableConstraintProvider::roomConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1)
- }
-
- @Test
- fun teacherConflict() {
- val conflictingTeacher = "Teacher1"
- val firstLesson = Lesson(1, "Subject1", conflictingTeacher, "Group1", TIMESLOT1, ROOM1)
- val conflictingLesson = Lesson(2, "Subject2", conflictingTeacher, "Group2", TIMESLOT1, ROOM2)
- val nonConflictingLesson = Lesson(3, "Subject3", "Teacher2", "Group3", TIMESLOT2, ROOM1)
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1)
- }
-
- @Test
- fun studentGroupConflict() {
- val conflictingGroup = "Group1"
- val firstLesson = Lesson(1, "Subject1", "Teacher1", conflictingGroup, TIMESLOT1, ROOM1)
- val conflictingLesson = Lesson(2, "Subject2", "Teacher2", conflictingGroup, TIMESLOT1, ROOM2)
- val nonConflictingLesson = Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1)
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1)
- }
-
- @Test
- fun teacherRoomStability() {
- val teacher = "Teacher1"
- val lessonInFirstRoom = Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1)
- val lessonInSameRoom = Lesson(2, "Subject2", teacher, "Group2", TIMESLOT1, ROOM1)
- val lessonInDifferentRoom = Lesson(3, "Subject3", teacher, "Group3", TIMESLOT1, ROOM2)
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherRoomStability)
- .given(lessonInFirstRoom, lessonInDifferentRoom, lessonInSameRoom)
- .penalizesBy(2)
- }
-
- @Test
- fun teacherTimeEfficiency() {
- val teacher = "Teacher1"
- val singleLessonOnMonday = Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1)
- val firstTuesdayLesson = Lesson(2, "Subject2", teacher, "Group2", TIMESLOT2, ROOM1)
- val secondTuesdayLesson = Lesson(3, "Subject3", teacher, "Group3", TIMESLOT3, ROOM1)
- val thirdTuesdayLessonWithGap = Lesson(4, "Subject4", teacher, "Group4", TIMESLOT4, ROOM1)
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherTimeEfficiency)
- .given(singleLessonOnMonday, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithGap)
- .rewardsWith(1) // Second tuesday lesson immediately follows the first.
- }
-
- @Test
- fun studentGroupSubjectVariety() {
- val studentGroup = "Group1"
- val repeatedSubject = "Subject1"
- val mondayLesson = Lesson(1, repeatedSubject, "Teacher1", studentGroup, TIMESLOT1, ROOM1)
- val firstTuesdayLesson = Lesson(2, repeatedSubject, "Teacher2", studentGroup, TIMESLOT2, ROOM1)
- val secondTuesdayLesson = Lesson(3, repeatedSubject, "Teacher3", studentGroup, TIMESLOT3, ROOM1)
- val thirdTuesdayLessonWithDifferentSubject = Lesson(4, "Subject2", "Teacher4", studentGroup, TIMESLOT4, ROOM1)
- val lessonInAnotherGroup = Lesson(5, repeatedSubject, "Teacher5", "Group2", TIMESLOT1, ROOM1)
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupSubjectVariety)
- .given(mondayLesson, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithDifferentSubject,
- lessonInAnotherGroup)
- .penalizesBy(1) // Second tuesday lesson immediately follows the first.
- }
-
-}
diff --git a/technology/kubernetes/.gitignore b/technology/kubernetes/.gitignore
deleted file mode 100644
index 2c78f65..0000000
--- a/technology/kubernetes/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-!.s2i
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/kubernetes/README.adoc b/technology/kubernetes/README.adoc
deleted file mode 100644
index 92e5d86..0000000
--- a/technology/kubernetes/README.adoc
+++ /dev/null
@@ -1,234 +0,0 @@
-= School Timetabling (OpenShift, Java, Quarkus, Maven)
-
-This demo shows how to use the OptaPlanner Operator to run OptaPlanner workloads on OpenShift.
-
-*Please note that the OptaPlanner Operator used in this demo is experimental. As such, it provides no guarantees
-in terms of maturity and backward compatibility.*
-
-== Get your environment running
-
-Use an existing OpenShift cluster or https://developers.redhat.com/products/openshift/download[try any of the options] that fit best your needs.
-
-WARNING: The _Developer Sandbox for Red Hat OpenShift_ does not allow installing new operators, thus it's not suitable for running this demo.
-
-WARNING: If you pick the _Red Hat OpenShift Local_, increase the available memory at least to 16 384 MiB
-by running `crc config set memory 16384` before you start the local cluster.
-
-Next, install the https://docs.openshift.com/container-platform/latest/cli_reference/openshift_cli/getting-started-cli.html[OpenShift CLI (`oc`)]
-to be able to interact with the OpenShift cluster.
-
-Login as a user with the `cluster-admin` role using the `oc login` command.
-
-[#setupByScript]
-=== Setup and deploy automatically by using the demo.sh script
-
-To set up the demo, run `./demo.sh setup [path to the OptaPlanner distribution]`.
-
-The script installs KEDA, ArtemisCloud, and OptaPlanner operators and creates a single Artemis AMQ broker in the OpenShift cluster.
-It also prints information about the Artemis AMQ broker required in the next steps. You can skip following instructions and jump right into <<#createSolver, creating the school-timetabling solver>>.
-
-=== Install the required operators and deploy the Demo application manually
-
-This section describes a manual set up as an alternative to <<#setupByScript>>.
-
-==== Create a project
-
-Create a new project called _demo_ by running `oc new-project demo`.
-
-[#installArtemisCloud]
-==== Install ArtemisCloud
-
-The OptaPlanner Operator uses https://artemiscloud.io/[ArtemisCloud] to create ActiveMQ queues, thus, as the first step,
-follow the https://artemiscloud.io/docs/help/operator/[documentation] to install the ArtemisCloud operator to your OpenShift instance.
-
-NOTE: The ArtemisCloud operator by default watches for ActiveMQ broker and queue resources in the namespace it has been installed to.
-
-==== Create a broker
-
-After the ArtemisCloud operator has been deployed, https://artemiscloud.io/docs/help/operator/#creating-operator-based-broker-deployments[create a new broker].
-The ArtemisCloud distribution comes with several `activemqartemis` example resources you can use as a starting point.
-
-This demo uses the AMQP protocol to send and receive messages.
-To enable the AMQP protocol on the broker, add the following acceptor definition in the `activemqartemis` resource `spec`:
-
-[source, yaml]
-----
-...
-spec:
- acceptors:
- - name: amqp
- connectionsAllowed: 100
- port: 5672
- protocols: amqp
-...
-----
-
-This acceptor allows up to 100 concurrent connections via the AMQP protocol.
-
-==== Install KEDA
-
-https://keda.sh[KEDA] enables dynamic scaling of solver deployments based on the number of incoming requests.
-
-Follow the https://keda.sh/docs/deploy/[documentation] to install the KEDA operator.
-
-==== Deploy the OptaPlanner Operator
-
-Follow the https://github.com/kiegroup/optaplanner/tree/main/optaplanner-operator#deploy-the-optaplanner-operator[README] to install the OptaPlanner operator.
-
-==== Deploy the Demo App
-
-The Demo App also relies upon the `quarkus-openshift` extension to deploy to OpenShift. The extension also picks up additional
-resources defined in the `src/main/kubernetes/openshift.yml`; in this case, there is a template that creates
-the PostgreSQL database to store input problems and solutions.
-
-. change directory to `demo-app`
-. change the current project to _demo_ by running `oc project demo`
-. deploy the demo-app via a maven command: `mvn clean package -Dopenshift -Dquarkus.openshift.namespace=demo -Dquarkus.openshift.env.vars.amqp-host=<ActiveMQ broker host>`
-
-The `-Dquarkus.openshift.env.vars.amqp-host` property results in an environment variable `AMQP_HOST`
-in the running container, which Quarkus converts to the `amqp-host` property, effectively overriding the
-`amqp-host=localhost` in the `application.properties`.
-
-TIP: If you encounter the `Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed` exception due to self-signed certificate during the build, add the `-Dquarkus.kubernetes-client.trust-certs=true` property.
-
-To find out the ActiveMQ broker host:
-. run `oc get service`
-. find the service bound to the port 5672
-. the ActiveMQ broker host is a compound of the `<service name>.<project>.svc.cluster.local`, e.g. `ex-aao-amqp-0-svc.demo.svc.cluster.local`
-
-[#createSolver]
-=== Create the school-timetabling solver
-
-Now, when all the other pieces of the puzzle are already in place, it's time to make the school-timetabling running.
-
-[#buildSolverImage]
-==== Build and push the school-timetabling container image
-
-In order for the OptaPlanner Operator to create a deployment of the solver project, you need to push it to any container image registry accessible
-by your OpenShift instance.
-
-Quarkus comes in handy again, this time with one of the https://quarkus.io/guides/container-image[Quarkus container image extensions], which
-builds a container image locally and pushes it to a container image registry.
-
-Build and push the School Timetabling container image to a registry of your choice:
-
-. change directory to `school-timetabling`
-. run `mvn clean package -Dopenshift -Dquarkus.container-image.group=<image group> -Dquarkus.container-image.registry=<container registry>
--Dquarkus.container-image.username=<container registry username> -Dquarkus.container-image.password=<container registry password>`
-
-The container registry in the command above is a repository used to store and access container images (e.g. docker.io) and the image group is an organization or a personal account in that registry.
-
-[TIP]
-.Pushing an image to a container image registry
-====
-You can use https://quay.io[quay.io] as a container image registry.
-
-. open https://quay.io in the browser and login with your Red Hat account
-. create a new repository called _school-timetabling_, switch its visibility to _Public_ and click the _Create Public Repository_ button
-. the image is identified by quay.io/<login>/<image name>:<tag>
-====
-
-==== Create the Solver custom resource
-
-The Solver custom resource describes the problem to solve on OpenShift and the infrastructure it requires.
-In this case, the `Solver` custom resource might look like follows:
-
-[source, yaml, linenums]
-----
-apiVersion: org.optaplanner.solver/v1alpha1
-kind: Solver
-metadata:
- name: school-timetabling
-spec:
- amqBroker:
- host: ex-aao-amqp-0-svc.demo.svc.cluster.local
- port: 5672
- managementHost: ex-aao-hdls-svc.demo.svc.cluster.local
- usernameSecretRef:
- key: AMQ_USER
- name: ex-aao-credentials-secret
- passwordSecretRef:
- key: AMQ_PASSWORD
- name: ex-aao-credentials-secret
- template:
- spec:
- containers:
- - name: school-timetabling
- image: quay.io/example/school-timetabling:latest
- scaling:
- dynamic: true
- replicas: 3
-----
-
-* line 4 - the solver name
-* lines 7 and 8 - ActiveMQ broker host and port accepting AMQP connections
-* line 9 - ActiveMQ broker host providing management interface
-* lines 10 to 15 - reference to a secret containing a username and password to access the broker
-* line 16 to 20 - the school-timetabling container that will run from the image <<#buildSolverImage, built and pushed>> to a registry of your choice
-* line 22 - enables dynamic scaling via KEDA
-* line 23 - the maximum number of running school-timetabling pods; if dynamic scaling is disabled, this parameter defines a fixed number of pods
-
-To find out the ActiveMQ broker management host:
-
-. run `oc get service`
-. find the service bound to the port 8161
-. the ActiveMQ broker management host is a compound of the `<service name>.<project>.svc.cluster.local`, e.g. `ex-aao-hdls-svc.demo.svc.cluster.local`
-
-The ActiveMQ broker username and password is stored in a secret named `<broker resource name>-credentials-secret`.
-Run `oc get secret` to see the available secrets in the project.
-
-Create the `Solver` resource via `oc apply -f <file>`.
-
-To see what ActiveMQ queue there are in the `demo` project, run `oc get activemqartemisaddress`:
-
-----
-$ oc get activemqartemisaddress
-NAME AGE
-school-timetabling-problem 4s
-school-timetabling-solution 4s
-----
-
-Both the `school-timetabling-problem` and `school-timetabling-solution` have been created.
-
-Check the active pods in the `demo` project by running the `oc get pods` command:
-
-----
-$ oc get pod
-NAME READY STATUS
-activemq-artemis-controller-manager-569cdd7f7c-xrfcx 1/1 Running
-demo-app-3-t4pkp 1/1 Running
-ex-aao-ss-0 1/1 Running
-postgresql-school-timetabling-1-kwdr5 1/1 Running
-----
-
-There are no running `school-timetabling` pods, as no request for solving has been submitted yet.
-
-== Run the demo-app
-
-. find out the Demo App address by running `oc get route`; see the _HOST/PORT_ column of its output
-. open the address in the browser
-. change the number of lessons, if needed, and click the _Create & send_ button
-
-Check the active pods again:
-
-----
-$ oc get pod
-NAME READY STATUS
-activemq-artemis-controller-manager-569cdd7f7c-xrfcx 1/1 Running
-demo-app-3-t4pkp 1/1 Running
-ex-aao-ss-0 1/1 Running
-postgresql-school-timetabling-1-kwdr5 1/1 Running
-school-timetabling-cb57fc6bd-hvmc6 0/1 ContainerCreating
-school-timetabling-cb57fc6bd-lhn9d 0/1 ContainerCreating
-school-timetabling-cb57fc6bd-tnlw8 1/1 Running
-----
-
-After submitting four datasets for solving, there is one running pod and two others starting, as the maximum number of replicas is three.
-
-== Local development
-
-To work locally on this demo without OpenShift or any Kubernetes cluster:
-
-. start the PostgreSQL database and a Kafka broker by running `docker-compose up`
-. run the `demo-app` by `mvn quarkus:dev` in the `demo-app` directory
-. run the `school-timetabling` by `mvn quarkus:dev` in the `school-timetabling` directory
\ No newline at end of file
diff --git a/technology/kubernetes/artemis-broker.yaml b/technology/kubernetes/artemis-broker.yaml
deleted file mode 100644
index 607f588..0000000
--- a/technology/kubernetes/artemis-broker.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-apiVersion: broker.amq.io/v1beta1
-kind: ActiveMQArtemis
-metadata:
- name: ex-aao
-spec:
- acceptors:
- - name: amqp
- connectionsAllowed: 100
- port: 5672
- protocols: amqp
- deploymentPlan:
- size: 1
- image: placeholder
\ No newline at end of file
diff --git a/technology/kubernetes/common/.gitignore b/technology/kubernetes/common/.gitignore
deleted file mode 100644
index 2c78f65..0000000
--- a/technology/kubernetes/common/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-!.s2i
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/kubernetes/common/pom.xml b/technology/kubernetes/common/pom.xml
deleted file mode 100644
index 6dbd928..0000000
--- a/technology/kubernetes/common/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>kubernetes-demo</artifactId>
- <groupId>org.acme</groupId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>kubernetes-demo-common</artifactId>
- <description>Kubernetes Demo : Common</description>
-
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-core</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-hibernate-orm-panache</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus</artifactId>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-test</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.jandex</groupId>
- <artifactId>jandex-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>jandex</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/domain/AbstractPersistable.java b/technology/kubernetes/common/src/main/java/org/acme/common/domain/AbstractPersistable.java
deleted file mode 100644
index 9abb918..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/domain/AbstractPersistable.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.acme.common.domain;
-
-import jakarta.persistence.GeneratedValue;
-import jakarta.persistence.Id;
-import jakarta.persistence.MappedSuperclass;
-
-import org.optaplanner.core.api.domain.lookup.PlanningId;
-
-@MappedSuperclass
-public class AbstractPersistable {
-
- public static final String TENANT_FIELD = "problemId";
- public static final long SINGLE_PROBLEM_ID = 1L;
-
- @PlanningId
- @Id
- @GeneratedValue
- private Long id;
-
- private Long problemId;
-
- // No-arg constructor required for Hibernate and OptaPlanner
- public AbstractPersistable() {
- }
-
- public AbstractPersistable(Long problemId) {
- this.problemId = problemId;
- }
-
- public AbstractPersistable(Long id, Long problemId) {
- this.id = id;
- this.problemId = problemId;
- }
-
- public Long getId() {
- return id;
- }
-
- public Long getProblemId() {
- return problemId;
- }
-
- public void setProblemId(Long problemId) {
- this.problemId = problemId;
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/domain/Lesson.java b/technology/kubernetes/common/src/main/java/org/acme/common/domain/Lesson.java
deleted file mode 100644
index 3b10237..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/domain/Lesson.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.acme.common.domain;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.ManyToOne;
-
-import org.optaplanner.core.api.domain.entity.PlanningEntity;
-import org.optaplanner.core.api.domain.variable.PlanningVariable;
-
-@PlanningEntity
-@Entity
-public class Lesson extends AbstractPersistable {
-
- private String subject;
- private String teacher;
- private String studentGroup;
-
- @PlanningVariable
- @ManyToOne
- private Timeslot timeslot;
- @PlanningVariable
- @ManyToOne
- private Room room;
-
- // No-arg constructor required for Hibernate and OptaPlanner
- public Lesson() {
- }
-
- public Lesson(long problemId, String subject, String teacher, String studentGroup) {
- super(problemId);
- this.subject = subject.trim();
- this.teacher = teacher.trim();
- this.studentGroup = studentGroup.trim();
- }
-
- public Lesson(long id, String subject, String teacher, String studentGroup, Timeslot timeslot, Room room) {
- super(id, SINGLE_PROBLEM_ID);
- this.subject = subject.trim();
- this.teacher = teacher.trim();
- this.studentGroup = studentGroup.trim();
- this.timeslot = timeslot;
- this.room = room;
- }
-
- @Override
- public String toString() {
- return subject + "(" + getId() + ")";
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public String getSubject() {
- return subject;
- }
-
- public String getTeacher() {
- return teacher;
- }
-
- public String getStudentGroup() {
- return studentGroup;
- }
-
- public Timeslot getTimeslot() {
- return timeslot;
- }
-
- public void setTimeslot(Timeslot timeslot) {
- this.timeslot = timeslot;
- }
-
- public Room getRoom() {
- return room;
- }
-
- public void setRoom(Room room) {
- this.room = room;
- }
-
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/domain/Room.java b/technology/kubernetes/common/src/main/java/org/acme/common/domain/Room.java
deleted file mode 100644
index 43e3afa..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/domain/Room.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.acme.common.domain;
-
-import jakarta.persistence.Entity;
-
-@Entity
-public class Room extends AbstractPersistable {
-
- private String name;
-
- // No-arg constructor required for Hibernate
- public Room() {
- }
-
- public Room(String name) {
- this.name = name.trim();
- }
-
- public Room(long id, String name) {
- super(id, SINGLE_PROBLEM_ID);
- this.name = name.trim();
- }
-
- @Override
- public String toString() {
- return name;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public String getName() {
- return name;
- }
-
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/domain/TimeTable.java b/technology/kubernetes/common/src/main/java/org/acme/common/domain/TimeTable.java
deleted file mode 100644
index f164643..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/domain/TimeTable.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.acme.common.domain;
-
-import java.util.List;
-
-import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty;
-import org.optaplanner.core.api.domain.solution.PlanningScore;
-import org.optaplanner.core.api.domain.solution.PlanningSolution;
-import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty;
-import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-
-@PlanningSolution
-public class TimeTable {
-
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- private List<Timeslot> timeslotList;
-
- @ProblemFactCollectionProperty
- @ValueRangeProvider
- private List<Room> roomList;
-
- @PlanningEntityCollectionProperty
- private List<Lesson> lessonList;
-
- @PlanningScore
- private HardSoftScore score;
-
- // No-arg constructor required for OptaPlanner
- public TimeTable() {
- }
-
- public TimeTable(List<Timeslot> timeslotList, List<Room> roomList, List<Lesson> lessonList) {
- this.timeslotList = timeslotList;
- this.roomList = roomList;
- this.lessonList = lessonList;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public List<Timeslot> getTimeslotList() {
- return timeslotList;
- }
-
- public List<Room> getRoomList() {
- return roomList;
- }
-
- public List<Lesson> getLessonList() {
- return lessonList;
- }
-
- public HardSoftScore getScore() {
- return score;
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/domain/Timeslot.java b/technology/kubernetes/common/src/main/java/org/acme/common/domain/Timeslot.java
deleted file mode 100644
index af0aed3..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/domain/Timeslot.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.acme.common.domain;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import jakarta.persistence.Entity;
-
-@Entity
-public class Timeslot extends AbstractPersistable {
-
- private DayOfWeek dayOfWeek;
- private LocalTime startTime;
- private LocalTime endTime;
-
- // No-arg constructor required for Hibernate
- public Timeslot() {
- }
-
- public Timeslot(DayOfWeek dayOfWeek, LocalTime startTime, LocalTime endTime) {
- this.dayOfWeek = dayOfWeek;
- this.startTime = startTime;
- this.endTime = endTime;
- }
-
- public Timeslot(long problemId, DayOfWeek dayOfWeek, LocalTime startTime, LocalTime endTime) {
- super(problemId);
- this.dayOfWeek = dayOfWeek;
- this.startTime = startTime;
- this.endTime = endTime;
- }
-
- public Timeslot(long id, DayOfWeek dayOfWeek, LocalTime startTime) {
- super(id, SINGLE_PROBLEM_ID);
- this.dayOfWeek = dayOfWeek;
- this.startTime = startTime;
- this.endTime = startTime.plusHours(1);
- }
-
- @Override
- public String toString() {
- return dayOfWeek + " " + startTime;
- }
-
- // ************************************************************************
- // Getters and setters
- // ************************************************************************
-
- public DayOfWeek getDayOfWeek() {
- return dayOfWeek;
- }
-
- public LocalTime getStartTime() {
- return startTime;
- }
-
- public LocalTime getEndTime() {
- return endTime;
- }
-
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/event/SolverEvent.java b/technology/kubernetes/common/src/main/java/org/acme/common/event/SolverEvent.java
deleted file mode 100644
index cb65833..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/event/SolverEvent.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.acme.common.event;
-
-public class SolverEvent {
- private Long problemId;
- private SolverEventType solverEventType;
-
- public SolverEvent() {
- // Used by Jackson
- }
-
- public SolverEvent(Long problemId, SolverEventType solverEventType) {
- this.problemId = problemId;
- this.solverEventType = solverEventType;
- }
-
- public Long getProblemId() {
- return problemId;
- }
-
- public SolverEventType getSolverEventType() {
- return solverEventType;
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/event/SolverEventType.java b/technology/kubernetes/common/src/main/java/org/acme/common/event/SolverEventType.java
deleted file mode 100644
index 02650af..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/event/SolverEventType.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.acme.common.event;
-
-public enum SolverEventType {
- SOLVER_REQUEST,
- SOLVER_FINISHED
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/message/SolverRequest.java b/technology/kubernetes/common/src/main/java/org/acme/common/message/SolverRequest.java
deleted file mode 100644
index 125f015..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/message/SolverRequest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.acme.common.message;
-
-import io.quarkus.runtime.annotations.RegisterForReflection;
-
-@RegisterForReflection
-public class SolverRequest {
- private Long problemId;
-
- SolverRequest() {
- // Required for JSON deserialization.
- }
-
- public SolverRequest(Long problemId) {
- this.problemId = problemId;
- }
-
- public Long getProblemId() {
- return problemId;
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/message/SolverResponse.java b/technology/kubernetes/common/src/main/java/org/acme/common/message/SolverResponse.java
deleted file mode 100644
index e797ac3..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/message/SolverResponse.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.acme.common.message;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-public class SolverResponse {
-
- private Long problemId;
- private ResponseStatus responseStatus;
- private ErrorInfo errorInfo;
-
- SolverResponse() {
- // Required for JSON deserialization.
- }
-
- public SolverResponse(Long problemId) {
- this.problemId = problemId;
- this.responseStatus = ResponseStatus.SUCCESS;
- }
-
- public SolverResponse(Long problemId, ErrorInfo errorInfo) {
- this.problemId = problemId;
- this.errorInfo = errorInfo;
- this.responseStatus = ResponseStatus.FAILURE;
- }
-
- public Long getProblemId() {
- return problemId;
- }
-
- public ErrorInfo getErrorInfo() {
- return errorInfo;
- }
-
- public ResponseStatus getResponseStatus() {
- return responseStatus;
- }
-
- @JsonIgnore
- public boolean isSuccess() {
- return ResponseStatus.SUCCESS == responseStatus;
- }
-
- public enum ResponseStatus {
- SUCCESS,
- FAILURE
- }
-
- public static class ErrorInfo {
- private String exceptionClassName;
- private String exceptionMessage;
-
- ErrorInfo() {
- // Required for JSON deserialization.
- }
-
- public ErrorInfo(String exceptionClassName, String exceptionMessage) {
- this.exceptionClassName = exceptionClassName;
- this.exceptionMessage = exceptionMessage;
- }
-
- public String getExceptionClassName() {
- return exceptionClassName;
- }
-
- public String getExceptionMessage() {
- return exceptionMessage;
- }
- }
-}
\ No newline at end of file
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/LessonRepository.java b/technology/kubernetes/common/src/main/java/org/acme/common/persistence/LessonRepository.java
deleted file mode 100644
index e4e2b9a..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/LessonRepository.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.acme.common.persistence;
-
-import java.util.List;
-
-import jakarta.enterprise.context.ApplicationScoped;
-
-import org.acme.common.domain.Lesson;
-
-import io.quarkus.hibernate.orm.panache.PanacheRepository;
-import io.quarkus.panache.common.Sort;
-
-@ApplicationScoped
-public class LessonRepository implements PanacheRepository<Lesson> {
-
- public List<Lesson> listAllByProblemId(long problemId) {
- return find(Lesson.TENANT_FIELD, Sort.by("subject").and("teacher").and("studentGroup").and("id"), problemId)
- .list();
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/RoomRepository.java b/technology/kubernetes/common/src/main/java/org/acme/common/persistence/RoomRepository.java
deleted file mode 100644
index c9e53d8..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/RoomRepository.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.acme.common.persistence;
-
-import java.util.List;
-
-import jakarta.enterprise.context.ApplicationScoped;
-
-import org.acme.common.domain.Room;
-
-import io.quarkus.hibernate.orm.panache.PanacheRepository;
-import io.quarkus.panache.common.Sort;
-
-@ApplicationScoped
-public class RoomRepository implements PanacheRepository<Room> {
-
- public List<Room> listAllByProblemId(long problemId) {
- return find(Room.TENANT_FIELD, Sort.by("name").and("id"), problemId).list();
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/TimeTableRepository.java b/technology/kubernetes/common/src/main/java/org/acme/common/persistence/TimeTableRepository.java
deleted file mode 100644
index 4ba451d..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/TimeTableRepository.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.acme.common.persistence;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.transaction.Transactional;
-
-import org.acme.common.domain.Lesson;
-import org.acme.common.domain.TimeTable;
-
-@ApplicationScoped
-public class TimeTableRepository {
-
- private final RoomRepository roomRepository;
- private final TimeslotRepository timeslotRepository;
- private final LessonRepository lessonRepository;
-
- @Inject
- public TimeTableRepository(RoomRepository roomRepository, TimeslotRepository timeslotRepository, LessonRepository lessonRepository) {
- this.roomRepository = roomRepository;
- this.timeslotRepository = timeslotRepository;
- this.lessonRepository = lessonRepository;
- }
-
- @Transactional
- public void persist(TimeTable timeTable) {
- timeslotRepository.persist(timeTable.getTimeslotList());
- roomRepository.persist(timeTable.getRoomList());
- lessonRepository.persist(timeTable.getLessonList());
- }
-
- @Transactional
- public void save(Long problemId, TimeTable timeTable) {
- for (Lesson lesson : timeTable.getLessonList()) {
- Lesson attachedLesson = lessonRepository.findById(lesson.getId());
- attachedLesson.setTimeslot(lesson.getTimeslot());
- attachedLesson.setRoom(lesson.getRoom());
- }
- }
-
- @Transactional
- public TimeTable load(Long problemId) {
- return new TimeTable(
- timeslotRepository.listAllByProblemId(problemId),
- roomRepository.listAllByProblemId(problemId),
- lessonRepository.listAllByProblemId(problemId));
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/TimeslotRepository.java b/technology/kubernetes/common/src/main/java/org/acme/common/persistence/TimeslotRepository.java
deleted file mode 100644
index c3d2fac..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/persistence/TimeslotRepository.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.acme.common.persistence;
-
-import java.util.List;
-
-import jakarta.enterprise.context.ApplicationScoped;
-
-import org.acme.common.domain.Timeslot;
-
-import io.quarkus.hibernate.orm.panache.PanacheRepository;
-import io.quarkus.panache.common.Sort;
-
-@ApplicationScoped
-public class TimeslotRepository implements PanacheRepository<Timeslot> {
-
- public List<Timeslot> listAllByProblemId(long problemId) {
- return find(Timeslot.TENANT_FIELD, Sort.by("dayOfWeek").and("startTime").and("endTime").and("id"), problemId)
- .list();
- }
-}
diff --git a/technology/kubernetes/common/src/main/java/org/acme/common/solver/TimeTableConstraintProvider.java b/technology/kubernetes/common/src/main/java/org/acme/common/solver/TimeTableConstraintProvider.java
deleted file mode 100644
index 1bc0a27..0000000
--- a/technology/kubernetes/common/src/main/java/org/acme/common/solver/TimeTableConstraintProvider.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.acme.common.solver;
-
-import java.time.Duration;
-
-import org.acme.common.domain.Lesson;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.score.stream.Constraint;
-import org.optaplanner.core.api.score.stream.ConstraintFactory;
-import org.optaplanner.core.api.score.stream.ConstraintProvider;
-import org.optaplanner.core.api.score.stream.Joiners;
-
-public class TimeTableConstraintProvider implements ConstraintProvider {
-
- @Override
- public Constraint[] defineConstraints(ConstraintFactory constraintFactory) {
- return new Constraint[] {
- // Hard constraints
- roomConflict(constraintFactory),
- teacherConflict(constraintFactory),
- studentGroupConflict(constraintFactory),
- // Soft constraints
- teacherRoomStability(constraintFactory),
- teacherTimeEfficiency(constraintFactory),
- studentGroupSubjectVariety(constraintFactory)
- };
- }
-
- Constraint roomConflict(ConstraintFactory constraintFactory) {
- // A room can accommodate at most one lesson at the same time.
- return constraintFactory
- // Select each pair of 2 different lessons ...
- .forEachUniquePair(Lesson.class,
- // ... in the same timeslot ...
- Joiners.equal(Lesson::getTimeslot),
- // ... in the same room ...
- Joiners.equal(Lesson::getRoom))
- // ... and penalize each pair with a hard weight.
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Room conflict");
- }
-
- Constraint teacherConflict(ConstraintFactory constraintFactory) {
- // A teacher can teach at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getTeacher))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Teacher conflict");
- }
-
- Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
- // A student can attend at most one lesson at the same time.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTimeslot),
- Joiners.equal(Lesson::getStudentGroup))
- .penalize(HardSoftScore.ONE_HARD)
- .asConstraint("Student group conflict");
- }
-
- Constraint teacherRoomStability(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach in a single room.
- return constraintFactory
- .forEachUniquePair(Lesson.class,
- Joiners.equal(Lesson::getTeacher))
- .filter((lesson1, lesson2) -> lesson1.getRoom() != lesson2.getRoom())
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher room stability");
- }
-
- Constraint teacherTimeEfficiency(ConstraintFactory constraintFactory) {
- // A teacher prefers to teach sequential lessons and dislikes gaps between lessons.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class, Joiners.equal(Lesson::getTeacher),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .reward(HardSoftScore.ONE_SOFT)
- .asConstraint("Teacher time efficiency");
- }
-
- Constraint studentGroupSubjectVariety(ConstraintFactory constraintFactory) {
- // A student group dislikes sequential lessons on the same subject.
- return constraintFactory
- .forEach(Lesson.class)
- .join(Lesson.class,
- Joiners.equal(Lesson::getSubject),
- Joiners.equal(Lesson::getStudentGroup),
- Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
- .filter((lesson1, lesson2) -> {
- Duration between = Duration.between(lesson1.getTimeslot().getEndTime(),
- lesson2.getTimeslot().getStartTime());
- return !between.isNegative() && between.compareTo(Duration.ofMinutes(30)) <= 0;
- })
- .penalize(HardSoftScore.ONE_SOFT)
- .asConstraint("Student group subject variety");
- }
-
-}
diff --git a/technology/kubernetes/common/src/test/java/org/acme/common/solver/TimeTableConstraintProviderTest.java b/technology/kubernetes/common/src/test/java/org/acme/common/solver/TimeTableConstraintProviderTest.java
deleted file mode 100644
index acb3c57..0000000
--- a/technology/kubernetes/common/src/test/java/org/acme/common/solver/TimeTableConstraintProviderTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.acme.common.solver;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-
-import org.acme.common.domain.Lesson;
-import org.acme.common.domain.Room;
-import org.acme.common.domain.TimeTable;
-import org.acme.common.domain.Timeslot;
-import org.junit.jupiter.api.Test;
-import org.optaplanner.test.api.score.stream.ConstraintVerifier;
-
-class TimeTableConstraintProviderTest {
-
- private static final Room ROOM1 = new Room(1, "Room1");
- private static final Room ROOM2 = new Room(2, "Room2");
- private static final Timeslot TIMESLOT1 = new Timeslot(1, DayOfWeek.MONDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT2 = new Timeslot(2, DayOfWeek.TUESDAY, LocalTime.NOON);
- private static final Timeslot TIMESLOT3 = new Timeslot(3, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(1));
- private static final Timeslot TIMESLOT4 = new Timeslot(4, DayOfWeek.TUESDAY, LocalTime.NOON.plusHours(3));
-
- private final ConstraintVerifier<TimeTableConstraintProvider, TimeTable> constraintVerifier =
- ConstraintVerifier.build(new TimeTableConstraintProvider(), TimeTable.class, Lesson.class);
-
- @Test
- void roomConflict() {
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", "Group2", TIMESLOT1, ROOM1);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::roomConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherConflict() {
- String conflictingTeacher = "Teacher1";
- Lesson firstLesson = new Lesson(1, "Subject1", conflictingTeacher, "Group1", TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", conflictingTeacher, "Group2", TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher2", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void studentGroupConflict() {
- String conflictingGroup = "Group1";
- Lesson firstLesson = new Lesson(1, "Subject1", "Teacher1", conflictingGroup, TIMESLOT1, ROOM1);
- Lesson conflictingLesson = new Lesson(2, "Subject2", "Teacher2", conflictingGroup, TIMESLOT1, ROOM2);
- Lesson nonConflictingLesson = new Lesson(3, "Subject3", "Teacher3", "Group3", TIMESLOT2, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupConflict)
- .given(firstLesson, conflictingLesson, nonConflictingLesson)
- .penalizesBy(1);
- }
-
- @Test
- void teacherRoomStability() {
- String teacher = "Teacher1";
- Lesson lessonInFirstRoom = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson lessonInSameRoom = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT1, ROOM1);
- Lesson lessonInDifferentRoom = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT1, ROOM2);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherRoomStability)
- .given(lessonInFirstRoom, lessonInDifferentRoom, lessonInSameRoom)
- .penalizesBy(2);
- }
-
- @Test
- void teacherTimeEfficiency() {
- String teacher = "Teacher1";
- Lesson singleLessonOnMonday = new Lesson(1, "Subject1", teacher, "Group1", TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, "Subject2", teacher, "Group2", TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, "Subject3", teacher, "Group3", TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithGap = new Lesson(4, "Subject4", teacher, "Group4", TIMESLOT4, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::teacherTimeEfficiency)
- .given(singleLessonOnMonday, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithGap)
- .rewardsWith(1); // Second tuesday lesson immediately follows the first.
- }
-
- @Test
- void studentGroupSubjectVariety() {
- String studentGroup = "Group1";
- String repeatedSubject = "Subject1";
- Lesson mondayLesson = new Lesson(1, repeatedSubject, "Teacher1", studentGroup, TIMESLOT1, ROOM1);
- Lesson firstTuesdayLesson = new Lesson(2, repeatedSubject, "Teacher2", studentGroup, TIMESLOT2, ROOM1);
- Lesson secondTuesdayLesson = new Lesson(3, repeatedSubject, "Teacher3", studentGroup, TIMESLOT3, ROOM1);
- Lesson thirdTuesdayLessonWithDifferentSubject = new Lesson(4, "Subject2", "Teacher4", studentGroup, TIMESLOT4, ROOM1);
- Lesson lessonInAnotherGroup = new Lesson(5, repeatedSubject, "Teacher5", "Group2", TIMESLOT1, ROOM1);
- constraintVerifier.verifyThat(TimeTableConstraintProvider::studentGroupSubjectVariety)
- .given(mondayLesson, firstTuesdayLesson, secondTuesdayLesson, thirdTuesdayLessonWithDifferentSubject,
- lessonInAnotherGroup)
- .penalizesBy(1); // Second tuesday lesson immediately follows the first.
- }
-
-}
diff --git a/technology/kubernetes/demo-app/.gitignore b/technology/kubernetes/demo-app/.gitignore
deleted file mode 100644
index 2c78f65..0000000
--- a/technology/kubernetes/demo-app/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-/target
-/build
-/local
-
-# Eclipse, Netbeans and IntelliJ files
-/.*
-!.gitignore
-!.dockerignore
-!.mvn
-!.s2i
-/nbproject
-/*.ipr
-/*.iws
-/*.iml
diff --git a/technology/kubernetes/demo-app/pom.xml b/technology/kubernetes/demo-app/pom.xml
deleted file mode 100644
index b8f42fb..0000000
--- a/technology/kubernetes/demo-app/pom.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>kubernetes-demo</artifactId>
- <groupId>org.acme</groupId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>kubernetes-demo-app</artifactId>
- <description>Kubernetes Demo : App</description>
-
- <dependencies>
- <dependency>
- <groupId>org.acme</groupId>
- <artifactId>kubernetes-demo-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.optaplanner</groupId>
- <artifactId>optaplanner-quarkus</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-jdbc-postgresql</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-resteasy</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-resteasy-jackson</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-smallrye-reactive-messaging-amqp</artifactId>
- </dependency>
-
- <!-- Test dependencies. -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.smallrye.reactive</groupId>
- <artifactId>smallrye-reactive-messaging-in-memory</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-jdbc-h2</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- UI -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-webjars-locator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>bootstrap</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>font-awesome</artifactId>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <extensions>true</extensions>
- <executions>
- <execution>
- <goals>
- <goal>build</goal>
- <goal>generate-code</goal>
- <goal>generate-code-tests</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>openshift</id> <!-- Optional for use in OpenShift. -->
- <activation>
- <property>
- <name>openshift</name>
- </property>
- </activation>
- <properties>
- <quarkus.profile>openshift</quarkus.profile>
- </properties>
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-openshift</artifactId>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-</project>
\ No newline at end of file
diff --git a/technology/kubernetes/demo-app/src/main/docker/Dockerfile.jvm b/technology/kubernetes/demo-app/src/main/docker/Dockerfile.jvm
deleted file mode 100644
index 958507c..0000000
--- a/technology/kubernetes/demo-app/src/main/docker/Dockerfile.jvm
+++ /dev/null
@@ -1,59 +0,0 @@
-####
-# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
-#
-# Before building the docker image run:
-#
-# mvn package
-#
-# Then, build the image with:
-#
-# docker build -f src/main/docker/Dockerfile.jvm -t optaplanner/school-timetabling-jvm .
-#
-# Then run the container using:
-#
-# docker run -i --rm -p 8080:8080 optaplanner/school-timetabling-jvm
-#
-# If you want to include the debug port into your docker image
-# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050
-#
-# Then run the container using :
-#
-# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" optaplanner/school-timetabling-jvm
-#
-###
-FROM registry.access.redhat.com/ubi8/ubi-minimal
-
-ARG JAVA_PACKAGE=java-11-openjdk-headless
-ARG RUN_JAVA_VERSION=1.3.8
-
-ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
-
-# Install java and the run-java script
-# Also set up permissions for user `1001`
-RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
- && microdnf update \
- && microdnf clean all \
- && mkdir /deployments \
- && chown 1001 /deployments \
- && chmod "g+rwX" /deployments \
- && chown 1001:root /deployments \
- && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
- && chown 1001 /deployments/run-java.sh \
- && chmod 540 /deployments/run-java.sh \
- && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
-
-# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
-ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
-
-# We make four distinct layers so if there are application changes the library layers can be re-used
-COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/
-COPY --chown=1001 target/quarkus-app/*.jar /deployments/
-COPY --chown=1001 target/quarkus-app/app/ /deployments/app/
-COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/
-
-EXPOSE 8080
-
-# run with user 1001
-USER 1001
-
-ENTRYPOINT [ "/deployments/run-java.sh" ]
diff --git a/technology/kubernetes/demo-app/src/main/docker/Dockerfile.native b/technology/kubernetes/demo-app/src/main/docker/Dockerfile.native
deleted file mode 100644
index 00f76f7..0000000
--- a/technology/kubernetes/demo-app/src/main/docker/Dockerfile.native
+++ /dev/null
@@ -1,22 +0,0 @@
-####
-# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode
-#
-# Before building the docker image run:
-#
-# mvn package -Pnative -Dquarkus.native.container-build=true
-#
-# Then, build the image with:
-#
-# docker build -f src/main/docker/Dockerfile.native -t optaplanner/school-timetabling .
-#
-# Then run the container using:
-#
-# docker run -i --rm -p 8080:8080 optaplanner/school-timetabling
-#
-###
-FROM registry.access.redhat.com/ubi8/ubi-minimal
-WORKDIR /work/
-COPY target/*-runner /work/application
-RUN chmod 775 /work
-EXPOSE 8080
-CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
diff --git a/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/generator/DemoDataGenerator.java b/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/generator/DemoDataGenerator.java
deleted file mode 100644
index 0249432..0000000
--- a/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/generator/DemoDataGenerator.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.acme.demoapp.generator;
-
-import java.time.DayOfWeek;
-import java.time.LocalTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import jakarta.enterprise.context.ApplicationScoped;
-
-import org.acme.common.domain.Lesson;
-import org.acme.common.domain.Room;
-import org.acme.common.domain.TimeTable;
-import org.acme.common.domain.Timeslot;
-
-@ApplicationScoped
-public final class DemoDataGenerator {
-
- private static final String[] ROOM_NAMES = new String[] {
- "Room A", "Room B", "Room C", "Room D", "Room E", "Room F", "Room G", "Room H", "Room I", "Room J"
- };
-
- private static final String[] SUBJECTS = new String[] {
- "Math", "Physics", "Chemistry", "Biology", "History", "English", "Art", "Drama", "ICT", "Physical education",
- "French", "Spanish", "Geography", "Geology"
- };
-
- private static final String[] STUDENT_GROUPS = new String[] {
- "9th grade", "10th grade", "11th grade", "12th grade"
- };
-
- private Map<String, String> subjectToTeacherMap;
-
- public DemoDataGenerator() {
- this.subjectToTeacherMap = createSubjectsToTeachersMapping();
- }
-
- private Map<String, String> createSubjectsToTeachersMapping() {
- Map<String, String> mapping = new HashMap<>();
- mapping.put("ICT", "A. Turing");
- mapping.put("Math", "A. Turing");
- mapping.put("Chemistry", "M. Curie");
- mapping.put("French", "M. Curie");
- mapping.put("Physics", "M. Curie");
- mapping.put("Biology", "C. Darwin");
- mapping.put("Geography", "C. Darwin");
- mapping.put("Geology", "C. Darwin");
- mapping.put("Drama", "I. Jones");
- mapping.put("English", "I. Jones");
- mapping.put("History", "I. Jones");
- mapping.put("Art", "S. Dali");
- mapping.put("Physical education", "C. Lewis");
- mapping.put("Spanish", "P. Cruz");
- return mapping;
- }
-
- public TimeTable generateUnsolvedTimeTable(long problemId, int lessons, int rooms) {
- final int timeslotCount = (int) (lessons * 1.5 / rooms);
- List<Timeslot> timeslotList = generateTimeslots(problemId, timeslotCount);
- List<Lesson> lessonList = generateLessons(problemId, lessons);
- List<Room> roomList = generateRooms(problemId, rooms);
- return new TimeTable(timeslotList, roomList, lessonList);
- }
-
- List<Timeslot> generateTimeslots(long problemId, int count) {
- int sanitizedCount = count > 30 ? 30 : count; // Maximum of 30 timeslots per week.
- LocalTime startTime = LocalTime.of(8, 0);
- DayOfWeek startDay = DayOfWeek.MONDAY;
- DayOfWeek currentDay = startDay;
- LocalTime currentStartTime = startTime;
- List<Timeslot> timeslots = new ArrayList<>(sanitizedCount);
- for (int i = 0; i < sanitizedCount; i++) {
- Timeslot timeslot = new Timeslot(problemId, currentDay, currentStartTime, currentStartTime.plusHours(1));
- timeslots.add(timeslot);
-
- if (currentStartTime.getHour() == 10) { // Lunch break.
- currentStartTime = currentStartTime.plusHours(3);
- } else if (currentStartTime.getHour() == 15) { // The next day.
- currentStartTime = startTime;
- currentDay = currentDay.plus(1);
- } else {
- currentStartTime = currentStartTime.plusHours(1);
- }
- }
-
- return timeslots;
- }
-
- List<Room> generateRooms(long problemId, int count) {
- int sanitizedCount = count > ROOM_NAMES.length ? ROOM_NAMES.length : count;
- List<Room> rooms = new ArrayList<>(sanitizedCount);
- for (int i = 0; i < sanitizedCount; i++) {
- Room room = new Room(ROOM_NAMES[i]);
- room.setProblemId(problemId);
- rooms.add(room);
- }
- return rooms;
- }
-
- List<Lesson> generateLessons(long problemId, int count) {
- int sanitizedCount = count > 200 ? 200 : count;
- List<Lesson> lessons = new ArrayList<>(sanitizedCount);
- for (int i = 0; i < sanitizedCount; i++) {
- int subjectIndex = i % SUBJECTS.length;
- int studentGroupIndex = i % STUDENT_GROUPS.length;
- String subject = SUBJECTS[subjectIndex];
- String studentGroup = STUDENT_GROUPS[studentGroupIndex];
- Lesson lesson = new Lesson(problemId, subject, subjectToTeacherMap.get(subject), studentGroup);
- lessons.add(lesson);
- }
- return lessons;
- }
-}
diff --git a/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/rest/Dataset.java b/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/rest/Dataset.java
deleted file mode 100644
index 509d503..0000000
--- a/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/rest/Dataset.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.acme.demoapp.rest;
-
-public class Dataset {
- private long problemId;
- private int lessons;
- private int rooms;
- private boolean solved;
-
- private String score = null;
-
- public Dataset() {
- }
-
- public Dataset(long problemId, int lessons, int rooms, boolean solved) {
- this.problemId = problemId;
- this.lessons = lessons;
- this.rooms = rooms;
- this.solved = solved;
- }
-
- public long getProblemId() {
- return problemId;
- }
-
- public void setProblemId(long problemId) {
- this.problemId = problemId;
- }
-
- public int getLessons() {
- return lessons;
- }
-
- public void setLessons(int lessons) {
- this.lessons = lessons;
- }
-
- public int getRooms() {
- return rooms;
- }
-
- public void setRooms(int rooms) {
- this.rooms = rooms;
- }
-
- public boolean isSolved() {
- return solved;
- }
-
- public void setSolved(boolean solved) {
- this.solved = solved;
- }
-
- public String getScore() {
- return score;
- }
-
- public void setScore(String score) {
- this.score = score;
- }
-}
diff --git a/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/rest/DemoDataResource.java b/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/rest/DemoDataResource.java
deleted file mode 100644
index 23e2d4c..0000000
--- a/technology/kubernetes/demo-app/src/main/java/org/acme/demoapp/rest/DemoDataResource.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.acme.demoapp.rest;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
-
-import jakarta.inject.Inject;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.POST;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
-
-import org.acme.common.domain.TimeTable;
-import org.acme.common.message.SolverRequest;
-import org.acme.common.message.SolverResponse;
-import org.acme.common.persistence.TimeTableRepository;
-import org.acme.demoapp.generator.DemoDataGenerator;
-import org.eclipse.microprofile.reactive.messaging.Acknowledgment;
-import org.eclipse.microprofile.reactive.messaging.Channel;
-import org.eclipse.microprofile.reactive.messaging.Emitter;
-import org.eclipse.microprofile.reactive.messaging.Incoming;
-import org.eclipse.microprofile.reactive.messaging.Message;
-import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
-import org.optaplanner.core.api.solver.SolutionManager;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Path("demo")
-public class DemoDataResource {
-
- private static final int MAX_LESSON_COUNT = 200;
-
- public static final ProblemIdSequence PROBLEM_ID_SEQUENCE = new ProblemIdSequence();
-
- private final DemoDataGenerator demoDataGenerator;
-
- private final TimeTableRepository timeTableRepository;
-
- private final Emitter<String> solverRequestEmitter;
-
- private final EventResource eventResource;
-
... 22591 lines suppressed ...