Skip to content

Commit

Permalink
PLANNER-1709 Avoid deprecated penalize/reward overloads
Browse files Browse the repository at this point in the history
This PR is a DRAFT and will not undrafted before quarkusio/quarkus-quickstarts#1167.
  • Loading branch information
triceo authored Sep 7, 2022
1 parent 2797f5f commit 4cf53b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/src/main/asciidoc/optaplanner.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,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) {
Expand All @@ -465,7 +466,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) {
Expand All @@ -475,7 +477,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");
}

}
Expand Down

0 comments on commit 4cf53b4

Please # to comment.