public class StandardSelection extends Object implements NeighbourSelection<Request,Enrollment>
Parameter | Type | Comment |
---|---|---|
Neighbour.StandardIterations | Long |
Number of iterations to perform. If -1, number of iterations is set to the number of unassigned variables. |
Modifier and Type | Field and Description |
---|---|
protected boolean |
iCanConflict |
protected boolean |
iCanHigherPriorityConflict |
protected long |
iConflictTimeOut |
protected long |
iNrIterations |
protected boolean |
iPreferPriorityStudents |
protected long |
iTimeOut |
protected ValueSelection<Request,Enrollment> |
iValueSelection |
protected VariableSelection<Request,Enrollment> |
iVariableSelection |
Constructor and Description |
---|
StandardSelection(DataProperties properties,
VariableSelection<Request,Enrollment> variableSelection,
ValueSelection<Request,Enrollment> valueSelection)
Constructor (variable and value selection are expected to be already
initialized).
|
Modifier and Type | Method and Description |
---|---|
boolean |
canUnassign(Enrollment enrollment,
Enrollment conflict,
Assignment<Request,Enrollment> assignment)
Check if the given conflicting enrollment can be unassigned
|
void |
init(Solver<Request,Enrollment> solver)
Initialization
|
protected void |
init(Solver<Request,Enrollment> solver,
String name) |
Neighbour<Request,Enrollment> |
selectNeighbour(Solution<Request,Enrollment> solution)
Employ the provided
VariableSelection and ValueSelection
and return the selected value as SimpleNeighbour . |
protected ValueSelection<Request,Enrollment> iValueSelection
protected VariableSelection<Request,Enrollment> iVariableSelection
protected long iNrIterations
protected boolean iPreferPriorityStudents
protected long iConflictTimeOut
protected long iTimeOut
protected boolean iCanConflict
protected boolean iCanHigherPriorityConflict
public StandardSelection(DataProperties properties, VariableSelection<Request,Enrollment> variableSelection, ValueSelection<Request,Enrollment> valueSelection)
properties
- configurationvariableSelection
- variable selectionvalueSelection
- value selectionpublic void init(Solver<Request,Enrollment> solver)
init
in interface NeighbourSelection<Request,Enrollment>
solver
- current solverprotected void init(Solver<Request,Enrollment> solver, String name)
public boolean canUnassign(Enrollment enrollment, Enrollment conflict, Assignment<Request,Enrollment> assignment)
conflict
- given enrollmentpublic Neighbour<Request,Enrollment> selectNeighbour(Solution<Request,Enrollment> solution)
VariableSelection
and ValueSelection
and return the selected value as SimpleNeighbour
. The selection
is stopped (null is returned) after the number of iterations equal to the
number of variables in the problem or when a complete solution is found.selectNeighbour
in interface NeighbourSelection<Request,Enrollment>
solution
- given solution