public class RandomStudentSwap extends StudentSwapGenerator implements HillClimberSelection
StudentSwapGenerator, but making a random selection of a lecture and of a student.
The selection is only available/enabled when the solver is using a single thread
(Solver.hasSingleSolution() is true) as student class assignments are not included in the
solution.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
iEnabled |
protected boolean |
iHC |
| Constructor and Description |
|---|
RandomStudentSwap(DataProperties config) |
| Modifier and Type | Method and Description |
|---|---|
void |
init(Solver<Lecture,Placement> solver)
Criterion initialization
|
Neighbour<Lecture,Placement> |
selectNeighbour(Solution<Lecture,Placement> solution)
select a neighbour of a given solution
|
void |
setHcMode(boolean hcMode)
True if employed by a hill climber, e.g., worsening moves may be skipped.
|
generateSwap, selectNeighbourpublic RandomStudentSwap(DataProperties config)
public void init(Solver<Lecture,Placement> solver)
NeighbourSelectioninit in interface NeighbourSelection<Lecture,Placement>init in class StudentSwapGeneratorsolver - current solverpublic Neighbour<Lecture,Placement> selectNeighbour(Solution<Lecture,Placement> solution)
NeighbourSelectionselectNeighbour in interface NeighbourSelection<Lecture,Placement>selectNeighbour in class StudentSwapGeneratorsolution - given solutionpublic void setHcMode(boolean hcMode)
HillClimberSelectionsetHcMode in interface HillClimberSelectionhcMode - true if used by a hill climber (worsening moves are automatically discarded)