schedule-planner

Copyright(c) Justus Adam, 2015
LicenseLGPL-3
Maintainerdevelopment@justusadam.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

SchedulePlanner.Calculator

Description

Exports the most important functions neccessary for the actual work of this software

Synopsis

Documentation

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

Main evaluation function Transforms a map of weighted Lessons 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 Lessons

totalWeight :: MappedSchedule a -> Int

Convenience function to obtain the total weight of a particular Schedule

data Lesson s

Base datastructure for representing lessons

Constructors

Lesson 

Fields

timeslot :: Int
 
day :: Int
 
weight :: Int
 
subject :: s
 

Instances

Eq s => Eq (Lesson s) 
Data s => Data (Lesson s) 
Ord s => Ord (Lesson s) 
Show s => Show (Lesson s) 

type Timeslot = (Int, Int)

type Alias for readability (Slot, Day)

data Target

The scope and target a Rule whishes to influence

Constructors

Slot Int 
Day Int 
Cell Int Int 

data Rule

Weight increase by severity for all Lessons in target

Constructors

Rule 

Fields

target :: Target
 
severity :: Int
 

Instances

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

Map a List of Lessons to their respective subjects

type MappedSchedule s = Map Timeslot (Lesson s)

type Alias for readability represents a schedule

weigh :: [Rule] -> [Lesson s] -> [Lesson s]

Main function of the module.

This funcion calculates weights the Lessons provided applying the Rules provided.

Resulting Lessons are exactly the same, except for the weight component which is the old weight + the weight calculated from the rules