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)
StudentWeights
getBound
in interface StudentWeights
request
- given requestpublic double getWeight(Enrollment enrollment)
StudentWeights
getWeight
in interface StudentWeights
enrollment
- given enrollmentpublic double getWeight(Enrollment enrollment, Set<DistanceConflict.Conflict> distanceConflicts, Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)
StudentWeights
getWeight
in interface StudentWeights
enrollment
- given enrollmentdistanceConflicts
- distance conflictstimeOverlappingConflicts
- time overlapping conflictspublic double getDistanceConflictWeight(DistanceConflict.Conflict c)
StudentWeights
getDistanceConflictWeight
in interface StudentWeights
public double getTimeOverlapConflictWeight(Enrollment enrollment, TimeOverlapsCounter.Conflict timeOverlap)
StudentWeights
getTimeOverlapConflictWeight
in interface StudentWeights
public boolean isBetterThanBestSolution(Solution<Request,Enrollment> currentSolution)
SolutionComparator
Solution.saveBest()
and
Solution.restoreBest()
).isBetterThanBestSolution
in interface SolutionComparator<Request,Enrollment>
currentSolution
- given solutionpublic boolean isFreeTimeAllowOverlaps()
StudentWeights
isFreeTimeAllowOverlaps
in interface StudentWeights