public class Config.ConfigContext extends Object implements AssignmentConstraintContext<Request,Enrollment>
Constructor and Description |
---|
ConfigContext(Assignment<Request,Enrollment> assignment) |
ConfigContext(Config.ConfigContext parent) |
Modifier and Type | Method and Description |
---|---|
void |
assigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Called when an enrollment with this config 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 config, excluding the given one.
|
double |
getMaxEnrollmentWeight()
Maximal weight of a single enrollment in the config
|
double |
getMinEnrollmentWeight()
Minimal weight of a single enrollment in the config
|
void |
unassigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Called when an enrollment with this config is unassigned from a request
|
public ConfigContext(Assignment<Request,Enrollment> assignment)
public ConfigContext(Config.ConfigContext 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 double getEnrollmentWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)
Request.getWeight()
.assignment
- current assignmentexcludeRequest
- request to excludepublic double getEnrollmentTotalWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)
Reservation.canBatchAssignOverLimit()
set to true.assignment
- current assignmentexcludeRequest
- request to excludepublic Set<Enrollment> getEnrollments()
public double getMaxEnrollmentWeight()
public double getMinEnrollmentWeight()