public class Section.SectionContext extends Object implements AssignmentConstraintContext<Request,Enrollment>
Constructor and Description |
---|
SectionContext(Assignment<Request,Enrollment> assignment) |
SectionContext(Section.SectionContext parent) |
Modifier and Type | Method and Description |
---|---|
void |
assigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Called when an enrollment with this section is assigned to a request
|
Set<Enrollment> |
getEnrollments()
Set of assigned enrollments
|
double |
getEnrollmentTotalWeight(Assignment<Request,Enrollment> assignment,
Request excludeRequest)
Enrollment weight including over the limit enrollments.
|
double |
getEnrollmentWeight(Assignment<Request,Enrollment> assignment,
Request excludeRequest)
Enrollment weight -- weight of all requests which have an enrollment that
contains this section, excluding the given one.
|
double |
getMaxEnrollmentWeight()
Maximal weight of a single enrollment in the section
|
double |
getMinEnrollmentWeight()
Minimal weight of a single enrollment in the section
|
void |
unassigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Called when an enrollment with this section is unassigned from a request
|
public SectionContext(Assignment<Request,Enrollment> assignment)
public SectionContext(Section.SectionContext 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 getEnrollmentTotalWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)
Reservation.canBatchAssignOverLimit()
set to true.assignment
- current assignmentexcludeRequest
- course request to ignore, if anypublic double getMaxEnrollmentWeight()
public double getMinEnrollmentWeight()