public class SwapStudentSelection extends Object implements NeighbourSelection<Request,Enrollment>, ProblemStudentsProvider
Student.canAssign(Request)
) a randomly selected sub-domain is
visited. For every such enrollment, a set of conflicting enrollments is
computed and a possible student that can get an alternative enrollment is
identified (if there is any). For each such move a value (the cost of moving
the problematic student somewhere else) is computed and the best possible
move is selected at the end. If there is no such move, a set of problematic
students is identified, i.e., the students whose enrollments are preventing
this student to get a request. ProblemStudentsProvider
interface. Parameter | Type | Comment |
---|---|---|
Neighbour.SwapStudentsTimeout | Integer |
Timeout for each neighbour selection (in milliseconds). |
Neighbour.SwapStudentsMaxValues | Integer |
Limit for the number of considered values for each course request (see
CourseRequest.computeRandomEnrollments(int) ). |
Modifier and Type | Class and Description |
---|---|
class |
SwapStudentSelection.Selection
This class looks for a possible swap move for the given student
|
static class |
SwapStudentSelection.SwapStudentNeighbour
Neighbour that contains the swap
|
Modifier and Type | Field and Description |
---|---|
protected StudentOrder |
iOrder |
static boolean |
sDebug |
Constructor and Description |
---|
SwapStudentSelection(DataProperties properties)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static Enrollment |
bestSwap(Enrollment conflict,
Enrollment enrl,
Set<Student> problematicStudents)
Identify the best swap for the given student
|
Set<Student> |
getProblemStudents()
List of problematic students
|
SwapStudentSelection.Selection |
getSelection(Student student)
Selection subclass for a student
|
void |
init(Solver<Request,Enrollment> solver)
Initialization
|
Neighbour<Request,Enrollment> |
selectNeighbour(Solution<Request,Enrollment> solution)
For each student that does not have a complete schedule, try to find a
request and a student that can be moved out of an enrollment so that the
selected student can be assigned to the selected request.
|
public static boolean sDebug
protected StudentOrder iOrder
public SwapStudentSelection(DataProperties properties)
properties
- configurationpublic void init(Solver<Request,Enrollment> solver)
init
in interface NeighbourSelection<Request,Enrollment>
public Neighbour<Request,Enrollment> selectNeighbour(Solution<Request,Enrollment> solution)
selectNeighbour
in interface NeighbourSelection<Request,Enrollment>
solution
- given solutionpublic Set<Student> getProblemStudents()
getProblemStudents
in interface ProblemStudentsProvider
public SwapStudentSelection.Selection getSelection(Student student)
public static Enrollment bestSwap(Enrollment conflict, Enrollment enrl, Set<Student> problematicStudents)
conflict
- conflicting enrollmentenrl
- enrollment that is visited (to be assigned to the given
student)problematicStudents
- the current set of problematic students