Safe Haskell | None |
---|---|

Language | Haskell2010 |

`AUTHOR`

- Dr. Alistair Ward
`DESCRIPTION`

- Defines the specific instance of the underyling generic
`Timetable`

, required to define the weekly*timetable*for all*student*s, i.e. one indexed by`StudentBody`

. - This form of the
*timetable*can be re-indexed to form one appropropriate to either*teacher*s or to*location*s, but is more significant, since it is from this form that the other two are derived.

## Synopsis

- type InterCampusMigrationsByStudentBody = Map StudentBody NTimeslots
- type LessonRunlengthByStudentBody timeslotId locationId teacherId level = Map StudentBody [(Time timeslotId, Code (Lesson locationId teacherId level))]
- type Timetable timeslotId locationId teacherId level = Timetable StudentBody timeslotId (LessonResourceIds locationId teacherId) level
- type StudentClassesByLesson locationId teacherId level = Map (Lesson locationId teacherId level) (Set StudentClass)
- type Booking timeslotId locationId teacherId level = Booking StudentBody timeslotId (LessonResourceIds locationId teacherId) level
- calculateMeanLocusOperandiOfTeachers :: (Ix timeslotId, Fractional mean, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> mean
- calculateWeightedMeanStudentBodyCombinationsPerLesson :: (Ix timeslotId, Fractional weightedMean, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> weightedMean
- extractStudentClassAt :: (Ix timeslotId, Eq level, Eq locationId, Eq teacherId) => Booking timeslotId locationId teacherId level -> Timetable timeslotId locationId teacherId level -> StudentClass
- findDistinctLocationIdsFor :: (Ix timeslotId, Eq teacherId, Ord locationId) => teacherId -> Timetable timeslotId locationId teacherId level -> Locus locationId
- findDistinctTeacherIdsFor :: (Ix timeslotId, Eq locationId, Ord teacherId) => locationId -> Timetable timeslotId locationId teacherId level -> Set teacherId
- findStudentClassesByLessonFor :: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> StudentBody -> StudentClassesByLesson locationId teacherId level
- findStudentClassByTimeByLesson :: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> Map (Lesson locationId teacherId level) (Map (Time timeslotId) StudentClass)
- findStudentClassesByLesson :: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> StudentClassesByLesson locationId teacherId level
- getStudentBodies :: Timetable timeslotId locationId teacherId level -> [StudentBody]
- areBookedResourcesAt :: (Ix timeslotId, Eq locationId, Eq teacherId) => Booking timeslotId locationId teacherId level -> Timetable timeslotId locationId teacherId level -> Bool
- breaksRoutine :: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> StudentBody -> Lesson locationId teacherId level -> Bool
- toXHtml :: (Ix timeslotId, Fractional minimumContrastRatio, Ord level, Ord locationId, Ord minimumContrastRatio, Ord teacherId, RealFrac teachingRatio, Show level, Show locationId, Show stream, Show teacherId, HTML level, HTML locationId, HTML stream, HTML synchronisationId, HTML teacherId, HTML timeslotId) => InterCampusMigrationsByStudentBody -> Requirements (KnowledgeByStudentBody level) -> LessonRunlengthByStudentBody timeslotId locationId teacherId level -> LessonRunlengthByStudentBody timeslotId locationId teacherId level -> NTimeslots -> (Lesson locationId teacherId level -> Course synchronisationId level timeslotId) -> StudentBodyRegister level stream teachingRatio -> GenericTimetableToMarkup locationId minimumContrastRatio teacherId timeslotId (Timetable timeslotId locationId teacherId level)

# Types

## Type-synonyms

type InterCampusMigrationsByStudentBody = Map StudentBody NTimeslots Source #

The type of a map passed to `toXHtml`

.

type LessonRunlengthByStudentBody timeslotId locationId teacherId level = Map StudentBody [(Time timeslotId, Code (Lesson locationId teacherId level))] Source #

The type of a map passed to `toXHtml`

.

type Timetable timeslotId locationId teacherId level = Timetable StudentBody timeslotId (LessonResourceIds locationId teacherId) level Source #

- An association-list of the timetables for all
*students*. - Since
*body of students*will have identical requirements, this is indexed by*body*rather than an individual student.

type StudentClassesByLesson locationId teacherId level = Map (Lesson locationId teacherId level) (Set StudentClass) Source #

Sets of *student-classes* indexed by the *lesson* for which they've been booked.

type Booking timeslotId locationId teacherId level = Booking StudentBody timeslotId (LessonResourceIds locationId teacherId) level Source #

A *lesson* qualified by the *coordinates* at which it is booked.

# Functions

calculateMeanLocusOperandiOfTeachers :: (Ix timeslotId, Fractional mean, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> mean Source #

- Gets the average number of
*location*s visited by*teacher*s. - Because only
*teacher*s who've at least one*booking*are included, the result is only less than one if there're zero bookings.

calculateWeightedMeanStudentBodyCombinationsPerLesson :: (Ix timeslotId, Fractional weightedMean, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> weightedMean Source #

- Each
*student-body*can be booked for a specific*lesson*(i.e. to learn a*subject*, taught by a*teacher*, at a*location*), by merging with other*student-bodies*in a variety of combinations, to form a*student-class*. - Gets the average number of
*student-body*-combinations, over the domain of*student-bodies*&`Lesson`

s. Each number of combinations is weighted by the size of the*student-body*, in the average.

extractStudentClassAt :: (Ix timeslotId, Eq level, Eq locationId, Eq teacherId) => Booking timeslotId locationId teacherId level -> Timetable timeslotId locationId teacherId level -> StudentClass Source #

- Get the
*student-bodies*who are simultaneously booked to study the same*subject*, at the same*location*, with the same*teacher*. - CAVEAT: performance-hotspot.

findDistinctLocationIdsFor :: (Ix timeslotId, Eq teacherId, Ord locationId) => teacherId -> Timetable timeslotId locationId teacherId level -> Locus locationId Source #

- Find the distinct
*locationId*s booked by the referenced*teacher*. - CAVEAT: doesn't account for the
*location*of any*meeting*s.

findDistinctTeacherIdsFor :: (Ix timeslotId, Eq locationId, Ord teacherId) => locationId -> Timetable timeslotId locationId teacherId level -> Set teacherId Source #

Find the distinct *teacherId*s booked at the referenced *location*.

findStudentClassesByLessonFor Source #

:: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) | |

=> Timetable timeslotId locationId teacherId level | |

-> StudentBody | The |

-> StudentClassesByLesson locationId teacherId level |

- Because (given sufficient
*location*-capacity) one may simultaneously book more than one*student-body*, at a single*location*, taught by a single*teacher*, in a single*subject*, the specified*timetable*may already contain*booking*s formed from a variety of such combinations, each having the specified*student-body*as a member. Since one may reasonably wish to minimise these combinations, this function aims to enumerate distinct*student-class*es per type of*lesson*. - For each distinct
*lesson*of which the specified*student-body*is a member, it identifies the set of*student-class*es already booked. - Any set of size greater than one, represents a
*student-body combination*for that*lesson*.

findStudentClassByTimeByLesson :: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> Map (Lesson locationId teacherId level) (Map (Time timeslotId) StudentClass) Source #

- Catalogues by
*lesson*, the single*student-class*, at each booking-*time*. - A
*student-body combination*exists for a specific*lesson*, if within the*booking-time*s identified, any*student*exists in more than one of the distinct*student-class*es; a necessary but insufficient prerequisit for which is, that within those*time*s, more than one distinct*student-class*must exist.

findStudentClassesByLesson :: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) => Timetable timeslotId locationId teacherId level -> StudentClassesByLesson locationId teacherId level Source #

- Equivalent to calling
`findStudentClassesByLessonFor`

for each*student-body*, & merging the results; but more efficient. - A
*student-body combination*exists for a specific*lesson*, if any*student*exists in more than one of the distinct*student-class*es; a necessary but insufficient prerequisit for which is, that more than one distinct*student-class*must exist. E.g. if for a particular*lesson*-type, there are two*booking*s each for either one of two*student-bodies*, then neither will be part of a*student-body combination*, but when the results are merged by removing the booking-*time*, the*lesson*will map to a set of size two.

## Accessors

getStudentBodies :: Timetable timeslotId locationId teacherId level -> [StudentBody] Source #

Accessor.

## Predicates

areBookedResourcesAt :: (Ix timeslotId, Eq locationId, Eq teacherId) => Booking timeslotId locationId teacherId level -> Timetable timeslotId locationId teacherId level -> Bool Source #

- True if either of the
*resource*s referenced in the specified*booking*, are already booked at the same*time*in the*timetable*. - CAVEAT: it is assumed that the required
*lesson*hasn't already been defined in the*timetable*, since otherwise both*location*&*teacher*would clearly be booked. - CAVEAT: performance-hotspot.

:: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) | |

=> Timetable timeslotId locationId teacherId level | The current |

-> StudentBody | The |

-> Lesson locationId teacherId level | The new |

-> Bool |

- True if the specified
*lesson*, employs either a different*teacher*, or uses a different*location*, as other*booking*s in the same*subject*. - CAVEAT: the routine could include mergers with other
*student-bodies*to form a consistent*student-class*, though currently this a soft constraint addressed by both*lesson-criteria*&*timetable-criteria*.

## Translation

:: (Ix timeslotId, Fractional minimumContrastRatio, Ord level, Ord locationId, Ord minimumContrastRatio, Ord teacherId, RealFrac teachingRatio, Show level, Show locationId, Show stream, Show teacherId, HTML level, HTML locationId, HTML stream, HTML synchronisationId, HTML teacherId, HTML timeslotId) | |

=> InterCampusMigrationsByStudentBody | The number of inter- |

-> Requirements (KnowledgeByStudentBody level) | The unbooked |

-> LessonRunlengthByStudentBody timeslotId locationId teacherId level | Excessively long subject-sessions. |

-> LessonRunlengthByStudentBody timeslotId locationId teacherId level | Short subject-sessions. |

-> NTimeslots | The number of |

-> (Lesson locationId teacherId level -> Course synchronisationId level timeslotId) | Find the |

-> StudentBodyRegister level stream teachingRatio | |

-> GenericTimetableToMarkup locationId minimumContrastRatio teacherId timeslotId (Timetable timeslotId locationId teacherId level) |

- Render in
*XHTML*, as a*definition-list*. - CAVEAT: the extra parameters make it difficult to express this as an instance of
`HTML`

.