public class Enrollment extends Value<Request,Enrollment>
Constructor and Description |
---|
Enrollment(Request request,
int priority,
boolean noReservationPenalty,
Course course,
Config config,
Set<? extends SctAssignment> assignments,
Reservation reservation)
Constructor
|
Enrollment(Request request,
int priority,
Config config,
Set<? extends SctAssignment> assignments,
Assignment<Request,Enrollment> assignment)
Constructor
|
Enrollment(Request request,
int priority,
Course course,
Config config,
Set<? extends SctAssignment> assignments,
Reservation reservation)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Set<DistanceConflict.Conflict> |
distanceConflicts(Assignment<Request,Enrollment> assignment)
Distance conflicts, in which this enrollment is involved.
|
boolean |
equals(Object o)
By default, comparison is made on unique ids
|
int |
getAdjustedPriority()
Return adjusted enrollment priority, including priority bump provided by reservations
(but ensuring that getting the course without a reservation is still better than getting an alternative)
|
String |
getApproval()
Approval of the enrollment (only used by the online student sectioning)
|
Set<SctAssignment> |
getAssignments()
List of assignments (selected sections)
|
Config |
getConfig()
Config of the course request
|
Course |
getCourse()
Course of the course request
|
float |
getCredit()
Credit of this enrollment (using either
Course.getCreditValue() or Subpart.getCreditValue() when course credit is not present) |
int |
getLimit()
Enrollment limit, i.e., the number of students that would be able to get into the offering using this enrollment (if all the sections are empty)
|
String |
getName()
Enrollment name
|
int |
getNrSlots()
Return total number of slots of all sections in the enrollment.
|
Offering |
getOffering()
Offering of the course request
|
double |
getPenalty()
Enrollment penalty -- sum of section penalties (see
Section.getPenalty() ) |
int |
getPriority()
Return enrollment priority
|
Request |
getRequest()
Request
|
Reservation |
getReservation()
Return reservation used for this enrollment
|
Set<Section> |
getSections()
List of sections (only for course request)
|
Student |
getStudent()
Student
|
Long |
getTimeStamp()
Time stamp of the enrollment
|
int |
getTruePriority()
Return enrollment priority, ignoring priority bump provided by reservations
|
void |
guessReservation(Assignment<Request,Enrollment> assignment,
boolean onlyAvailable)
Guess the reservation based on the enrollment
|
boolean |
isAllowOverlap()
True if this enrollment can overlap with other enrollments of the student.
|
boolean |
isCourseRequest()
True if the request is course request
|
boolean |
isOverlapping(Enrollment enrl)
True when this enrollment is overlapping with the given enrollment
|
boolean |
isRequired() |
boolean |
isSelected()
True if all the sections are selected
|
boolean |
isWaitlisted()
True if all the sections are wait-listed
|
double |
percentInitial()
Percent of sections that are initial
|
double |
percentSameTime()
Percent of sections that have same time as the initial assignment
|
double |
percentSelected()
Percent of sections that are selected
|
double |
percentSelectedSameConfig()
Percent of sections that have the same configuration
|
double |
percentSelectedSameSection()
Percent of sections that are selected
|
double |
percentWaitlisted()
Percent of sections that are wait-listed
|
void |
setApproval(String approval)
Approval of the enrollment (only used by the online student sectioning)
|
void |
setReservation(Reservation reservation)
Set reservation for this enrollment
|
void |
setTimeStamp(Long timeStamp)
Time stamp of the enrollment
|
Set<StudentQuality.Conflict> |
studentQualityConflicts(Assignment<Request,Enrollment> assignment) |
Set<TimeOverlapsCounter.Conflict> |
timeOverlappingConflicts(Assignment<Request,Enrollment> assignment)
Time overlapping conflicts, in which this enrollment is involved.
|
double |
toDouble(Assignment<Request,Enrollment> assignment)
Enrollment value
|
double |
toDouble(Assignment<Request,Enrollment> assignment,
boolean precise)
Enrollment value
|
String |
toString() |
String |
toString(Assignment<Request,Enrollment> a) |
compareTo, compareTo, conflicts, conflicts, getDescription, getExtra, getId, hashCode, isConsistent, setExtra, setVariable, toDouble, valueEquals, valueEquals, variable
public Enrollment(Request request, int priority, boolean noReservationPenalty, Course course, Config config, Set<? extends SctAssignment> assignments, Reservation reservation)
request
- course / free time requestpriority
- zero for the course, one for the first alternative, two for the second alternativenoReservationPenalty
- when true +1 is added to priority (prefer enrollments with reservations)course
- selected courseconfig
- selected configurationassignments
- valid list of sectionsreservation
- used reservationpublic Enrollment(Request request, int priority, Course course, Config config, Set<? extends SctAssignment> assignments, Reservation reservation)
request
- course / free time requestpriority
- zero for the course, one for the first alternative, two for the second alternativecourse
- selected courseconfig
- selected configurationassignments
- valid list of sectionsreservation
- used reservationpublic Enrollment(Request request, int priority, Config config, Set<? extends SctAssignment> assignments, Assignment<Request,Enrollment> assignment)
request
- course / free time requestpriority
- zero for the course, one for the first alternative, two for the second alternativeconfig
- selected configurationassignments
- valid list of sectionsassignment
- current assignment (to guess the reservation)public void guessReservation(Assignment<Request,Enrollment> assignment, boolean onlyAvailable)
assignment
- current assignmentonlyAvailable
- use only reservation that have some space left in thempublic Student getStudent()
public Request getRequest()
public boolean isCourseRequest()
public Offering getOffering()
public Config getConfig()
public Course getCourse()
public Set<SctAssignment> getAssignments()
public Set<Section> getSections()
public boolean isOverlapping(Enrollment enrl)
enrl
- other enrollmentpublic double percentWaitlisted()
public double percentSelected()
public double percentSelectedSameSection()
public double percentSelectedSameConfig()
public double percentInitial()
public double percentSameTime()
public boolean isWaitlisted()
public boolean isSelected()
public boolean isRequired()
public double getPenalty()
Section.getPenalty()
)public double toDouble(Assignment<Request,Enrollment> assignment)
toDouble
in class Value<Request,Enrollment>
assignment
- current assignmentpublic double toDouble(Assignment<Request,Enrollment> assignment, boolean precise)
assignment
- current assignmentprecise
- if false, distance conflicts and time overlaps are ignored (i.e., much faster, but less precise computation)public String getName()
getName
in class Value<Request,Enrollment>
public String toString(Assignment<Request,Enrollment> a)
public boolean equals(Object o)
Value
equals
in class Value<Request,Enrollment>
public Set<DistanceConflict.Conflict> distanceConflicts(Assignment<Request,Enrollment> assignment)
assignment
- current assignmentpublic Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts(Assignment<Request,Enrollment> assignment)
assignment
- current assignmentpublic Set<StudentQuality.Conflict> studentQualityConflicts(Assignment<Request,Enrollment> assignment)
public int getPriority()
public int getTruePriority()
public int getAdjustedPriority()
public int getNrSlots()
public Reservation getReservation()
public void setReservation(Reservation reservation)
reservation
- used reservationpublic Long getTimeStamp()
public void setTimeStamp(Long timeStamp)
timeStamp
- enrollment time stamppublic String getApproval()
public void setApproval(String approval)
approval
- consent approvalpublic boolean isAllowOverlap()
public int getLimit()
public float getCredit()
Course.getCreditValue()
or Subpart.getCreditValue()
when course credit is not present)