public class SimpleSearch<V extends Variable<V,T>,T extends Value<V,T>> extends Object implements NeighbourSelection<V,T>, TerminationCondition<V,T>
StandardNeighbourSelection until all variables 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).
| Constructor and Description |
|---|
SimpleSearch(DataProperties properties)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canContinue(Solution<V,T> currentSolution)
Termination condition (i.e., has final phase finished)
|
void |
init(Solver<V,T> solver)
Initialization
|
boolean |
isFinalPhase()
Is final phase
|
Neighbour<V,T> |
selectNeighbour(Solution<V,T> solution)
Neighbour selection.
|
void |
setFinalPhase(Callback finalPhaseFinished)
Set final phase
|
public SimpleSearch(DataProperties properties) throws Exception
properties - problem propertiesExceptionpublic Neighbour<V,T> selectNeighbour(Solution<V,T> solution)
StandardNeighbourSelection until all variables are assigned)
HillClimber until the given number if idle iterations)
SimulatedAnnealing until timeout is reached)
selectNeighbour in interface NeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>>solution - given solutionpublic void setFinalPhase(Callback finalPhaseFinished)
finalPhaseFinished - to be called when the final phase is finishedpublic boolean isFinalPhase()
public boolean canContinue(Solution<V,T> currentSolution)
canContinue in interface TerminationCondition<V extends Variable<V,T>,T extends Value<V,T>>currentSolution - current solution