public class StandardSelection extends Object implements NeighbourSelection<Request,Enrollment>, AssignmentCheck<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 boolean |
iCanWorsen |
protected boolean |
iCanWorsenCritical |
protected long |
iConflictTimeOut |
protected long |
iNrIterations |
protected boolean |
iPreferPriorityStudents |
protected long |
iTimeOut |
protected ValueSelection<Request,Enrollment> |
iValueSelection |
protected VariableSelection<Request,Enrollment> |
iVariableSelection |
protected long |
iWorsenTimeOut |
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 |
accept(SimpleNeighbour<Request,Enrollment> n,
Solution<Request,Enrollment> solution)
Check whether the given neighbors can be returned
|
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 iWorsenTimeOut
protected long iTimeOut
protected boolean iCanConflict
protected boolean iCanWorsen
protected boolean iCanWorsenCritical
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)
canUnassign
in interface AssignmentCheck<Request,Enrollment>
conflict
- given enrollmentenrollment
- value to be assignedassignment
- current assignmentpublic boolean accept(SimpleNeighbour<Request,Enrollment> n, Solution<Request,Enrollment> solution)
public 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