Portability | portable |
---|---|
Stability | provisional |
Maintainer | Richard Senington <sc06r2s@leeds.ac.uk> |
Safe Haskell | Safe-Inferred |
A library for the representation and manipulation of Time Tabling Problems. Still experimental and not particularly general. The underlying problem description is that used by the International Timetabling Competition, and the code is rather specialised towards that, with the aim of being used for meta-heuristics.
- data TimeTable = TimeTable {
- numberOfEvents :: Int
- numberOfRooms :: Int
- numberOfPeople :: Int
- numberOfTimeSlots :: Int
- personEventLookup :: PersonNumber -> [EventNumber]
- eventPersonLookup :: EventNumber -> [PersonNumber]
- eventRoomLookup :: EventNumber -> [RoomNumber]
- roomEventLookup :: RoomNumber -> [EventNumber]
- eventLocation :: Map EventNumber (TimeSlot, RoomNumber)
- locationEvent :: Map (TimeSlot, RoomNumber) EventNumber
- personUsage :: Map (TimeSlot, PersonNumber) Counter
- unscheduledEvents :: [EventNumber]
- lastDay :: Int
- lastSlotOfDay :: Int
- overSchedule :: Counter
- daynumberDecode :: TimeSlot -> DayNumber
- dayslotDecode :: TimeSlot -> DaySlot
- eventsInDay :: Map (DayNumber, PersonNumber) Counter
- singleEventInDayCounter :: Counter
- lastSlotOfDayCounter :: Counter
- moreThanTwoEventsCounter :: Counter
- viewConstrainedProblem :: TimeTable -> String
- descheduleEvent :: EventNumber -> TimeTable -> TimeTable
- descheduleSlot :: TimeSlot -> RoomNumber -> TimeTable -> TimeTable
- schedule :: TimeSlot -> RoomNumber -> EventNumber -> TimeTable -> TimeTable
- viewTimeTableDetails :: TimeTable -> String
- ittcValidity :: TimeTable -> Bool
- ittcObjectiveValue :: TimeTable -> Int
- timeTableDetailsAsCSV :: TimeTable -> String
- timeTableForRoomAsCSV :: TimeTable -> RoomNumber -> String
- currentlyScheduledEvents :: TimeTable -> [EventNumber]
- type TimeSlot = Int
- type DayNumber = Int
- type DaySlot = Int
- type RoomNumber = Int
- type EventNumber = Int
- type PersonNumber = Int
- type FeatureNumber = Int
- type Counter = Int
Documentation
Core concepts, location, timeslot, person, two events cannot happen in the same place at the same time. This version expects a constrained data set, so that the roomEvent lookup for example only yields events that can reasonably be scheduled in that room.
Originally I intended the objectives (low over scheduling of people) and the soft objectives to be handled somewhere else. At this time, I am unsure how to abstract this, and I want a system that works now, so I will over specialise to the time tabling competition specifications. Hopefully this can be rectified in a later version.
TimeTable | |
|
viewConstrainedProblem :: TimeTable -> StringSource
Splitting off the two parts of show, so we have a simple show for the state of the solution, a more complex solution description and the constant constrained problem.
descheduleEvent :: EventNumber -> TimeTable -> TimeTableSource
Fails silently if the event is not currently scheduled.
descheduleSlot :: TimeSlot -> RoomNumber -> TimeTable -> TimeTableSource
Fails silently if the time slot and room number are not booked.
schedule :: TimeSlot -> RoomNumber -> EventNumber -> TimeTable -> TimeTableSource
Fails silently and does no update the schedule if the very hard constraints fail.
viewTimeTableDetails :: TimeTable -> StringSource
The other part of the time table data type. See the current status of the solution.
ittcValidity :: TimeTable -> BoolSource
The validity function as specific by the 2002 competition rules. Basically no clashes at this point.
ittcObjectiveValue :: TimeTable -> IntSource
The objective function as specific by the 2002 competition rules.
timeTableDetailsAsCSV :: TimeTable -> StringSource
A simple spread sheet display seems like a good idea.
timeTableForRoomAsCSV :: TimeTable -> RoomNumber -> StringSource
Maybe a helper, making it public anyway.
currentlyScheduledEvents :: TimeTable -> [EventNumber]Source
Just a combination of existing useful functions.
type RoomNumber = IntSource
type EventNumber = IntSource
type PersonNumber = IntSource
type FeatureNumber = IntSource