public class OriginalStudentWeights extends Object implements StudentWeights
StudentWeights.Implementation| Constructor and Description |
|---|
OriginalStudentWeights(DataProperties config) |
| Modifier and Type | Method and Description |
|---|---|
double |
getBound(Request request)
Return lower bound for the given request
|
double |
getDistanceConflictWeight(DistanceConflict.Conflict c)
Return weight of a distance conflict
|
double |
getTimeOverlapConflictWeight(Enrollment enrollment,
TimeOverlapsCounter.Conflict timeOverlap)
Return weight of a time overlapping conflict
|
double |
getWeight(Enrollment enrollment)
Return base weight of the given enrollment
|
double |
getWeight(Enrollment enrollment,
Set<DistanceConflict.Conflict> distanceConflicts,
Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)
Return weight of the given enrollment
|
double |
getWeight(Request request) |
boolean |
isBetterThanBestSolution(Solution<Request,Enrollment> currentSolution)
Compares two solutions.
|
boolean |
isFreeTimeAllowOverlaps()
Return true if free time requests allow overlaps
|
static void |
main(String[] args)
Test case -- run to see the weights for a few courses
|
double |
normalizePenalty(double penalty)
Normalized enrollment penalty -- to be used in
Enrollment.toDouble() |
public OriginalStudentWeights(DataProperties config)
public double normalizePenalty(double penalty)
Enrollment.toDouble()public double getBound(Request request)
StudentWeightsgetBound in interface StudentWeightsrequest - given requestpublic double getWeight(Enrollment enrollment)
StudentWeightsgetWeight in interface StudentWeightsenrollment - given enrollmentpublic double getWeight(Enrollment enrollment, Set<DistanceConflict.Conflict> distanceConflicts, Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)
StudentWeightsgetWeight in interface StudentWeightsenrollment - given enrollmentdistanceConflicts - distance conflictstimeOverlappingConflicts - time overlapping conflictspublic double getDistanceConflictWeight(DistanceConflict.Conflict c)
StudentWeightsgetDistanceConflictWeight in interface StudentWeightspublic double getTimeOverlapConflictWeight(Enrollment enrollment, TimeOverlapsCounter.Conflict timeOverlap)
StudentWeightsgetTimeOverlapConflictWeight in interface StudentWeightspublic boolean isBetterThanBestSolution(Solution<Request,Enrollment> currentSolution)
SolutionComparatorSolution.saveBest() and
Solution.restoreBest()).isBetterThanBestSolution in interface SolutionComparator<Request,Enrollment>currentSolution - given solutionpublic boolean isFreeTimeAllowOverlaps()
StudentWeightsisFreeTimeAllowOverlaps in interface StudentWeights