Skip to content

Commit

Permalink
Merge pull request #27774 from triceo/patch-1
Browse files Browse the repository at this point in the history
PLANNER-1709 Avoid deprecated penalize/reward overloads
  • Loading branch information
gsmet authored Feb 1, 2023
2 parents 4a50d50 + 38ee8be commit 5d7c271
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 @@ -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) {
Expand All @@ -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) {
Expand All @@ -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");
}

}
Expand Down

0 comments on commit 5d7c271

Please sign in to comment.