public class Config extends AbstractClassWithContext<Request,Enrollment,Config.ConfigContext> implements CanInheritContext<Request,Enrollment,Config.ConfigContext>
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.
Modifier and Type | Class and Description |
---|---|
class |
Config.ConfigContext |
sMaxSize
Constructor and Description |
---|
Config(long id,
int limit,
String name,
Offering offering)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clearReservationCache()
Clear reservation information that was cached on this configuration or below
|
Config.ConfigContext |
createAssignmentContext(Assignment<Request,Enrollment> assignment)
Create a new assignment context for the given assignment.
|
boolean |
equals(Object o) |
List<Reservation> |
getConfigReservations()
Get reservations that require this configuration
|
Float |
getCreditValue()
Sum of subpart credit of this config
return config credit value
|
Set<Enrollment> |
getEnrollments(Assignment<Request,Enrollment> assignment)
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.
|
long |
getId()
Configuration id
|
Long |
getInstructionalMethodId()
Return instructional method id
|
String |
getInstructionalMethodName()
Return instructional method name
|
String |
getInstructionalMethodReference()
Return instructional method reference
|
int |
getLimit()
Configuration limit.
|
double |
getMaxEnrollmentWeight(Assignment<Request,Enrollment> assignment)
Maximal weight of a single enrollment in the config
|
double |
getMaxPenalty()
Average maximal penalty from
Subpart.getMaxPenalty() |
double |
getMinEnrollmentWeight(Assignment<Request,Enrollment> assignment)
Minimal weight of a single enrollment in the config
|
double |
getMinPenalty()
Average minimal penalty from
Subpart.getMinPenalty() |
Model<Request,Enrollment> |
getModel()
Get the model.
|
String |
getName()
Configuration name
|
int |
getNrArrHours() |
int |
getNrOnline() |
int |
getNrPast() |
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(Assignment<Request,Enrollment> assignment,
Request excludeRequest)
Available space in the configuration that is not reserved by any config reservation
|
boolean |
hasCreditValue()
True if at least one subpart of this config has a credit value set
|
int |
hashCode() |
Config.ConfigContext |
inheritAssignmentContext(Assignment<Request,Enrollment> assignment,
Config.ConfigContext parentContext)
Create a new assignment context for the given assignment.
|
void |
setInstructionalMethodId(Long instrMethodId)
Set instructional method id
|
void |
setInstructionalMethodName(String instrMethodName)
Set instructional method name
|
void |
setInstructionalMethodReference(String instrMethodReference)
Set instructional method reference
|
void |
setLimit(int limit)
Set configuration limit
|
String |
toString() |
getAssignmentContextReference, getContext, getContext, setAssignmentContextReference
public long getId()
public int getLimit()
public void setLimit(int limit)
limit
- configuration limit, -1 if unlimitedpublic Offering getOffering()
public List<Subpart> getSubparts()
public Long getInstructionalMethodId()
public void setInstructionalMethodId(Long instrMethodId)
instrMethodId
- instructional method idpublic String getInstructionalMethodName()
public void setInstructionalMethodName(String instrMethodName)
instrMethodName
- instructional method namepublic String getInstructionalMethodReference()
public void setInstructionalMethodReference(String instrMethodReference)
instrMethodReference
- instructional method referencepublic double getMinPenalty()
Subpart.getMinPenalty()
public double getMaxPenalty()
Subpart.getMaxPenalty()
public double getUnreservedSpace(Assignment<Request,Enrollment> assignment, Request excludeRequest)
assignment
- current assignmentexcludeRequest
- excluding given request (if not null)public double getTotalUnreservedSpace()
public List<Reservation> getReservations()
public List<Reservation> getConfigReservations()
public void clearReservationCache()
public Model<Request,Enrollment> getModel()
AbstractClassWithContext
getModel
in class AbstractClassWithContext<Request,Enrollment,Config.ConfigContext>
public Set<Enrollment> getEnrollments(Assignment<Request,Enrollment> assignment)
assignment
- current assignmentpublic double getEnrollmentWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)
Request.getWeight()
.assignment
- current assignmentexcludeRequest
- request to exclude, null if all requests are to be includedpublic double getEnrollmentTotalWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)
Reservation.canBatchAssignOverLimit()
set to true.
Request.getWeight()
.assignment
- current assignmentexcludeRequest
- request to exclude, null if all requests are to be includedpublic double getMaxEnrollmentWeight(Assignment<Request,Enrollment> assignment)
assignment
- current assignmentpublic double getMinEnrollmentWeight(Assignment<Request,Enrollment> assignment)
assignment
- current assignmentpublic Config.ConfigContext createAssignmentContext(Assignment<Request,Enrollment> assignment)
HasAssignmentContext
createAssignmentContext
in interface HasAssignmentContext<Request,Enrollment,Config.ConfigContext>
assignment
- an assignment for which there needs to be an assignment contextpublic Config.ConfigContext inheritAssignmentContext(Assignment<Request,Enrollment> assignment, Config.ConfigContext parentContext)
CanInheritContext
inheritAssignmentContext
in interface CanInheritContext<Request,Enrollment,Config.ConfigContext>
assignment
- an assignment for which there needs to be an assignment contextparentContext
- context of the parent assignmentpublic boolean hasCreditValue()
public Float getCreditValue()
public int getNrOnline()
public int getNrArrHours()
public int getNrPast()