|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Variable net.sf.cpsolver.studentsct.model.Request net.sf.cpsolver.studentsct.model.CourseRequest
public class CourseRequest
Representation of a request of a student for one or more course. A student requests one of the given courses,
preferably the first one.
Field Summary | |
---|---|
static double |
sAltValue
Enrollment value: value * sAltValue ^ index, where index is zero for the first course, one for the second course etc. |
static boolean |
sSameTimePrecise
|
Fields inherited from class net.sf.cpsolver.studentsct.model.Request |
---|
sCacheValues |
Fields inherited from class net.sf.cpsolver.ifs.model.Variable |
---|
iValue |
Constructor Summary | |
---|---|
CourseRequest(long id,
int priority,
boolean alternative,
Student student,
Vector courses,
boolean waitlist)
Constructor |
Method Summary | |
---|---|
void |
clearCache()
Clear cached min/max penalties and cached bound |
Vector |
computeEnrollments()
Return all possible enrollments. |
Vector |
computeRandomEnrollments(int limitEachConfig)
Return a subset of all enrollments -- randomly select only up to limitEachConfig enrollments of each config. |
Enrollment |
createEnrollment(Set sections)
Create enrollment for the given list of sections. |
Vector |
getAvaiableEnrollments()
Return all enrollments that are available |
TreeSet |
getAvaiableEnrollmentsSkipSameTime()
Return all enrollments that are available, pick only the first section of the sections with the same time (of each subpart, Section comparator is used) |
double |
getBound()
Estimated bound for this request -- it estimates the smallest value among all possible enrollments |
Config |
getConfig(long configId)
Return configuration of the requested courses with the given id |
Course |
getCourse(long courseId)
Return course of the requested courses with the given id |
Vector |
getCourses()
List of requested courses (in the correct order -- first is the requested course, second is the first alternative, etc.) |
Vector |
getEnrollmentsSkipSameTime()
Return all possible enrollments. |
double |
getMaxPenalty()
Maximal penalty (maximum of Offering.getMaxPenalty() among requested courses) |
double |
getMinPenalty()
Minimal penalty (minimum of Offering.getMinPenalty() among requested courses) |
String |
getName()
Request name: A for alternative, 1 + priority, (w) when waitlist, list of course names |
Section |
getSection(long sectionId)
Return section of the requested courses with the given id |
Set |
getSelectedChoices()
Selected choices |
Vector |
getSelectedEnrollments(boolean availableOnly)
Return all enrollments that are selected ( isSelected(Section) is true) |
Subpart |
getSubpart(long subpartId)
Return subpart of the requested courses with the given id |
Set |
getWaitlistedChoices()
Wait-listed choices |
boolean |
isSelected(Section section)
Return true when the given section is selected (i.e., its choice is among selected choices) |
boolean |
isWaitlist()
True if the student can be put on a wait-list (no alternative course request will be given instead) |
boolean |
isWaitlisted(Section section)
Return true when the given section is wait-listed (i.e., its choice is among wait-listed choices) |
String |
toString()
|
Methods inherited from class net.sf.cpsolver.studentsct.model.Request |
---|
assign, compareTo, getId, getPriority, getStudent, getWeight, isAlternative, setPriority, setWeight, unassign, values |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static double sAltValue
public static boolean sSameTimePrecise
Constructor Detail |
---|
public CourseRequest(long id, int priority, boolean alternative, Student student, Vector courses, boolean waitlist)
id
- request unique idpriority
- request priorityalternative
- true if the request is alternative (alternative request can be assigned instead of a non-alternative course requests, if it is left unassigned)student
- appropriate studentcourses
- list of requested courses (in the correct order -- first is the requested course, second is the first alternative, etc.)waitlist
- true if the student can be put on a waitlist (no alternative course request will be given instead)Method Detail |
---|
public Vector getCourses()
public Enrollment createEnrollment(Set sections)
public Vector computeEnrollments()
computeEnrollments
in class Request
public Vector computeRandomEnrollments(int limitEachConfig)
public Vector getAvaiableEnrollments()
public Vector getSelectedEnrollments(boolean availableOnly)
isSelected(Section)
is true)
availableOnly
- pick only available sectionspublic TreeSet getAvaiableEnrollmentsSkipSameTime()
Section
comparator is used)
public Vector getEnrollmentsSkipSameTime()
public Set getWaitlistedChoices()
public boolean isWaitlisted(Section section)
public Set getSelectedChoices()
public boolean isSelected(Section section)
public String getName()
getName
in class Variable
public boolean isWaitlist()
public String toString()
toString
in class Variable
public Course getCourse(long courseId)
public Config getConfig(long configId)
public Subpart getSubpart(long subpartId)
public Section getSection(long sectionId)
public double getMinPenalty()
Offering.getMinPenalty()
among requested courses)
public double getMaxPenalty()
Offering.getMaxPenalty()
among requested courses)
public void clearCache()
public double getBound()
getBound
in class Request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |