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