public class PriorityStudentWeights extends Object implements StudentWeights
StudentWeights.Implementation
Modifier and Type | Field and Description |
---|---|
protected double |
iAlternativeRequestFactor |
protected double |
iBalancingFactor |
protected double |
iDistanceConflict |
protected double |
iFirstAlternativeFactor |
protected boolean |
iLeftoverSpread |
protected double |
iPriorityFactor |
protected double |
iProjectedStudentWeight |
protected double |
iSecondAlternativeFactor |
protected double |
iTimeOverlapFactor |
protected double |
iTimeOverlapMaxLimit |
Constructor and Description |
---|
PriorityStudentWeights(DataProperties config) |
Modifier and Type | Method and Description |
---|---|
double |
getBound(Request request)
Return lower bound for the given request
|
double |
getCachedWeight(Request request) |
double |
getDistanceConflictWeight(DistanceConflict.Conflict c)
Return weight of a distance conflict
|
double |
getTimeOverlapConflictWeight(Enrollment e,
TimeOverlapsCounter.Conflict c)
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
|
protected double |
round(double value) |
protected double iPriorityFactor
protected double iFirstAlternativeFactor
protected double iSecondAlternativeFactor
protected double iDistanceConflict
protected double iTimeOverlapFactor
protected double iTimeOverlapMaxLimit
protected boolean iLeftoverSpread
protected double iBalancingFactor
protected double iAlternativeRequestFactor
protected double iProjectedStudentWeight
public PriorityStudentWeights(DataProperties config)
public double getCachedWeight(Request request)
public double getBound(Request request)
StudentWeights
getBound
in interface StudentWeights
request
- given requestprotected double round(double value)
public double getWeight(Enrollment enrollment)
StudentWeights
getWeight
in interface StudentWeights
enrollment
- given enrollmentpublic double getDistanceConflictWeight(DistanceConflict.Conflict c)
StudentWeights
getDistanceConflictWeight
in interface StudentWeights
public double getTimeOverlapConflictWeight(Enrollment e, TimeOverlapsCounter.Conflict c)
StudentWeights
getTimeOverlapConflictWeight
in interface StudentWeights
public 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 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