public class PriorityStudentWeights extends Object implements StudentWeights
StudentWeights.Implementation
Modifier and Type | Field and Description |
---|---|
protected boolean |
iAdditiveWeights |
protected double |
iAlternativeRequestFactor |
protected double |
iBalancingFactor |
protected double |
iCriticalBoost |
protected double |
iDistanceConflict |
protected double |
iFirstAlternativeFactor |
protected double |
iGroupBestRatio |
protected double |
iGroupFactor |
protected double |
iGroupFillRatio |
protected boolean |
iImprovedBound |
protected boolean |
iLeftoverSpread |
protected boolean |
iMaximizeAssignment |
protected boolean |
iMPP |
protected double |
iNoTimeFactor |
protected double |
iOnlineFactor |
protected double |
iPastFactor |
protected double |
iPerturbationFactor |
protected boolean |
iPreciseComparison |
protected double |
iPriorityFactor |
protected double |
iPriortyBoost |
protected double |
iProjectedStudentWeight |
protected double[] |
iQalityWeights |
protected double |
iReservationNotFollowedFactor |
protected double |
iSameChoiceWeight |
protected double |
iSameConfigWeight |
protected double |
iSameTimeWeight |
protected double |
iSecondAlternativeFactor |
protected double |
iSelectionFactor |
protected double |
iShortDistanceConflict |
protected double |
iTimeOverlapFactor |
protected double |
iTimeOverlapMaxLimit |
Constructor and Description |
---|
PriorityStudentWeights(DataProperties config) |
Modifier and Type | Method and Description |
---|---|
protected double |
computeBound(double base,
Request request) |
protected double |
getBaseWeight(Assignment<Request,Enrollment> assignment,
Enrollment enrollment) |
double |
getBoostedWeight(Request request) |
double |
getBound(Request request)
Return lower bound for the given request
|
double |
getCachedWeight(Request request) |
protected double |
getDifference(Enrollment enrollment)
Return how much the given enrollment is different from the initial enrollment
|
double |
getDistanceConflictWeight(Assignment<Request,Enrollment> assignment,
DistanceConflict.Conflict c)
Return weight of a distance conflict
|
double |
getSelection(Enrollment enrollment)
Return how much the given enrollment is different from the selection (if any)
|
double |
getStudentQualityConflictWeight(Assignment<Request,Enrollment> assignment,
Enrollment enrollment,
StudentQuality.Conflict conflict)
Return weight of a student quality conflict
|
double |
getTimeOverlapConflictWeight(Assignment<Request,Enrollment> assignment,
Enrollment e,
TimeOverlapsCounter.Conflict c)
Return weight of a time overlapping conflict
|
double |
getWeight(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Return base weight of the given enrollment
|
double |
getWeight(Assignment<Request,Enrollment> assignment,
Enrollment enrollment,
Set<DistanceConflict.Conflict> distanceConflicts,
Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)
Return weight of the given enrollment
|
double |
getWeight(Assignment<Request,Enrollment> assignment,
Enrollment enrollment,
Set<StudentQuality.Conflict> qualityConflicts)
Return weight of the given enrollment
|
double |
getWeight(Request request) |
double |
getWeightAdditive(Assignment<Request,Enrollment> assignment,
Enrollment enrollment) |
double |
getWeightMultiplicative(Assignment<Request,Enrollment> assignment,
Enrollment enrollment) |
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 iShortDistanceConflict
protected double iTimeOverlapFactor
protected double iTimeOverlapMaxLimit
protected boolean iLeftoverSpread
protected double iBalancingFactor
protected double iNoTimeFactor
protected double iOnlineFactor
protected double iPastFactor
protected double iReservationNotFollowedFactor
protected double iAlternativeRequestFactor
protected double iProjectedStudentWeight
protected boolean iMPP
protected double iPerturbationFactor
protected double iSelectionFactor
protected double iSameChoiceWeight
protected double iSameTimeWeight
protected double iSameConfigWeight
protected double iGroupFactor
protected double iGroupBestRatio
protected double iGroupFillRatio
protected boolean iAdditiveWeights
protected boolean iMaximizeAssignment
protected boolean iPreciseComparison
protected double[] iQalityWeights
protected boolean iImprovedBound
protected double iCriticalBoost
protected double iPriortyBoost
public PriorityStudentWeights(DataProperties config)
public double getBoostedWeight(Request request)
public double getCachedWeight(Request request)
protected double getDifference(Enrollment enrollment)
enrollment
- given enrollmentpublic double getSelection(Enrollment enrollment)
enrollment
- given enrollmentpublic double getBound(Request request)
StudentWeights
getBound
in interface StudentWeights
request
- given requestprotected double computeBound(double base, Request request)
protected double round(double value)
protected double getBaseWeight(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
public double getWeight(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
StudentWeights
getWeight
in interface StudentWeights
assignment
- current assignmentenrollment
- given enrollmentpublic double getWeightMultiplicative(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
public double getWeightAdditive(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
public double getDistanceConflictWeight(Assignment<Request,Enrollment> assignment, DistanceConflict.Conflict c)
StudentWeights
getDistanceConflictWeight
in interface StudentWeights
assignment
- current assignmentc
- distance conflictpublic double getTimeOverlapConflictWeight(Assignment<Request,Enrollment> assignment, Enrollment e, TimeOverlapsCounter.Conflict c)
StudentWeights
getTimeOverlapConflictWeight
in interface StudentWeights
assignment
- current assignmente
- enrollment in questionc
- time overlapping conflictpublic double getWeight(Assignment<Request,Enrollment> assignment, Enrollment enrollment, Set<DistanceConflict.Conflict> distanceConflicts, Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)
StudentWeights
getWeight
in interface StudentWeights
assignment
- current assignmentenrollment
- 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
public static void main(String[] args)
args
- program argumentspublic double getWeight(Assignment<Request,Enrollment> assignment, Enrollment enrollment, Set<StudentQuality.Conflict> qualityConflicts)
StudentWeights
getWeight
in interface StudentWeights
assignment
- current assignmentenrollment
- given enrollmentqualityConflicts
- student quality conflictspublic double getStudentQualityConflictWeight(Assignment<Request,Enrollment> assignment, Enrollment enrollment, StudentQuality.Conflict conflict)
StudentWeights
getStudentQualityConflictWeight
in interface StudentWeights
assignment
- current assignmentenrollment
- enrollment in questionconflict
- student quality conflict