weekdaze-0.0.0.3: A school-timetable problem-solver.

Safe HaskellNone
LanguageHaskell2010

WeekDaze.StudentView.Timetable

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Defines the specific instance of the underyling generic Timetable, required to define the weekly timetable for all students, i.e. one indexed by StudentBody.
  • This form of the timetable can be re-indexed to form one appropropriate to either teachers or to locations, but is more significant, since it is from this form that the other two are derived.
Synopsis

Types

Type-synonyms

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 locations visited by teachers.
  • Because only teachers 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 & Lessons. 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 locationIds booked by the referenced teacher.
  • CAVEAT: doesn't account for the location of any meetings.

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

Find the distinct teacherIds booked at the referenced location.

findStudentClassesByLessonFor Source #

Arguments

:: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) 
=> Timetable timeslotId locationId teacherId level 
-> StudentBody

The student-body, whose student-class-membership one requires.

-> 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 bookings 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-classes per type of lesson.
  • For each distinct lesson of which the specified student-body is a member, it identifies the set of student-classes 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-times identified, any student exists in more than one of the distinct student-classes; a necessary but insufficient prerequisit for which is, that within those times, 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-classes; 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 bookings 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 resources 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.

breaksRoutine Source #

Arguments

:: (Ix timeslotId, Ord level, Ord locationId, Ord teacherId) 
=> Timetable timeslotId locationId teacherId level

The current timetable.

-> StudentBody

The student-body whose routine to which the new lesson should conform.

-> Lesson locationId teacherId level

The new lesson to be booked.

-> Bool 
  • True if the specified lesson, employs either a different teacher, or uses a different location, as other bookings 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

toXHtml Source #

Arguments

:: (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-campus student-migrations, indexed by student-body.

-> Requirements (KnowledgeByStudentBody level)

The unbooked knowledge-requirements by student-body, partitioned into core & optional subjects.

-> LessonRunlengthByStudentBody timeslotId locationId teacherId level

Excessively long subject-sessions.

-> LessonRunlengthByStudentBody timeslotId locationId teacherId level

Short subject-sessions.

-> NTimeslots

The number of time-slots per day.

-> (Lesson locationId teacherId level -> Course synchronisationId level timeslotId)

Find the course to which the specified lesson belongs.

-> 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.