Skip to content
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