Add overlapping constraint
This commit is contained in:
parent
ce4e4635e3
commit
e7bdaabca8
|
@ -56,6 +56,17 @@ fun checkConstraints(
|
|||
}
|
||||
}
|
||||
|
||||
for (s in against) {
|
||||
if (
|
||||
schedule != s &&
|
||||
schedule.room.id == s.room.id &&
|
||||
start < s.getAbsoluteEndTime() &&
|
||||
s.getAbsoluteStartTime() < end
|
||||
) {
|
||||
errors += ConstraintError("Work group cannot be at same time with ${s.workGroup.name} at the same room ${schedule.room.name}!")
|
||||
}
|
||||
}
|
||||
|
||||
for ((type, constraints) in schedule.workGroup.constraints.groupBy { it.type }) {
|
||||
when (type) {
|
||||
ConstraintType.OnlyOnDay -> {
|
||||
|
|
Loading…
Reference in a new issue