edu.duke.cs.banjo.learner
Class SearcherSimAnneal

java.lang.Object
  extended byedu.duke.cs.banjo.learner.Searcher
      extended byedu.duke.cs.banjo.learner.SearcherSimAnneal
All Implemented Interfaces:
SearcherI

public class SearcherSimAnneal
extends Searcher

Implements a simulated annealing-based search.

Details:
- Compatible with "random local move" and "all local moves" proposers.
- Requires that the user specifies several parameters that are annealer-specific and not used by other searchers (in addition to the standard set of parameters).

Change History:
Created on May 17, 2004

8/25/2005 (v1.0.1) hjs Improve the fixedNumberOfRestarts handling (enable search with 0 restarts).

9/6/2005 (v1.0.3) hjs Defect in GlobalSearchExecuter: acceptedPerTemperature and iterationsPerTemperature were not incremented properly.

10/18/2005 (v2.0) hjs Code cleanup as part of initial setting up of version 1.5.

hjs (v2.1) Make 2 methods "synchronized".

Author:
Jurgen Sladeczek (hjs)
For the latest info, please visit www.cs.duke.edu.

Nested Class Summary
protected  class SearcherSimAnneal.BasicHighScoreSetUpdater
          Inner class for tracking a set of N-best (N>1) scoring networks.
protected  class SearcherSimAnneal.DoubleTerminator
          Inner class for terminating a search with 2 termination criteria.
protected  class SearcherSimAnneal.GlobalSearchExecuter
          Inner class for executing a search based on a set of local changes.
protected  class SearcherSimAnneal.IterationsTerminator
          Inner class for terminating a search based on a limit on the number of iterations.
protected  class SearcherSimAnneal.LocalSearchExecuter
           
protected  class SearcherSimAnneal.RestartsTerminator
          Inner class for terminating a search based on a limit on the number of restarts.
protected  class SearcherSimAnneal.SingleHighScoreUpdater
          Inner class for tracking a single high-scoring network
protected  class SearcherSimAnneal.SingleTerminator
          Inner class for terminating a search with 1 termination criterion.
protected  class SearcherSimAnneal.TimeTerminator
          Inner class for terminating a search based on a limit on the search time.
protected  class SearcherSimAnneal.TripleTerminator
          Inner class for terminating a search with 3 termination criteria.
 
Nested classes inherited from class edu.duke.cs.banjo.learner.Searcher
Searcher.HighScoreSetUpdater, Searcher.SearchExecuter, Searcher.SearchMultipleTerminator, Searcher.SearchTerminator
 
Field Summary
protected  long acceptedPerTemperature
           
protected  double coolingFactor
           
protected  double currentTemperature
           
protected  int innerLoopStart
           
protected  long iterationsPerTemperature
           
protected  long maxAcceptedNetworksBeforeCooling
           
protected  long maxSearchIterationsBeforeCooling
           
protected  long minAcceptedNetworksBeforeReannealing
           
protected  double reannealingTemperature
           
 
Fields inherited from class edu.duke.cs.banjo.learner.Searcher
bayesNetManager, currentBestScoreSinceRestart, cycleChecker, decider, displayFeedbackByTime, displayMemoryInfo, elapsedTime, equivalenceChecker, estimatedTime, evaluator, feedbackRestarts, feedbackTimeDelta, fileReportInterval, fileReportTimeDelta, highScoreSetUpdater, highScoreStructureSet, highScoreStructureSinceRestart, intermediateTime, isEquivalent, lineLength, linePostfix, loopPaddingLength, maxMarkovLag, maxNetworksVisitedInInnerLoop, maxRestarts, maxSearchLoops, maxSearchTime, minMarkovLag, nBestCount, nBestMax, nBestThresholdScore, networksVisitedGlobalCounter, networksVisitedInnerLoopCounter, newLinePlusPrefix, nextFeedbackTime, nextFileReportTime, nextScreenReportTime, nonEquivalentHighScoreStructureSet, numberOfDecimals, optionalThreadLabel, percentLevel, percentPaddingLength, prefix, processData, proposer, restartCount, restartPaddingLength, restartsAtCounts, restartWithRandomNetwork, screenReportInterval, screenReportTimeDelta, searcherStatistics, searcherStats, searchExecuter, searchTerminator, startTime, suggestedBayesNetChange, suggestedChangeList, terminator, timeFormat, timePaddingLength, trackIntermediateResults, unreachableScore, varCount
 
Constructor Summary
SearcherSimAnneal(Settings _processData)
          Constructor for the simulated annealing searcher implementation.
 
Method Summary
protected  void checkForReanneal()
          Method used by terminator inner classes, for checking when to reanneal the (simulated annealing) search.
 void executeSearch()
          Wrapper around the executeSearch method of the inner classes that govern the search behaviour.
protected  void setupSearch()
          Set up the search, and compile various pieces of info about the search, to be used by the recorder.
 void updateProcessData(Settings _processData)
          Updates whatever setting within processData that is being changed in the particular searcher implementation
private  boolean validateRequiredData()
          Validates the settings values required for the simulated annealing searcher.
 java.lang.Object validChoices()
          Provides the valid choices for this class, here: for all compatible components.
 
Methods inherited from class edu.duke.cs.banjo.learner.Searcher
askToVerifySettings, feedbackBasedOnTime, finalCleanup, getBayesNetManager, getElapsedTime, getHighScore, getHighScoreStructure, getHighScoreStructureSet, getNetworksVisitedGlobalCounter, getSearcherStatistics, handleOutOfMemory, listScores, provideCollectedStatistics, pruneEquivalentNetworks, trackIntermediateResults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentTemperature

protected double currentTemperature

coolingFactor

protected double coolingFactor

innerLoopStart

protected int innerLoopStart

iterationsPerTemperature

protected long iterationsPerTemperature

acceptedPerTemperature

protected long acceptedPerTemperature

maxAcceptedNetworksBeforeCooling

protected long maxAcceptedNetworksBeforeCooling

maxSearchIterationsBeforeCooling

protected long maxSearchIterationsBeforeCooling

minAcceptedNetworksBeforeReannealing

protected long minAcceptedNetworksBeforeReannealing

reannealingTemperature

protected double reannealingTemperature
Constructor Detail

SearcherSimAnneal

public SearcherSimAnneal(Settings _processData)
                  throws java.lang.Exception
Constructor for the simulated annealing searcher implementation.

Method Detail

validateRequiredData

private boolean validateRequiredData()
                              throws java.lang.Exception
Validates the settings values required for the simulated annealing searcher.

Returns:
Returns the boolean flag that indicates whether a crucial setting could not be validated.
Throws:
java.lang.Exception

setupSearch

protected void setupSearch()
                    throws java.lang.Exception
Set up the search, and compile various pieces of info about the search, to be used by the recorder.

Throws:
java.lang.Exception

executeSearch

public void executeSearch()
                   throws java.lang.Exception
Wrapper around the executeSearch method of the inner classes that govern the search behaviour.

Specified by:
executeSearch in interface SearcherI
Specified by:
executeSearch in class Searcher
Throws:
java.lang.Exception

updateProcessData

public void updateProcessData(Settings _processData)
Description copied from interface: SearcherI
Updates whatever setting within processData that is being changed in the particular searcher implementation

Parameters:
_processData - The data to be exchanged.

checkForReanneal

protected void checkForReanneal()
                         throws java.lang.Exception
Method used by terminator inner classes, for checking when to reanneal the (simulated annealing) search.

Throws:
java.lang.Exception

validChoices

public java.lang.Object validChoices()
Provides the valid choices for this class, here: for all compatible components.

Overrides:
validChoices in class Searcher