Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLANNER-1709 Avoid deprecated penalize/reward overloads #27774

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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