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:
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.
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
):
DefaultSlot
instances are discretized into timeslots of a uniform length (beginning at the start
and dropping partial timeslots at the end)
→ each DefaultSlot
forms a "block"The unit tests are expanded quite a bit to test the correctness of the export.
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
.
Availability::{merge_with,intersect_with}
: If both objects are from the same Event
, set the event also for the returned Availability
objectAvailibility::is_event_covered
to check if Event
is covered by a list of Availability
objects
Availability::with_event_length
: To my understanding the returned availability does in fact not have the exact duration of `eventak_requirements_changed_handler
: Skip slots with no set roombeautifulsoup4
to test requirementsAKModel/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.
end - start
is not a multiple of duration
, the last slot is dropped as well.Event::uniform_time_slots
to uniformly discretize the full event into blocks of time slots:
Event::_generate_slots_from_block
Event::default_time_slots
to derive blocks by uniformly discretizing DefaultSlots
DefaultSlot
of the event into one block.Event::merge_blocks
: Merge blocks in iterable
Event::discretize_timeslots
: To select the discretization schemeEvent::schedule_from_json
: Load scheduling from json file, i.e. assign each slot a room, start time and durationexport_slot
to Event to store the discretization granularity for the JSON exportAKCategory
AKOwner::create_category_constraints
: static method to create constraint strings for all AKCategories in iterableRoom
Room::as_json
: Export JSON representation for the room objectAKSlot
AKSlot::as_json
: Export JSON representation for the AK
object of this slot