public static class InevitableStudentConflicts.StudentCheck extends Object
Constructor and Description |
---|
StudentCheck(List<Request> requests)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
backTrack(Assignment<Request,Enrollment> assignment,
int idx)
branch & bound search
|
boolean |
canAssign(Request request,
int idx)
True if the given request can be assigned
|
void |
check(Assignment<Request,Enrollment> assignment)
Execute branch & bound, return the best found schedule for the
selected student.
|
Enrollment |
firstConflict(Enrollment enrollment)
First conflicting enrollment
|
Enrollment[] |
getBestAssignment()
Best schedule
|
int |
getBestNrAssigned()
Number of requests assigned in the best schedule
|
int |
getNrAssigned()
Number of assigned requests in the current schedule
|
int |
getNrAssignedBound(int idx)
Bound for the number of assigned requests in the current schedule
|
boolean |
isBestComplete()
True when the best enrollment is complete
|
void |
saveBest()
Save the current schedule as the best
|
public StudentCheck(List<Request> requests)
requests
- course and free time requests of a studentpublic void check(Assignment<Request,Enrollment> assignment)
assignment
- current assignmentpublic Enrollment[] getBestAssignment()
public int getBestNrAssigned()
public int getNrAssignedBound(int idx)
idx
- index of the request that is being assignedpublic boolean isBestComplete()
public void saveBest()
public Enrollment firstConflict(Enrollment enrollment)
enrollment
- an enrollmentpublic boolean canAssign(Request request, int idx)
request
- given requestidx
- index of the request that is being assignedpublic int getNrAssigned()
public void backTrack(Assignment<Request,Enrollment> assignment, int idx)
assignment
- current assignmentidx
- index of the request that is being assigned