public class ReservationLimit extends GlobalConstraint<Request,Enrollment>
Request.getWeight()
) enrolled into a reservation is below
the reservation's limit (see Reservation.getLimit()
). It also ensures that
the desired space is reserved in the enrollment's offering and configuration.
Parameter | Type | Comment |
---|---|---|
ReservationLimit.PreferDummyStudents | Boolean |
If true, requests of dummy (last-like) students are preferred to be selected as conflicting. |
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
ReservationLimit(DataProperties cfg)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
computeConflicts(Enrollment enrollment,
Set<Enrollment> conflicts)
A given enrollment is conflicting, if the reservation's remaning available space
(computed by
Reservation.getReservedAvailableSpace(Request) )
is below the requests weight Request.getWeight() . |
static double |
getUnreservedSpace(Config config,
Request request)
Remaining unreserved space in a config if the given request is assigned.
|
boolean |
inConflict(Enrollment enrollment)
A given enrollment is conflicting, if the config's enrollment (computed by
ConfigLimit.getEnrollmentWeight(Config, Request) ) exceeds the
limit. |
String |
toString() |
addVariable, assigned, assignedVariables, removeVariable, unassigned, variables
addConstraintListener, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, hashCode, isConsistent, isHard, removeConstraintListener, setModel
public ReservationLimit(DataProperties cfg)
cfg
- solver configurationpublic static double getUnreservedSpace(Config config, Request request)
config
- a config that is of concernrequest
- a request of a student to be assigned containing the given
sectionpublic void computeConflicts(Enrollment enrollment, Set<Enrollment> conflicts)
Reservation.getReservedAvailableSpace(Request)
)
is below the requests weight Request.getWeight()
. computeConflicts
in class Constraint<Request,Enrollment>
enrollment
- Enrollment
that is being consideredconflicts
- all computed conflicting requests are added into this setpublic boolean inConflict(Enrollment enrollment)
ConfigLimit.getEnrollmentWeight(Config, Request)
) exceeds the
limit.inConflict
in class Constraint<Request,Enrollment>
enrollment
- Enrollment
that is being considered