|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The TabuSearch is the main source of control for the programmer. The extended and instantiated tabu objects are passed to the tabu search, and the tabu search fires off relevant events to interested listeners. These events make it easy to extend the tabu search to include popular techniques such as intensification, diversification, and strategic oscillation.
As always, I am available for questions at rharder@usa.net.
This code is licensed for public use under the Common Public License version 0.5.
The Common Public License, developed by IBM and modeled after their industry-friendly IBM Public License,
differs from other common open source licenses in several important ways:
Copyright © 2001 Robert Harder
Method Summary | |
void |
addTabuSearchListener(TabuSearchListener listener)
Register a TabuSearchListener with the tabu search. |
AspirationCriteria |
getAspirationCriteria()
Returns the aspiration critera. |
Solution |
getBestSolution()
Returns the best solution found so far. |
Solution |
getCurrentSolution()
Returns the current solution. |
int |
getIterationsCompleted()
Returns the total number iterations that have been completed since the instantiation of this TabuSearch . |
int |
getIterationsToGo()
Returns the number of iterations left to go. |
MoveManager |
getMoveManager()
Returns the move manager. |
ObjectiveFunction |
getObjectiveFunction()
Returns the objective function. |
TabuList |
getTabuList()
Returns the tabu list. |
boolean |
isChooseFirstImprovingMove()
Returns whether or not the tabu search engine will choose the first improving move it encounters at each iteration (true) or will choose the best move at each iteration (false). |
boolean |
isMaximizing()
Returns whether or not the tabu search should be maximizing the objective function. |
boolean |
isSolving()
Returns true if the tabu search is currently solving. |
void |
removeTabuSearchListener(TabuSearchListener listener)
Unregister a TabuSearchListener with the tabu search. |
void |
setAspirationCriteria(AspirationCriteria aspirationCriteria)
Sets the aspiration critera effective at the start of the next iteration. |
void |
setBestSolution(Solution solution)
Sets the best solution effective at the start of the next iteration and evaluates the solution with the current objective function. |
void |
setChooseFirstImprovingMove(boolean choose)
Setting this to true will cause the search to go faster by not necessarily evaluating all of the moves in a neighborhood for each iteration. |
void |
setCurrentSolution(Solution solution)
Sets the current solution effective at the start of the next iteration and evaluates the solution with the current objective function. |
void |
setIterationsToGo(int iterations)
Sets the iterations remaining to be solved. |
void |
setMaximizing(boolean maximizing)
Sets whether or not the tabu search should be maximizing the objective function. |
void |
setMoveManager(MoveManager moveManager)
Sets the move manager effective at the start of the next iteration. |
void |
setObjectiveFunction(ObjectiveFunction function)
Sets the objective function effective at the start of the next iteration and re-evaluates the best and current solutions. |
void |
setTabuList(TabuList tabuList)
Sets the tabu list effective at the start of the next iteration. |
void |
startSolving()
Starts the tabu search if iterationsToGo is greater than zero. |
void |
stopSolving()
Stops the tabu search after the current iteration finishes but leaves iterationsToGo untouched. |
Method Detail |
public void startSolving()
setIterationsToGo(int)
,
getIterationsToGo()
public void stopSolving()
Implementations of TabuSearch should block on this method until the iteration is done.
setIterationsToGo(int)
,
getIterationsToGo()
public boolean isSolving()
public void addTabuSearchListener(TabuSearchListener listener)
TabuSearchListener
with the tabu search.
Implementations of TabuSearch should synchronize this method.
listener
- The listener to register.TabuSearchListener
public void removeTabuSearchListener(TabuSearchListener listener)
TabuSearchListener
with the tabu search.
Implementations of TabuSearch should synchronize this method.
listener
- The listener to unregister.TabuSearchListener
public void setObjectiveFunction(ObjectiveFunction function)
Implementations of TabuSearch should synchronize this method.
function
- The new objective functionObjectiveFunction
public void setMoveManager(MoveManager moveManager)
Implementations of TabuSearch should synchronize this method.
moveManager
- The new move managerMoveManager
public void setTabuList(TabuList tabuList)
Implementations of TabuSearch should synchronize this method.
tabuList
- The new tabu listTabuList
public void setAspirationCriteria(AspirationCriteria aspirationCriteria)
Implementations of TabuSearch should synchronize this method.
aspirationCriteria
- The new aspiration criteriaAspirationCriteria
public void setBestSolution(Solution solution)
Implementations of TabuSearch should synchronize this method.
solution
- The new best solutionSolution
public void setCurrentSolution(Solution solution)
Implementations of TabuSearch should synchronize this method.
solution
- The new current solutionSolution
public void setIterationsToGo(int iterations)
Implementations of TabuSearch should synchronize this method.
iterations
- The number of iterations left to gopublic void setMaximizing(boolean maximizing)
Implementations of TabuSearch should synchronize this method.
maximizing
- true if the tabu search should be maximizing, false otherwise.public void setChooseFirstImprovingMove(boolean choose)
choose
- Whether or not the first improving move will be chosenpublic boolean isChooseFirstImprovingMove()
public ObjectiveFunction getObjectiveFunction()
Implementations of TabuSearch should synchronize this method.
Function
public MoveManager getMoveManager()
Implementations of TabuSearch should synchronize this method.
MoveManager
public TabuList getTabuList()
Implementations of TabuSearch should synchronize this method.
TabuList
public AspirationCriteria getAspirationCriteria()
Implementations of TabuSearch should synchronize this method.
AspirationCriteria
public Solution getBestSolution()
Implementations of TabuSearch should synchronize this method.
Solution
public Solution getCurrentSolution()
Implementations of TabuSearch should synchronize this method.
Solution
public int getIterationsToGo()
Implementations of TabuSearch should synchronize this method.
public int getIterationsCompleted()
TabuSearch
.
Implementations of TabuSearch should synchronize this method.
public boolean isMaximizing()
Implementations of TabuSearch should synchronize this method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |