public class ExamNeighbourSelection extends NeighbourSelectionWithContext<Exam,ExamPlacement,ExamNeighbourSelection.Context> implements TerminationCondition<Exam,ExamPlacement>
ExamConstruction
until all exams are
assigned)
HillClimber
until the given number if
idle iterations)
SimulatedAnnealing
until timeout
is reached)
GreatDeluge
until timeout is reached)
TerminationCondition.canContinue(Solution)
is
false), the search is finished with one sweep of final phase (
HillClimber
until the given number if idle iterations).
Modifier and Type | Class and Description |
---|---|
class |
ExamNeighbourSelection.Context |
iContextOverride
sMaxSize
Constructor and Description |
---|
ExamNeighbourSelection(DataProperties properties)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
canContinue(Solution<Exam,ExamPlacement> currentSolution)
Termination condition (i.e., has final phase finished)
|
ExamNeighbourSelection.Context |
createAssignmentContext(Assignment<Exam,ExamPlacement> assignment)
Create a new assignment context for the given assignment.
|
void |
init(Solver<Exam,ExamPlacement> solver)
Initialization
|
boolean |
isFinalPhase()
Is final phase
|
Neighbour<Exam,ExamPlacement> |
selectNeighbour(Solution<Exam,ExamPlacement> solution)
Neighbour selection.
|
void |
setFinalPhase(Callback finalPhaseFinished)
Set final phase
|
getAssignmentContextReference, getContext, getContext, hasContextOverride, isSingleContextSolver, setAssignmentContextReference
public ExamNeighbourSelection(DataProperties properties)
properties
- problem propertiespublic void init(Solver<Exam,ExamPlacement> solver)
init
in interface NeighbourSelection<Exam,ExamPlacement>
init
in class NeighbourSelectionWithContext<Exam,ExamPlacement,ExamNeighbourSelection.Context>
solver
- current solverpublic Neighbour<Exam,ExamPlacement> selectNeighbour(Solution<Exam,ExamPlacement> solution)
ExamConstruction
until all exams are
assigned)
HillClimber
until the given number
if idle iterations)
SimulatedAnnealing
until
timeout is reached)
selectNeighbour
in interface NeighbourSelection<Exam,ExamPlacement>
solution
- given solutionpublic void setFinalPhase(Callback finalPhaseFinished)
finalPhaseFinished
- to be called when the final phase is finishedpublic boolean isFinalPhase()
public boolean canContinue(Solution<Exam,ExamPlacement> currentSolution)
canContinue
in interface TerminationCondition<Exam,ExamPlacement>
currentSolution
- current solutionpublic ExamNeighbourSelection.Context createAssignmentContext(Assignment<Exam,ExamPlacement> assignment)
HasAssignmentContext
createAssignmentContext
in interface HasAssignmentContext<Exam,ExamPlacement,ExamNeighbourSelection.Context>
assignment
- an assignment for which there needs to be an assignment context