From 38ee8bee752c802ac1818868e699f5e5f4b3851c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Petrovick=C3=BD?= Date: Wed, 7 Sep 2022 09:55:56 +0200 Subject: [PATCH] PLANNER-1709 Avoid deprecated penalize/reward overloads This PR is a DRAFT and will not undrafted before https://github.com/quarkusio/quarkus-quickstarts/pull/1167. --- docs/src/main/asciidoc/optaplanner.adoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/src/main/asciidoc/optaplanner.adoc b/docs/src/main/asciidoc/optaplanner.adoc index abac11775db43..1de048f099bce 100644 --- a/docs/src/main/asciidoc/optaplanner.adoc +++ b/docs/src/main/asciidoc/optaplanner.adoc @@ -456,7 +456,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider { // ... and the pair is unique (different id, no reverse pairs) ... Joiners.lessThan(Lesson::getId)) // ... then penalize each pair with a hard weight. - .penalize("Room conflict", HardSoftScore.ONE_HARD); + .penalize(HardSoftScore.ONE_HARD) + .asConstraint("Room conflict"); } Constraint teacherConflict(ConstraintFactory constraintFactory) { @@ -466,7 +467,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider { Joiners.equal(Lesson::getTimeslot), Joiners.equal(Lesson::getTeacher), Joiners.lessThan(Lesson::getId)) - .penalize("Teacher conflict", HardSoftScore.ONE_HARD); + .penalize(HardSoftScore.ONE_HARD) + .asConstraint(""Teacher conflict"); } Constraint studentGroupConflict(ConstraintFactory constraintFactory) { @@ -476,7 +478,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider { Joiners.equal(Lesson::getTimeslot), Joiners.equal(Lesson::getStudentGroup), Joiners.lessThan(Lesson::getId)) - .penalize("Student group conflict", HardSoftScore.ONE_HARD); + .penalize(HardSoftScore.ONE_HARD) + .asConstraint(""Student group conflict"); } }