Merge fork for interoperability of KoMa solver
-
Review changes -
-
Download -
Patches
-
Plain diff
The KoMa developed a tool to approximate an optimal conference schedule based on constraints and participant preferences. The aim of this MR is to enable interoperability with that solver. To do this, two functionalities are added:
- A workflow to export data from this tool (rooms, AKs, timeslots, ...) in a JSON format that can be fed to the solver
- A workflow to import the schedule of the solver back into this
Note that the solver also needs preferences of all participants. As this tool does not collect such data (for now at least), one needs to employ a third tool, e.g. this very basic one.
Export data to the solver
The key functionality is the AKJSONExportView
which generates a JSON string that can be imported into the solver.
Notably, the KoMa solver models timeslots differently to this tool. Where this tool basically allows for arbitrary time slot design, the KoMa solver has a more constricted notion: The timeslots are modeled as blocks (i.e. simple lists) of consecutive timeslots of a fixed length. The AKs simply store an integer duration, i.e. the number of consecutive timeslots covered by the AK.
To convert the data of this tool into the solver's model, the following strategy is implemented (see Event::default_time_slots
, Event::merge_blocks
):
- all
DefaultSlot
instances are discretized into timeslots of a uniform length (beginning at thestart
and dropping partial timeslots at the end) → eachDefaultSlot
forms a "block" - Consecutive blocks are merged. Overlapping timeslots are identified with each other, but partial overlap errors out
The unit tests are expanded quite a bit to test the correctness of the export.
Import a schedule from the solver
This is realized in the form JSONImportForm
and the corresponding view AKJSONImportView
.
The JSON string is simply read from the form and passed to Event::schedule_from_json
.
Minor changes
- Bump python version to 3.10
-
Availability::{merge_with,intersect_with}
: If both objects are from the sameEvent
, set the event also for the returnedAvailability
object - Add utility class-method
Availibility::is_event_covered
to check ifEvent
is covered by a list ofAvailability
objects- (Possible bug in
Availability::with_event_length
: To my understanding the returned availability does in fact not have the exact duration of `event
- (Possible bug in
-
ak_requirements_changed_handler
: Skip slots with no set room - Add
beautifulsoup4
to test requirements
Changes to model objects (AKModel/models.py
)
Event
-
Event::_generate_slots_from_block
: Given a start and time as well as a slot duration, discretizes it into blocks of consecutive discrete time slots.- Slots are dropped if no room is available for the slot.
- If
end - start
is not a multiple ofduration
, the last slot is dropped as well.
-
Event::uniform_time_slots
to uniformly discretize the full event into blocks of time slots:- For the block creation, see
Event::_generate_slots_from_block
- Adds constraints to allow all AKCategories in each timeslot
- For the block creation, see
-
Event::default_time_slots
to derive blocks by uniformly discretizingDefaultSlots
- Splits each
DefaultSlot
of the event into one block. - Adds constraints such that only AKs from the DefaultSlot's primary categories are allowed to be scheduled in the block
- Splits each
-
Event::merge_blocks
: Merge blocks in iterable- Flatten blocks into list of all timeslots
- If two slots overlap:
- If start and end match: merge slots
- If overlap only partial: error out
- group consecutive slots into block
-
Event::discretize_timeslots
: To select the discretization scheme -
Event::schedule_from_json
: Load scheduling from json file, i.e. assign each slot a room, start time and duration - Add field
export_slot
to Event to store the discretization granularity for the JSON export
AKCategory
-
AKOwner::create_category_constraints
: static method to create constraint strings for all AKCategories in iterable
Room
-
Room::as_json
: Export JSON representation for the room object
AKSlot
-
AKSlot::as_json
: Export JSON representation for theAK
object of this slot
Open ToDos
Merge request reports
- version 30e4c1d57a
- version 29295a3d8b
- version 28631b8c4f
- version 27ae7ff8b9
- version 269a1182eb
- version 25ba8704fb
- version 24abe8fc86
- version 23bb75b771
- version 22a472b96d
- version 210aab58f9
- version 20803b9edf
- version 191d0e2aaf
- version 18abbe82a1
- version 179237c47c
- version 16c2e5f573
- version 15b1de3d45
- version 146ad0b9f9
- version 13fe24cd4e
- version 12ab8a0014
- version 112a7f8b89
- version 10b36cb333
- version 963d6c5ee
- version 8e7862fee
- version 77a1c5004
- version 6bb1179c7
- version 5e0801c1f
- version 4aee5627c
- version 3c7b910c2
- version 261922712
- version 1c7b910c2
- main (base)
- latest version6b9bedf9141 commits,
- version 30e4c1d57a140 commits,
- version 29295a3d8b130 commits,
- version 28631b8c4f102 commits,
- version 27ae7ff8b9101 commits,
- version 269a1182eb100 commits,
- version 25ba8704fb99 commits,
- version 24abe8fc8697 commits,
- version 23bb75b77196 commits,
- version 22a472b96d95 commits,
- version 210aab58f990 commits,
- version 20803b9edf86 commits,
- version 191d0e2aaf84 commits,
- version 18abbe82a183 commits,
- version 179237c47c82 commits,
- version 16c2e5f57381 commits,
- version 15b1de3d4579 commits,
- version 146ad0b9f977 commits,
- version 13fe24cd4e75 commits,
- version 12ab8a001470 commits,
- version 112a7f8b8969 commits,
- version 10b36cb33367 commits,
- version 963d6c5ee65 commits,
- version 8e7862fee62 commits,
- version 77a1c500456 commits,
- version 6bb1179c752 commits,
- version 5e0801c1f46 commits,
- version 4aee5627c44 commits,
- version 3c7b910c230 commits,
- version 26192271235 commits,
- version 1c7b910c230 commits,
- Side-by-side
- Inline