@@ -456,7 +456,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
456456 // ... and the pair is unique (different id, no reverse pairs) ...
457457 Joiners.lessThan(Lesson::getId))
458458 // ... then penalize each pair with a hard weight.
459- .penalize("Room conflict", HardSoftScore.ONE_HARD);
459+ .penalize(HardSoftScore.ONE_HARD)
460+ .asConstraint("Room conflict");
460461 }
461462
462463 Constraint teacherConflict(ConstraintFactory constraintFactory) {
@@ -466,7 +467,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
466467 Joiners.equal(Lesson::getTimeslot),
467468 Joiners.equal(Lesson::getTeacher),
468469 Joiners.lessThan(Lesson::getId))
469- .penalize("Teacher conflict", HardSoftScore.ONE_HARD);
470+ .penalize(HardSoftScore.ONE_HARD)
471+ .asConstraint(""Teacher conflict");
470472 }
471473
472474 Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
@@ -476,7 +478,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
476478 Joiners.equal(Lesson::getTimeslot),
477479 Joiners.equal(Lesson::getStudentGroup),
478480 Joiners.lessThan(Lesson::getId))
479- .penalize("Student group conflict", HardSoftScore.ONE_HARD);
481+ .penalize(HardSoftScore.ONE_HARD)
482+ .asConstraint(""Student group conflict");
480483 }
481484
482485}
0 commit comments