public class RequestGroup.RequestGroupContext extends Object implements AssignmentConstraintContext<Request,Enrollment>
Constructor and Description |
---|
RequestGroupContext(Assignment<Request,Enrollment> assignment) |
RequestGroupContext(RequestGroup.RequestGroupContext parent) |
Modifier and Type | Method and Description |
---|---|
void |
assigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Called when an enrollment is assigned to a request of this request group
|
double |
getAverageSpread()
Return average section spread of this group.
|
Set<Enrollment> |
getEnrollments()
Set of assigned enrollments
|
double |
getEnrollmentSpread(Assignment<Request,Enrollment> assignment,
Enrollment enrollment,
double bestRatio,
double fillRatio)
Return how much is the given enrollment (which is not part of the request group) creating an issue for this request group
|
double |
getEnrollmentWeight(Assignment<Request,Enrollment> assignment,
Request excludeRequest)
Enrollment weight -- weight of all requests which have an enrollment that
is of this request group, excluding the given one.
|
double |
getSectionSpread(Section section)
Return section spread of this group.
|
double |
getSectionWeight(Assignment<Request,Enrollment> assignment,
Section section,
Request excludeRequest)
Section weight -- weight of all requests which have an enrollment that
is of this request group and that includes the given section, excluding the given one.
|
void |
unassigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Called when an enrollment is unassigned from a request of this request group
|
public RequestGroupContext(Assignment<Request,Enrollment> assignment)
public RequestGroupContext(RequestGroup.RequestGroupContext parent)
public void assigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
assigned
in interface AssignmentConstraintContext<Request,Enrollment>
assignment
- current assignment (with which this context is associated)enrollment
- assigned valuepublic void unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
unassigned
in interface AssignmentConstraintContext<Request,Enrollment>
assignment
- current assignment (with which this context is associated)enrollment
- unassigned valuepublic Set<Enrollment> getEnrollments()
public double getEnrollmentWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)
Request.getWeight()
.assignment
- current assignmentexcludeRequest
- course request to ignore, if anypublic double getSectionWeight(Assignment<Request,Enrollment> assignment, Section section, Request excludeRequest)
Request.getWeight()
.assignment
- current assignmentsection
- section in questionexcludeRequest
- course request to ignore, if anypublic double getEnrollmentSpread(Assignment<Request,Enrollment> assignment, Enrollment enrollment, double bestRatio, double fillRatio)
assignment
- current assignmentenrollment
- enrollment in questionbestRatio
- how much of the weight should be used on estimation of the enrollment potential
(considering that students of this group that are not yet enrolled can take the same enrollment)fillRatio
- how much of the weight should be used in estimation how well are the sections of this enrollments going to be filled
(bestRatio + fillRatio <= 1.0)public double getAverageSpread()
public double getSectionSpread(Section section)
section
- given section