org.coinor.opents
Class TabuSearchBase

java.lang.Object
  extended byorg.coinor.opents.TabuSearchBase
All Implemented Interfaces:
java.io.Serializable, TabuSearch
Direct Known Subclasses:
SingleThreadedTabuSearch

public abstract class TabuSearchBase
extends java.lang.Object
implements TabuSearch

This abstract class implements TabuSearch and defines the event-handling methods including the add/remove methods and package-level fireXxx methods. It is the base class for the MultiThreadedTabuSearch and SingleThreadedTabuSearch.

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

Since:
1.0
See Also:
Serialized Form

Constructor Summary
TabuSearchBase()
           
 
Method Summary
 void addTabuSearchListener(TabuSearchListener listener)
          Registers listener to receive tabu events when a new best solution is found.
protected  void fireImprovingMoveMade()
          This quick method is called when an improving move is made.
protected  void fireNewBestSolution()
          This quick method is called when a new best solution is found.
protected  void fireNewCurrentSolution()
          This quick method is called when a new current solution is found.
protected  void fireNoChangeInValueMoveMade()
          This quick method is called when a no change in value move is made.
protected  void fireTabuSearchStarted()
          This quick method is called when the tabuSearch starts.
protected  void fireTabuSearchStopped()
          This quick method is called when the tabuSearch finishes.
protected  void fireUnimprovingMoveMade()
          This quick method is called when an unimproving move is made.
 int getIterationsCompleted()
          Returns the total number iterations that have been completed since the instantiation of this TabuSearch.
protected  void incrementIterationsCompleted()
          Increments the number of iterations completed by one.
 void removeTabuSearchListener(TabuSearchListener listener)
          Removes listener from list of objects to notify when a new best solution is found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.coinor.opents.TabuSearch
getAspirationCriteria, getBestSolution, getCurrentSolution, getIterationsToGo, getMoveManager, getObjectiveFunction, getTabuList, isChooseFirstImprovingMove, isMaximizing, isSolving, setAspirationCriteria, setBestSolution, setChooseFirstImprovingMove, setCurrentSolution, setIterationsToGo, setMaximizing, setMoveManager, setObjectiveFunction, setTabuList, startSolving, stopSolving
 

Constructor Detail

TabuSearchBase

public TabuSearchBase()
Method Detail

getIterationsCompleted

public int getIterationsCompleted()
Returns the total number iterations that have been completed since the instantiation of this TabuSearch.

Specified by:
getIterationsCompleted in interface TabuSearch
Returns:
Total number of completed iterations
Since:
1.0a

incrementIterationsCompleted

protected void incrementIterationsCompleted()
Increments the number of iterations completed by one. This method should be called by all implementations of TabuSearchBase at the end of an iteration.

Since:
1.0a

addTabuSearchListener

public final void addTabuSearchListener(TabuSearchListener listener)
Registers listener to receive tabu events when a new best solution is found.

Specified by:
addTabuSearchListener in interface TabuSearch
Parameters:
listener - The TabuSearchListener to register.
Since:
1.0
See Also:
TabuSearchListener

removeTabuSearchListener

public final void removeTabuSearchListener(TabuSearchListener listener)
Removes listener from list of objects to notify when a new best solution is found.

Specified by:
removeTabuSearchListener in interface TabuSearch
Parameters:
listener - TabuSearchListener to remove from notification list.
Since:
1.0
See Also:
TabuSearchListener

fireNewBestSolution

protected final void fireNewBestSolution()
This quick method is called when a new best solution is found. The TabuSearchEvent sent to the listeners is a "lightweight" event, specifying only the source object, this.

Since:
1.0
See Also:
TabuSearchEvent

fireNewCurrentSolution

protected final void fireNewCurrentSolution()
This quick method is called when a new current solution is found. The TabuSearchEvent sent to the listeners is a "lightweight" event, specifying only the source object, this.

Since:
1.0
See Also:
TabuSearchEvent

fireUnimprovingMoveMade

protected final void fireUnimprovingMoveMade()
This quick method is called when an unimproving move is made. The TabuSearchEvent sent to the listeners is a "lightweight" event, specifying only the source object, this.

Since:
1.0
See Also:
TabuSearchEvent

fireImprovingMoveMade

protected final void fireImprovingMoveMade()
This quick method is called when an improving move is made. The TabuSearchEvent sent to the listeners is a "lightweight" event, specifying only the source object, this.

Since:
1.0-exp7
See Also:
TabuSearchEvent

fireNoChangeInValueMoveMade

protected final void fireNoChangeInValueMoveMade()
This quick method is called when a no change in value move is made. The TabuSearchEvent sent to the listeners is a "lightweight" event, specifying only the source object, this.

Since:
1.0-exp7
See Also:
TabuSearchEvent

fireTabuSearchStopped

protected final void fireTabuSearchStopped()
This quick method is called when the tabuSearch finishes. The TabuSearchEvent sent to the listeners is a "lightweight" event, specifying only the source object, this.

Since:
1.0
See Also:
TabuSearchEvent

fireTabuSearchStarted

protected final void fireTabuSearchStarted()
This quick method is called when the tabuSearch starts. The TabuSearchEvent sent to the listeners is a "lightweight" event, specifying only the source object, this.

Since:
1.0
See Also:
TabuSearchEvent