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

Safe HaskellNone
LanguageHaskell2010

WeekDaze.Data.Location

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Defines the attributes of a location, in terms of its; capacity, facilities, whether it's off-site, & its availability.
  • It refers to a more general concept than a merely a class-room, including for example, an assembly-hall or a games-field.
Synopsis

Types

Type-synonyms

type FacilityName = String Source #

  • A subject-specific facility, e.g. "desks", "musical instruments", or "goal-posts".
  • The specific string used to designate these must match those defined for courses.

type FacilityNames = Set FacilityName Source #

The set of facility-names advertised by a location.

type WastedResources = (NStudents, FacilityNames) Source #

A measure of the capacity & specific facilities, which are available at a location, but are unused in some context.

type Locus locationId = Set locationId Source #

A collection of distinct location-ids.

Data-types

data Profile campus Source #

Aggregates the attributes of a location, which a generalisation of a room, since it also includes games-fields.

Instances
Eq campus => Eq (Profile campus) Source # 
Instance details

Defined in WeekDaze.Data.Location

Methods

(==) :: Profile campus -> Profile campus -> Bool #

(/=) :: Profile campus -> Profile campus -> Bool #

Show campus => Show (Profile campus) Source # 
Instance details

Defined in WeekDaze.Data.Location

Methods

showsPrec :: Int -> Profile campus -> ShowS #

show :: Profile campus -> String #

showList :: [Profile campus] -> ShowS #

NFData campus => NFData (Profile campus) Source # 
Instance details

Defined in WeekDaze.Data.Location

Methods

rnf :: Profile campus -> () #

(Default campus, Eq campus, XmlPickler campus, Show campus) => XmlPickler (Profile campus) Source # 
Instance details

Defined in WeekDaze.Data.Location

Methods

xpickle :: PU (Profile campus) #

Show campus => SelfValidator (Profile campus) Source # 
Instance details

Defined in WeekDaze.Data.Location

Methods

getErrors :: Profile campus -> [String] #

isValid :: Profile campus -> Bool #

Resource (Profile campus) Source # 
Instance details

Defined in WeekDaze.Data.Location

Constants

capacityTag :: String Source #

Used to qualify SQL & XML.

facilityTypeIdTag :: String Source #

Used to qualify SQL & XML.

facilityNameTag :: String Source #

Used to qualify SQL & XML.

facilityValueTag :: String Source #

Used to qualify XML.

defaultFacilityNames :: FacilityNames Source #

The default value for facilityNames.

Functions

calculateWaste Source #

Arguments

:: NStudents

The required capacity.

-> FacilityNames

The required facilities.

-> Profile campus

The location whose resources are to be compared with requirements.

-> WastedResources 
  • Measures the excess capacity & unused facilities, of the specified location.
  • All facilities are considered equal.
  • CAVEAT: each location must have previously passed isSuitable.

calculateRelativeWaste :: Fractional relativeWaste => Profile campus -> WastedResources -> (relativeWaste, relativeWaste) Source #

Convert WastedResources to a pair of ratios.

calculateRelativeUse :: Fractional relativeUse => Profile campus -> WastedResources -> (relativeUse, relativeUse) Source #

The relative extent to which capacity & facilities are used.

Accessors

Constructor

mkProfile :: Show campus => NStudents -> FacilityNames -> Availability -> campus -> Profile campus Source #

Smart constructor.

Predicates

hasFacilities :: Profile campus -> Bool Source #

True if the location has some facilities.

isSuitable :: NStudents -> FacilityNames -> Profile campus -> Bool Source #

  • True if the Profile meets or exceeds the specified criteria.
  • Takes no account of either availability or campus.