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

Language | Haskell2010 |

`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

- data ProblemAnalysis level locationId synchronisationId teacherId timeslotId
- countStudentPlaces :: Ord locationId => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> Course synchronisationId level timeslotId -> locationId -> NStudents
- findCourseFor :: (Eq level, Ord teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> Lesson locationId teacherId level -> Course synchronisationId level timeslotId
- findCourseForLocationViewLesson :: (Eq level, Ord teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> locationId -> Lesson teacherId level -> Course synchronisationId level timeslotId
- findCourseForTeacherViewLesson :: (Eq level, Ord teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> teacherId -> Lesson locationId level -> Course synchronisationId level timeslotId
- findDistinctSynchronisationIds :: ProblemAnalysis level locationId synchronisationId teacherId timeslotId -> [synchronisationId]
- lookupCourseFor :: (Eq level, Ord teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> Lesson locationId teacherId level -> Maybe (Course synchronisationId level timeslotId)
- 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
- areAnyResourcesBookedForGroupMeeting :: (Ord locationId, Ord teacherId, Ord timeslotId) => ProblemAnalysis level locationId synchronisationId teacherId timeslotId -> Time timeslotId -> StudentBody -> locationId -> teacherId -> Bool
- areAvailableResources :: (Ord locationId, Ord teacherId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> Day -> StudentBody -> Lesson locationId teacherId level -> Bool
- doAllCoursesSatifyingAnotherKnowledgeRequirementSpecifyThisTime :: (Ord level, Ord timeslotId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> ProblemAnalysis level locationId synchronisationId teacherId timeslotId -> Subject level -> Coordinates timeslotId -> Bool
- isFree :: (HumanResource humanResource, Resource humanResource, Ord timeslotId) => ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId -> Time timeslotId -> humanResource -> Bool
- isValidTimeslotId :: Eq timeslotId => ProblemAnalysis level locationId synchronisationId teacherId timeslotId -> timeslotId -> Bool

# Types

## Type-synonyms

## Data-types

data ProblemAnalysis level locationId synchronisationId teacherId timeslotId Source #

The results of the analysis of `ProblemParameters`

.

# Functions

:: Ord locationId | |

=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId | |

-> Course synchronisationId level timeslotId | The |

-> locationId | A specific |

-> NStudents |

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

:: (Eq level, Ord teacherId) | |

=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId | |

-> Lesson locationId teacherId level | The |

-> Course synchronisationId level timeslotId | The |

- 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 *synchronisationId*s, specified amongst all *course*s.

:: (Eq level, Ord teacherId) | |

=> ProblemParameters campus level locationId stream synchronisationId teacherId teachingRatio timeslotId | |

-> Lesson locationId teacherId level | |

-> Maybe (Course synchronisationId level timeslotId) | The |

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 *resource*s, are already required at the specified *time*, for a *meeting* of a *group*.

areAvailableResources Source #

:: (Ord locationId, Ord teacherId) | |

-> Day | The |

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

:: (Ord level, Ord timeslotId) | |

-> ProblemAnalysis level locationId synchronisationId teacherId timeslotId | |

-> Subject level | The |

-> Coordinates timeslotId | The |

-> Bool |

- Checks for the proposed
*booking*, whether all suitable*course*s, 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*.