Skip to content
Snippets Groups Projects
Commit 417e8151 authored by Felix Blanke's avatar Felix Blanke
Browse files

Add other slots of same AK to conflict list

parent 7a1c5004
Branches
No related tags found
5 merge requests!262[WIP] compatibility with koma solver import/export,!261[WIP] compatibility with koma solver import/export,!260[WIP] import/export merge,!259Add view to clear schedule,!235Merge fork for interoperability of KoMa solver
...@@ -955,6 +955,7 @@ class AKSlot(models.Model): ...@@ -955,6 +955,7 @@ class AKSlot(models.Model):
conflict_slots = AKSlot.objects.filter(ak__in=self.ak.conflicts.all()) conflict_slots = AKSlot.objects.filter(ak__in=self.ak.conflicts.all())
dependency_slots = AKSlot.objects.filter(ak__in=self.ak.prerequisites.all()) dependency_slots = AKSlot.objects.filter(ak__in=self.ak.prerequisites.all())
other_ak_slots = AKSlot.objects.filter(ak=self.ak).exclude(pk=self.pk)
ceil_offet_eps = decimal.Decimal(1e-4) ceil_offet_eps = decimal.Decimal(1e-4)
...@@ -963,7 +964,9 @@ class AKSlot(models.Model): ...@@ -963,7 +964,9 @@ class AKSlot(models.Model):
"id": str(self.pk), "id": str(self.pk),
"duration": math.ceil(self.duration * self.slots_in_an_hour - ceil_offet_eps), "duration": math.ceil(self.duration * self.slots_in_an_hour - ceil_offet_eps),
"properties": { "properties": {
"conflicts": [str(conflict.pk) for conflict in conflict_slots.all()], "conflicts":
[str(conflict.pk) for conflict in conflict_slots.all()]
+ [str(second_slot.pk) for second_slot in other_ak_slots.all()],
"dependencies": [str(dep.pk) for dep in dependency_slots.all()], "dependencies": [str(dep.pk) for dep in dependency_slots.all()],
}, },
"room_constraints": [constraint.name "room_constraints": [constraint.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment