public class FreeTimeRequest extends Request implements SctAssignment
SctAssignment
API, with the appropriate free time. Modifier and Type | Class and Description |
---|---|
class |
FreeTimeRequest.FreeTimeRequestContext |
Request.RequestContext, Request.RequestPriority
sCacheValues
sMaxSize
Constructor and Description |
---|
FreeTimeRequest(long id,
int priority,
boolean alternative,
Student student,
TimeLocation time)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
assigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Enrollment with this assignment was assigned to a
Request . |
int |
compareById(SctAssignment a)
Sections first, then by
Request.getId() |
List<Enrollment> |
computeEnrollments(Assignment<Request,Enrollment> assignment)
Create all possible enrollments of this request -- there is only one
possible enrollment:
createEnrollment() |
Request.RequestContext |
createAssignmentContext(Assignment<Request,Enrollment> assignment)
Create a new assignment context for the given assignment.
|
Enrollment |
createEnrollment()
Create enrollment of this request
|
boolean |
equals(Object o) |
double |
getBound()
Estimated bound for this request
|
Set<Enrollment> |
getEnrollments(Assignment<Request,Enrollment> assignment)
Return the list of assigned enrollments that contains this assignment.
|
float |
getMinCredit()
Smallest credit provided by this request
|
String |
getName()
Request name: A for alternative, 1 + priority, Free Time, long name of
requested time
|
int |
getNrRooms()
Assignment API: free time request has no rooms
|
Request.RequestPriority |
getRequestPriority()
Importance of the request.
|
List<RoomLocation> |
getRooms()
Assignment API: free time request has no rooms
|
TimeLocation |
getTime()
Return requested time to be free
|
int |
hashCode() |
boolean |
isAllowOverlap()
Free time request generally allow overlaps.
|
boolean |
isOverlapping(SctAssignment assignment)
True, if this assignment is overlapping in time and space with the given
assignment.
|
boolean |
isOverlapping(Set<? extends SctAssignment> assignments)
True, if this assignment is overlapping in time and space with the given
set of assignments.
|
String |
toString() |
void |
unassigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Enrollment with this assignment was unassigned from a
Request . |
compareTo, getId, getPriority, getStudent, getWeight, hasSelection, isAlternative, isAssigned, isCritical, isMPP, setPriority, setWeight, values, variableAssigned, variableUnassigned
getAssignmentContextReference, getContext, getContext, setAssignmentContextReference, setModel
addContstraint, addVariableListener, assign, constraints, constraintVariables, getAssignment, getAssignment, getAssignments, getBestAssignment, getBestAssignmentIteration, getDescription, getExtra, getIndex, getInitialAssignment, getLastIteration, getModel, getVariableListeners, hardConstraints, hasAssignment, hasAssignment, hasInitialAssignment, hasValues, removeContstraint, removeInitialValue, removeValue, removeVariableListener, setAssignment, setBestAssignment, setExtra, setIndex, setInitialAssignment, setLastIteration, setValues, softConstraints, unassign, values
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId
public FreeTimeRequest(long id, int priority, boolean alternative, Student student, TimeLocation time)
id
- request unique idpriority
- request priorityalternative
- true if the request is alternative (alternative request can be
assigned instead of a non-alternative course requests, if it
is left unassigned)student
- appropriate studenttime
- appropriate time location that is requested to be freepublic TimeLocation getTime()
getTime
in interface SctAssignment
public int getNrRooms()
getNrRooms
in interface SctAssignment
public List<RoomLocation> getRooms()
getRooms
in interface SctAssignment
RoomLocation
public boolean isOverlapping(SctAssignment assignment)
isOverlapping
in interface SctAssignment
assignment
- another assignmentpublic boolean isOverlapping(Set<? extends SctAssignment> assignments)
isOverlapping
in interface SctAssignment
assignments
- a set of assignmentspublic Enrollment createEnrollment()
public List<Enrollment> computeEnrollments(Assignment<Request,Enrollment> assignment)
createEnrollment()
computeEnrollments
in class Request
assignment
- current assignmentpublic void assigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
Request
.assigned
in interface SctAssignment
assignment
- current assignmentenrollment
- an enrollment that was just assignedpublic void unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
Request
.unassigned
in interface SctAssignment
assignment
- current assignmentenrollment
- an enrollment that was just unassignedpublic Set<Enrollment> getEnrollments(Assignment<Request,Enrollment> assignment)
getEnrollments
in interface SctAssignment
assignment
- current assignmentspublic String getName()
getName
in class Variable<Request,Enrollment>
public double getBound()
public boolean isAllowOverlap()
isAllowOverlap
in interface SctAssignment
public int compareById(SctAssignment a)
Request.getId()
compareById
in interface SctAssignment
a
- another section assignmentpublic Request.RequestContext createAssignmentContext(Assignment<Request,Enrollment> assignment)
HasAssignmentContext
createAssignmentContext
in interface HasAssignmentContext<Request,Enrollment,Request.RequestContext>
createAssignmentContext
in class Request
assignment
- an assignment for which there needs to be an assignment contextpublic float getMinCredit()
Request
getMinCredit
in class Request
public Request.RequestPriority getRequestPriority()
Request
getRequestPriority
in class Request