public class Config extends Object
Offering
) contains one or more
configurations. Each configuration contain one or more subparts. Each student
has to take a class of each subpart of one of the possible configurations.
Constructor and Description |
---|
Config(long id,
int limit,
String name,
Offering offering)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
assigned(Enrollment enrollment)
Called when an enrollment with this config is assigned to a request
|
void |
clearReservationCache()
Clear reservation information that was cached on this configuration or below
|
boolean |
equals(Object o) |
List<Reservation> |
getConfigReservations()
Get reservations that require this configuration
|
Set<Enrollment> |
getEnrollments()
Set of assigned enrollments
|
double |
getEnrollmentWeight(Request excludeRequest)
Enrollment weight -- weight of all requests which have an enrollment that
contains this config, excluding the given one.
|
long |
getId()
Configuration id
|
int |
getLimit()
Configuration limit.
|
double |
getMaxEnrollmentWeight()
Maximal weight of a single enrollment in the config
|
double |
getMaxPenalty()
Average maximal penalty from
Subpart.getMaxPenalty() |
double |
getMinEnrollmentWeight()
Minimal weight of a single enrollment in the config
|
double |
getMinPenalty()
Average minimal penalty from
Subpart.getMinPenalty() |
String |
getName()
Configuration name
|
Offering |
getOffering()
Instructional offering to which this configuration belongs.
|
List<Reservation> |
getReservations()
Get reservations for this configuration
|
List<Subpart> |
getSubparts()
List of subparts
|
double |
getTotalUnreservedSpace()
Total space in the configuration that cannot be reserved by any config reservation
|
double |
getUnreservedSpace(Request excludeRequest)
Available space in the configuration that is not reserved by any config reservation
|
int |
hashCode() |
void |
setLimit(int limit)
Set configuration limit
|
String |
toString() |
void |
unassigned(Enrollment enrollment)
Called when an enrollment with this config is unassigned from a request
|
public long getId()
public int getLimit()
public void setLimit(int limit)
public Offering getOffering()
public List<Subpart> getSubparts()
public double getMinPenalty()
Subpart.getMinPenalty()
public double getMaxPenalty()
Subpart.getMaxPenalty()
public void assigned(Enrollment enrollment)
public void unassigned(Enrollment enrollment)
public double getEnrollmentWeight(Request excludeRequest)
Request.getWeight()
.public Set<Enrollment> getEnrollments()
public double getMaxEnrollmentWeight()
public double getMinEnrollmentWeight()
public double getUnreservedSpace(Request excludeRequest)
excludeRequest
- excluding given request (if not null)public double getTotalUnreservedSpace()
public List<Reservation> getReservations()
public List<Reservation> getConfigReservations()
public void clearReservationCache()