|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.exam.heuristics.ExamHillClimbing
public class ExamHillClimbing
Hill climber. In each iteration, one of the following three neighbourhoods is selected first
ExamRandomMove
)
ExamTimeMove
)
ExamRoomMove
)
ExamSimpleNeighbour.value()
is
below or equal to zero. The search is stopped after a given amount of idle iterations (
can be defined by problem property HillClimber.MaxIdle).
Constructor Summary | |
---|---|
ExamHillClimbing(DataProperties properties)
Constructor |
|
ExamHillClimbing(DataProperties properties,
String name)
Constructor |
Method Summary | |
---|---|
void |
bestCleared(Solution solution)
Called by the solution when method Solution.clearBest() is called. |
void |
bestRestored(Solution solution)
Called by the solution when method Solution.restoreBest() is called. |
void |
bestSaved(Solution solution)
Memorize the iteration when the last best solution was found. |
void |
getInfo(Solution solution,
Dictionary info)
Called by the solution when it is asked to produce info table, see Solution.getInfo() . |
void |
getInfo(Solution solution,
Dictionary info,
Vector variables)
Called by the solution when it is asked to produce info table, see Solution.getInfo() . |
void |
init(Solver solver)
Initialization |
Neighbour |
selectNeighbour(Solution solution)
Select one of the given neighbourhoods randomly, select neighbour, return it if its value is below or equal to zero (continue with the next selection otherwise). |
void |
solutionUpdated(Solution solution)
Called by the solution when it is updated, see Solution.update(double) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExamHillClimbing(DataProperties properties)
properties
- problem properties (use HillClimber.MaxIdle to set maximum number of idle iterations)public ExamHillClimbing(DataProperties properties, String name)
properties
- problem properties (use HillClimber.MaxIdle to set maximum number of idle iterations)Method Detail |
---|
public void init(Solver solver)
init
in interface NeighbourSelection
public Neighbour selectNeighbour(Solution solution)
selectNeighbour
in interface NeighbourSelection
solution
- given solution
public void bestSaved(Solution solution)
bestSaved
in interface SolutionListener
solution
- source solutionpublic void solutionUpdated(Solution solution)
SolutionListener
Solution.update(double)
.
solutionUpdated
in interface SolutionListener
solution
- source solutionpublic void getInfo(Solution solution, Dictionary info)
SolutionListener
Solution.getInfo()
.
A listener can also add some its info into this table.
getInfo
in interface SolutionListener
solution
- source solutioninfo
- produced info tablepublic void getInfo(Solution solution, Dictionary info, Vector variables)
SolutionListener
Solution.getInfo()
.
A listener can also add some its info into this table.
getInfo
in interface SolutionListener
solution
- source solutioninfo
- produced info tablevariables
- only variables from this set are includedpublic void bestCleared(Solution solution)
SolutionListener
Solution.clearBest()
is called.
bestCleared
in interface SolutionListener
solution
- source solutionpublic void bestRestored(Solution solution)
SolutionListener
Solution.restoreBest()
is called.
bestRestored
in interface SolutionListener
solution
- source solution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |