@@ -456,7 +456,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
456
456
// ... and the pair is unique (different id, no reverse pairs) ...
457
457
Joiners.lessThan(Lesson::getId))
458
458
// ... then penalize each pair with a hard weight.
459
- .penalize("Room conflict", HardSoftScore.ONE_HARD);
459
+ .penalize(HardSoftScore.ONE_HARD)
460
+ .asConstraint("Room conflict");
460
461
}
461
462
462
463
Constraint teacherConflict(ConstraintFactory constraintFactory) {
@@ -466,7 +467,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
466
467
Joiners.equal(Lesson::getTimeslot),
467
468
Joiners.equal(Lesson::getTeacher),
468
469
Joiners.lessThan(Lesson::getId))
469
- .penalize("Teacher conflict", HardSoftScore.ONE_HARD);
470
+ .penalize(HardSoftScore.ONE_HARD)
471
+ .asConstraint(""Teacher conflict");
470
472
}
471
473
472
474
Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
@@ -476,7 +478,8 @@ public class TimeTableConstraintProvider implements ConstraintProvider {
476
478
Joiners.equal(Lesson::getTimeslot),
477
479
Joiners.equal(Lesson::getStudentGroup),
478
480
Joiners.lessThan(Lesson::getId))
479
- .penalize("Student group conflict", HardSoftScore.ONE_HARD);
481
+ .penalize(HardSoftScore.ONE_HARD)
482
+ .asConstraint(""Student group conflict");
480
483
}
481
484
482
485
}
0 commit comments