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

Safe HaskellNone
LanguageHaskell2010

WeekDaze.ProblemConfiguration.ProblemAnalysis

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Loosely connected utilities, which rely only on the ProblemParameters, rather than on the dynamically changing state of the timetable.
  • As a result, some of these functions can effectively be cached, after the problem has been defined.
Synopsis

Types

Type-synonyms

Data-types

data ProblemAnalysis level locationId synchronisationId teacherId timeslotId Source #

The results of the analysis of ProblemParameters.

Functions

countStudentPlaces Source #

Arguments

:: Ord locationId 
=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId 
-> Course synchronisationId level timeslotId

The course one wishes to query.

-> locationId

A specific location in which the course may be held.

-> NStudents 

Get the number of student-places, when accounting for the capacity-limits imposed by both the course & location; but not for any students already booked.

findCourseFor Source #

Arguments

:: (Eq level, Ord teacherId) 
=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId 
-> Lesson locationId teacherId level

The studentViewLesson extracted from a studentViewTimetable.

-> Course synchronisationId level timeslotId

The course of which the lesson was a part.

  • Find the unique course corresponding to the specified studentViewLesson.
  • CAVEAT: the specified lesson is assumed to exist in the timetable, & therefore must have a corresponding course.

findCourseForLocationViewLesson :: (Eq level, Ord teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> locationId -> Lesson teacherId level -> Course synchronisationId level timeslotId Source #

Find the unique course corresponding to the specified locationViewLesson.

findCourseForTeacherViewLesson :: (Eq level, Ord teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> teacherId -> Lesson locationId level -> Course synchronisationId level timeslotId Source #

Find the unique course corresponding to the specified teacherViewLesson.

findDistinctSynchronisationIds :: ProblemAnalysis level locationId synchronisationId teacherId timeslotId -> [synchronisationId] Source #

Returns the list of distinct synchronisationIds, specified amongst all courses.

lookupCourseFor Source #

Arguments

:: (Eq level, Ord teacherId) 
=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId 
-> Lesson locationId teacherId level 
-> Maybe (Course synchronisationId level timeslotId)

The course of which the lesson may be a part.

Lookup the course corresponding to the specified lesson.

Constructor

mkProblemAnalysis :: (Ix timeslotId, Enum timeslotId, Ord level, Ord locationId, Ord synchronisationId, Ord teacherId, RealFrac teachingRatio, Show locationId, Show teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> ProblemAnalysis level locationId synchronisationId teacherId timeslotId Source #

Constructor.

Predicates

areAnyResourcesBookedForGroupMeeting :: (Ord locationId, Ord teacherId, Ord timeslotId) => ProblemAnalysis level locationId synchronisationId teacherId timeslotId -> Time timeslotId -> StudentBody -> locationId -> teacherId -> Bool Source #

True if any of the required resources, are already required at the specified time, for a meeting of a group.

areAvailableResources Source #

Arguments

:: (Ord locationId, Ord teacherId) 
=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId 
-> Day

The day on which we want to book a lesson.

-> StudentBody 
-> Lesson locationId teacherId level

The rendezvous we want to book.

-> Bool 

True if the specified student-body, & the location & teacher referenced in the proposed lesson, are regularly available on the specified day.

doAllCoursesSatifyingAnotherKnowledgeRequirementSpecifyThisTime Source #

Arguments

:: (Ord level, Ord timeslotId) 
=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId 
-> ProblemAnalysis level locationId synchronisationId teacherId timeslotId 
-> Subject level

The subject of the proposed lesson.

-> Coordinates timeslotId

The student-body & time, of the proposed booking.

-> Bool 
  • Checks for the proposed booking, whether all suitable courses, for any one of the student-body's other knowledge-requirements, specify the proposed time.
  • CAVEAT: doesn't check whether the specified subject can only be satisfied by a synchronised course, & if so, whether any student-body who requires a different course from the same synchronised set, has any other knowledge-requirement which can only be satisfied by a course which specifies the proposed time. This tricky scenario is dealt with in the lesson-criterion minimiseBookingAtAnotherCoursesSpecifiedTime where the specific course is known.

isFree :: (HumanResource humanResource, Resource humanResource, Ord timeslotId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> Time timeslotId -> humanResource -> Bool Source #

True if the specified human-resource is available & not booked for a meeting at the specified time.

isValidTimeslotId :: Eq timeslotId => ProblemAnalysis level locationId synchronisationId teacherId timeslotId -> timeslotId -> Bool Source #

True if the specified timeslotId falls within the range defined for a day.