Skip to content

Commit 4cf53b4

Browse files
authored
PLANNER-1709 Avoid deprecated penalize/reward overloads
This PR is a DRAFT and will not undrafted before quarkusio/quarkus-quickstarts#1167.
1 parent 2797f5f commit 4cf53b4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/src/main/asciidoc/optaplanner.adoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
455455
// ... and the pair is unique (different id, no reverse pairs) ...
456456
Joiners.lessThan(Lesson::getId))
457457
// ... then penalize each pair with a hard weight.
458-
.penalize("Room conflict", HardSoftScore.ONE_HARD);
458+
.penalize(HardSoftScore.ONE_HARD)
459+
.asConstraint("Room conflict");
459460
}
460461

461462
Constraint teacherConflict(ConstraintFactory constraintFactory) {
@@ -465,7 +466,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
465466
Joiners.equal(Lesson::getTimeslot),
466467
Joiners.equal(Lesson::getTeacher),
467468
Joiners.lessThan(Lesson::getId))
468-
.penalize("Teacher conflict", HardSoftScore.ONE_HARD);
469+
.penalize(HardSoftScore.ONE_HARD)
470+
.asConstraint(""Teacher conflict");
469471
}
470472

471473
Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
@@ -475,7 +477,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
475477
Joiners.equal(Lesson::getTimeslot),
476478
Joiners.equal(Lesson::getStudentGroup),
477479
Joiners.lessThan(Lesson::getId))
478-
.penalize("Student group conflict", HardSoftScore.ONE_HARD);
480+
.penalize(HardSoftScore.ONE_HARD)
481+
.asConstraint(""Student group conflict");
479482
}
480483

481484
}

0 commit comments

Comments
 (0)