public class StudentPreferencePenalties extends Object
sStudentRequestDistribution
.
for (Enumeration e=students.elements();e.hasMoreElements();) {
// take a student (one by one)
Student student = (Student)e.nextElement();
// compute and apply penalties using this class
new StudentPreferencePenalties().setPenalties(student);
// section a student
// for instance, BranchBoundSelection
can be used (with Neighbour.BranchAndBoundMinimizePenalty set to true)
Neighbour neighbour = new BranchBoundSelection(config).getSelection(student).select();
if (neighbour!=null) neighbour.assign(iteration++);
};
Modifier and Type | Field and Description |
---|---|
static int |
sDistTypePreference |
static int |
sDistTypePreferenceQuadratic |
static int |
sDistTypePreferenceReverse |
static int |
sDistTypeUniform |
static int[][] |
sStudentRequestDistribution |
Constructor and Description |
---|
StudentPreferencePenalties(int disributionType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static int |
day(int slot)
Return day index in
sStudentRequestDistribution for the
given slot. |
double |
getMaxPenalty(Config config)
Maximal penalty of a config
|
double |
getMaxPenalty(CourseRequest request)
Maximal penalty of a course request
|
double |
getMaxPenalty(Offering offering)
Maximal penalty of an offering
|
double |
getMaxPenalty(Request request)
Maximal penalty of a course request
|
double |
getMaxPenalty(Subpart subpart)
Maximal penalty of a subpart
|
double[] |
getMinMaxAvailableEnrollmentPenalty(CourseRequest request)
Minimal and maximal available enrollment penalty of a request
|
double[] |
getMinMaxAvailableEnrollmentPenalty(Request request)
Minimal and maximal available enrollment penalty of a request
|
double[] |
getMinMaxEnrollmentPenalty(CourseRequest request)
Minimal and maximal available enrollment penalty of a request
|
double[] |
getMinMaxEnrollmentPenalty(Request request)
Minimal and maximal available enrollment penalty of a request
|
double |
getMinPenalty(Config config)
Minimal penalty of a config
|
double |
getMinPenalty(CourseRequest request)
Minimal penalty of a course request
|
double |
getMinPenalty(Offering offering)
Minimal penalty of an offering
|
double |
getMinPenalty(Request request)
Minimal penalty of a course request
|
double |
getMinPenalty(Subpart subpart)
Minimal penalty of a subpart
|
double |
getPenalty(Assignment assignment)
Return penalty of an assignment.
|
double |
getPenalty(Enrollment enrollment)
Return penalty of an enrollment.
|
double |
getPenalty(TimeLocation time)
Return penalty of the given time.
|
static void |
setPenalties(Student student,
int distributionType)
Set the computed penalties to all sections of all requests of the given
student
|
static int |
time(int slot)
Return time index in
sStudentRequestDistribution for the
given slot. |
String |
toString(int day,
int time)
Return time of the given day and time index of
sStudentRequestDistribution . |
public static int sDistTypeUniform
public static int sDistTypePreference
public static int sDistTypePreferenceQuadratic
public static int sDistTypePreferenceReverse
public static int[][] sStudentRequestDistribution
public StudentPreferencePenalties(int disributionType)
sStudentRequestDistribution
. The first time gets zero penalty, the second 1/nrTimes, the third
2/nrTimes etc. where nrTimes is the number of times in
sStudentRequestDistribution
.public static int day(int slot)
sStudentRequestDistribution
for the
given slot.public static int time(int slot)
sStudentRequestDistribution
for the
given slot.public String toString(int day, int time)
sStudentRequestDistribution
.public double getPenalty(TimeLocation time)
public double getPenalty(Assignment assignment)
Assignment.getTime()
) or zero if the time is null.public double getPenalty(Enrollment enrollment)
Enrollment.getAssignments()
.public double getMinPenalty(Request request)
public double getMinPenalty(CourseRequest request)
public double getMinPenalty(Offering offering)
public double getMinPenalty(Config config)
public double getMinPenalty(Subpart subpart)
public double getMaxPenalty(Request request)
public double getMaxPenalty(CourseRequest request)
public double getMaxPenalty(Offering offering)
public double getMaxPenalty(Config config)
public double getMaxPenalty(Subpart subpart)
public double[] getMinMaxAvailableEnrollmentPenalty(Request request)
public double[] getMinMaxAvailableEnrollmentPenalty(CourseRequest request)
public double[] getMinMaxEnrollmentPenalty(Request request)
public double[] getMinMaxEnrollmentPenalty(CourseRequest request)
public static void setPenalties(Student student, int distributionType)