Copyright | (c) Justus Adam, 2015 |
---|---|

License | LGPL-3 |

Maintainer | development@justusadam.com |

Stability | experimental |

Portability | POSIX |

Safe Haskell | Safe |

Language | Haskell2010 |

This module provides functions for calculating possibilities for an ideal schedule layout from weighted Lessons as well as providing functions for converting them into readable/printable format.

- calcFromMap :: Ord s => Map s [Lesson s] -> Maybe [MappedSchedule s]
- calcFromList :: Ord s => [Lesson s] -> Maybe [MappedSchedule s]
- mapToSubject :: Ord s => [Lesson s] -> Map s [Lesson s]
- totalWeight :: MappedSchedule a -> Int
- time :: Lesson a -> Timeslot
- data Lesson s = Lesson {}
- type Timeslot = (Int, Int)
- type MappedSchedule s = Map Timeslot (Lesson s)
- type MappedLessons s = Map s [Lesson s]

# Documentation

calcFromMap :: Ord s => Map s [Lesson s] -> Maybe [MappedSchedule s]

Main evaluation function
Transforms a map of weighted `Lesson`

s of a particular subject into a list
of lightest schedules by branching the evaluation at avery point
where there is a timeslot collision

calcFromList :: Ord s => [Lesson s] -> Maybe [MappedSchedule s]

Same as `calcFromMap`

but operates on a List of `Lesson`

s

mapToSubject :: Ord s => [Lesson s] -> Map s [Lesson s]

Map a List of `Lesson`

s to their respective subjects

totalWeight :: MappedSchedule a -> Int

Convenience function to obtain the total weight of a particular Schedule

data Lesson s

Base datastructure for representing lessons

type MappedSchedule s = Map Timeslot (Lesson s)

type Alias for readability represents a schedule

type MappedLessons s = Map s [Lesson s]

type Alias for readability maps lessons to their respective subject