Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Defines the weightings, associated with each of the soft-constraints, used to compare & select between alternative lesson-definitions, at each stage in the construction of a timetable.
- Hard-constraints (e.g. that a student or teacher can't be in more than one place at a time, or that the capacity of a location can't be exceeded), are never violated, & so don't need to be quantified for subsequent comparison.
Synopsis
- data LessonCriteriaWeights w = MkLessonCriteriaWeights {
- getWeightOfAreResourcesReused :: CriterionWeight w
- getWeightOfGreatestMinimumConsecutiveLessons :: CriterionWeight w
- getWeightOfGreatestRemainingCourseLessons :: CriterionWeight w
- getWeightOfGreatestSynchronisedCourseSetSize :: CriterionWeight w
- getWeightOfIsCoreKnowledgeRequirement :: CriterionWeight w
- getWeightOfIsSpecialistInTopic :: CriterionWeight w
- getWeightOfMatchCourseClassSizeToLocationCapacity :: CriterionWeight w
- getWeightOfMaximiseRelativeFacilityUtilisation :: CriterionWeight w
- getWeightOfMaximiseStudentClassSizeOverCourseClassSize :: CriterionWeight w
- getWeightOfMaximiseStudentClassSizeOverLocationCapacity :: CriterionWeight w
- getWeightOfMinimiseBookingAtAnotherCoursesSpecifiedTime :: CriterionWeight w
- getWeightOfMinimiseBookingOfLocationByOtherTeachers :: CriterionWeight w
- getWeightOfMinimiseDeviationFromTimeslotRequest :: CriterionWeight w
- getWeightOfMinimiseInterCampusMigrationsOfStudents :: CriterionWeight w
- getWeightOfMinimiseInterCampusMigrationsOfTeachers :: CriterionWeight w
- getWeightOfMinimiseStudentBodyCombinations :: CriterionWeight w
- getWeightOfMinimiseTeachersLocusOperandi :: CriterionWeight w
- getWeightOfMinimiseWasteOfScarceFacilities :: CriterionWeight w
- associationList :: [(String, LessonCriteriaWeights w -> CriterionWeight w)]
- tag :: String
- weightOfAreResourcesReusedTag :: String
- weightOfGreatestMinimumConsecutiveLessonsTag :: String
- weightOfGreatestRemainingCourseLessonsTag :: String
- weightOfGreatestSynchronisedCourseSetSizeTag :: String
- weightOfIsCoreKnowledgeRequirementTag :: String
- weightOfIsSpecialistInTopicTag :: String
- weightOfMatchCourseClassSizeToLocationCapacityTag :: String
- weightOfMaximiseRelativeFacilityUtilisationTag :: String
- weightOfMaximiseStudentClassSizeOverCourseClassSizeTag :: String
- weightOfMaximiseStudentClassSizeOverLocationCapacityTag :: String
- weightOfMinimiseBookingAtAnotherCoursesSpecifiedTimeTag :: String
- weightOfMinimiseBookingOfLocationByOtherTeachersTag :: String
- weightOfMinimiseDeviationFromTimeslotRequestTag :: String
- weightOfMinimiseInterCampusMigrationsOfStudentsTag :: String
- weightOfMinimiseInterCampusMigrationsOfTeachersTag :: String
- weightOfMinimiseStudentBodyCombinationsTag :: String
- weightOfMinimiseTeachersLocusOperandiTag :: String
- weightOfMinimiseWasteOfScarceFacilitiesTag :: String
- calculateWeightedMean :: (Fractional weightedMean, Real criterionValue, Real criterionWeight) => LessonCriteriaWeights criterionWeight -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Criterion criterionValue -> Writer [Maybe criterionValue] weightedMean
- perturbWeights :: (Enum f, Fractional f, Real f, Show f, Random f, RandomGen randomGen) => randomGen -> f -> Mutator f
- zeroWeightOfGreatestMinimumConsecutiveLessons :: Num w => Mutator w
- zeroWeightOfGreatestSynchronisedCourseSetSize :: Num w => Mutator w
- zeroWeightOfIsCoreKnowledgeRequirement :: Num w => Mutator w
- zeroWeightOfIsSpecialistInTopic :: Num w => Mutator w
- zeroWeightOfMatchCourseClassSizeToLocationCapacity :: Num w => Mutator w
- zeroWeightOfMaximiseRelativeFacilityUtilisation :: Num w => Mutator w
- zeroWeightOfMaximiseStudentClassSizeOverCourseClassSize :: Num w => Mutator w
- zeroWeightOfMaximiseStudentClassSizeOverLocationCapacity :: Num w => Mutator w
- zeroWeightOfMinimiseBookingAtAnotherCoursesSpecifiedTime :: Num w => Mutator w
- zeroWeightOfMinimiseBookingOfLocationByOtherTeachers :: Num w => Mutator w
- zeroWeightOfMinimiseDeviationFromTimeslotRequest :: Num w => Mutator w
- zeroWeightOfMinimiseInterCampusMigrationsOfStudents :: Num w => Mutator w
- zeroWeightOfMinimiseInterCampusMigrationsOfTeachers :: Num w => Mutator w
- zeroWeightOfMinimiseTeachersLocusOperandi :: Num w => Mutator w
- zeroWeightOfMinimiseWasteOfScarceFacilities :: Num w => Mutator w
Types
Type-synonyms
Data-types
data LessonCriteriaWeights w Source #
- The weight of various criteria used to select a lesson from alternatives, at specific coordinates in the timetable.
- These criteria relate only to the attributes of the lesson rather than its coordinates in the timetable; since the latter is common to all alternatives.
MkLessonCriteriaWeights | |
|
Instances
Constants
associationList :: [(String, LessonCriteriaWeights w -> CriterionWeight w)] Source #
The ordered list of tags & accessors.
weightOfAreResourcesReusedTag :: String Source #
Used to qualify XML.
weightOfGreatestMinimumConsecutiveLessonsTag :: String Source #
Used to qualify XML.
weightOfGreatestRemainingCourseLessonsTag :: String Source #
Used to qualify XML.
weightOfGreatestSynchronisedCourseSetSizeTag :: String Source #
Used to qualify XML.
weightOfIsCoreKnowledgeRequirementTag :: String Source #
Used to qualify XML.
weightOfIsSpecialistInTopicTag :: String Source #
Used to qualify XML.
weightOfMatchCourseClassSizeToLocationCapacityTag :: String Source #
Used to qualify XML.
weightOfMaximiseRelativeFacilityUtilisationTag :: String Source #
Used to qualify XML.
weightOfMaximiseStudentClassSizeOverCourseClassSizeTag :: String Source #
Used to qualify XML.
weightOfMaximiseStudentClassSizeOverLocationCapacityTag :: String Source #
Used to qualify XML.
weightOfMinimiseBookingAtAnotherCoursesSpecifiedTimeTag :: String Source #
Used to qualify XML.
weightOfMinimiseBookingOfLocationByOtherTeachersTag :: String Source #
Used to qualify XML.
weightOfMinimiseDeviationFromTimeslotRequestTag :: String Source #
Used to qualify XML.
weightOfMinimiseInterCampusMigrationsOfStudentsTag :: String Source #
Used to qualify XML.
weightOfMinimiseInterCampusMigrationsOfTeachersTag :: String Source #
Used to qualify XML.
weightOfMinimiseStudentBodyCombinationsTag :: String Source #
Used to qualify XML.
weightOfMinimiseTeachersLocusOperandiTag :: String Source #
Used to qualify XML.
weightOfMinimiseWasteOfScarceFacilitiesTag :: String Source #
Used to qualify XML.
Functions
calculateWeightedMean Source #
:: (Fractional weightedMean, Real criterionValue, Real criterionWeight) | |
=> LessonCriteriaWeights criterionWeight | |
-> Criterion criterionValue | areResourcesReused: Maximum if the proposed lesson already exists at the same time in other student-body timetable, & therefore allows resource-reuse, by merging them into a student-class. |
-> Criterion criterionValue | minimumConsecutiveLessons: Maximum when the proposed lesson, belongs to a course which specifies the greatest possible minimum consecutive lessons. |
-> Criterion criterionValue | remainingCourseLessons: Maximum when the number of lessons required for the course matches the number of days the student & teacher are mutually available, falling to minimum when there are fewer remaining lessons. |
-> Criterion criterionValue | synchronisedCourseSetSize: Maximum if the course is a member of the largest possible set of synchronised courses. |
-> Criterion criterionValue | isCoreKnowledgeRequirement: Maximum if the subject is categorised as a core knowledge-requirement for the student, otherwise minimum. |
-> Criterion criterionValue | isSpecialistInTopic: Maximum if the teacher is a specialist in a given topic, otherwise minimum. |
-> Criterion criterionValue | matchOfCourseClassSizeToLocationCapacity: Maximum when the maximum class-size specified for the course matches the capacity of the location, falling to minimum as the deviation increases. |
-> Criterion criterionValue | relativeFacilityUtilisation: The number of facilities used (regardless of their nature), over the total number of facilities available at the location. |
-> Criterion criterionValue | studentClassSizeOverCourseClassSize: The number of students in the class, over the course's maximum class-size; this makes little sense if the class-size can grow. |
-> Criterion criterionValue | studentClassSizeOverLocationCapacity: The number of students in the class, over the location's capacity; this makes little sense if the class-size can grow. |
-> Criterion criterionValue | bookingAtAnotherCoursesSpecifiedTime: Maximum when if there's zero probability that courses for this student-body's other knowledge-requirements, will specify the proposed booking-time. |
-> Criterion criterionValue | bookingOfLocationByOtherTeachers: Maximum when the location has been booked by zero other teachers, tending to minimum as each additional teacher books a lesson in this location. |
-> Criterion criterionValue | deviationFromTimeslotRequest: Maximum when the proposed booking-time matches a timeslot-request for the course, falling to minimum as the deviation rises. |
-> Criterion criterionValue | interCampusMigrationsOfStudents: Maximum when the campus for the proposed booking matches that in which the student is located in adjacent time-slots. |
-> Criterion criterionValue | interCampusMigrationsOfTeachers: Maximum when the campus for the proposed booking matches that in which the teacher is located in adjacent time-slots. |
-> Criterion criterionValue | studentBodyCombinations: Maximum if there's no increase in the number of student-body-combinations for the proposed lesson, falling towards minimum with each additional student-body-combination. |
-> Criterion criterionValue | teachersLocusOperandi: Maximum if either the teacher has no previous bookings, or their locus operandi is unchanged, falling towards minimum with large relative increases to the locus operandi. |
-> Criterion criterionValue | wasteOfScarceFacilities: Maximum if the proposed lesson either doesn't waste any facilities, or failing that merely wastes those which are ubiquitous. |
-> Writer [Maybe criterionValue] weightedMean | The individual criteria values, & their weighted mean. |
- Returns the weighted sum of the specified criteria, divided by the sum of the weights.
- Each criterion increases in proportion to some desirable attribute of the proposed lesson.
- Each criterion should be in the same range of magnitudes, so that none dominates the total, thus making the total a clear measure of the value attributed to each.
- The magnitude of the value of each criterion should be independent of the dimensions of the problem, such that the balance isn't disturbed when it's changed; i.e. they should be dimensionless.
- Lessons lacking the concept being measured shouldn't be disadvantaged, but assigned a constant median magnitude.
Mutators
:: (Enum f, Fractional f, Real f, Show f, Random f, RandomGen randomGen) | |
=> randomGen | |
-> f | The magnitude of the random perturbation; resulting in an increase or a decrease, by a factor of up to |
-> Mutator f |
- Perturb each weight by an independent random value, of configurable magnitude.
- Under this transformation, criterion-weights of zero will remain unchanged.
zeroWeightOfGreatestMinimumConsecutiveLessons :: Num w => Mutator w Source #
zeroWeightOfGreatestSynchronisedCourseSetSize :: Num w => Mutator w Source #
zeroWeightOfIsCoreKnowledgeRequirement :: Num w => Mutator w Source #
zeroWeightOfIsSpecialistInTopic :: Num w => Mutator w Source #
zeroWeightOfMatchCourseClassSizeToLocationCapacity :: Num w => Mutator w Source #
zeroWeightOfMaximiseRelativeFacilityUtilisation :: Num w => Mutator w Source #
zeroWeightOfMaximiseStudentClassSizeOverCourseClassSize :: Num w => Mutator w Source #
zeroWeightOfMaximiseStudentClassSizeOverLocationCapacity :: Num w => Mutator w Source #
zeroWeightOfMinimiseBookingAtAnotherCoursesSpecifiedTime :: Num w => Mutator w Source #
zeroWeightOfMinimiseBookingOfLocationByOtherTeachers :: Num w => Mutator w Source #
zeroWeightOfMinimiseDeviationFromTimeslotRequest :: Num w => Mutator w Source #
zeroWeightOfMinimiseInterCampusMigrationsOfStudents :: Num w => Mutator w Source #
zeroWeightOfMinimiseInterCampusMigrationsOfTeachers :: Num w => Mutator w Source #
zeroWeightOfMinimiseTeachersLocusOperandi :: Num w => Mutator w Source #
zeroWeightOfMinimiseWasteOfScarceFacilities :: Num w => Mutator w Source #