edu.duke.cs.banjo.learner
Class SearcherGreedy

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

public class SearcherGreedy
extends Searcher

Implements a greedy search.

Details:
- Compatible with "random local move" and "all local moves" proposers.
- Requires that the user specifies several parameters that are greedy-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).

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 SearcherGreedy.BasicHighScoreSetUpdater
          Inner class for tracking a set of N-best (N>1) scoring networks.
protected  class SearcherGreedy.DoubleTerminator
          Inner class for terminating a search with 2 termination criteria.
protected  class SearcherGreedy.GlobalSearchExecuter
          Inner class for executing a search based on a set of local changes.
protected  class SearcherGreedy.IterationsTerminator
          Inner class for terminating a search based on a limit on the number of iterations.
protected  class SearcherGreedy.LocalSearchExecuter
          Inner class for executing a search based on a single local change.
protected  class SearcherGreedy.RestartsTerminator
          Inner class for terminating a search based on a limit on the number of restarts.
protected  class SearcherGreedy.SingleHighScoreUpdater
          Inner class for tracking a single high-scoring network
protected  class SearcherGreedy.SingleTerminator
          Inner class for terminating a search with 1 termination criterion.
protected  class SearcherGreedy.TimeTerminator
          Inner class for terminating a search based on a limit on the search time.
protected  class SearcherGreedy.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  int innerLoopStart
           
protected  long maxNetworksVisitedBeforeRestart
           
protected  long minNetworksVisitedBeforeRestart
           
protected  long minNetworksVisitedSinceHighScore
           
protected  long networksVisitedSinceHighScore
           
protected  long networksVisitedSinceRestart
           
 
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
SearcherGreedy(Settings _processData)
          Constructor for the greedy searcher implementation.
 
Method Summary
protected  void checkForRestart()
          Method used by terminator inner classes, for checking when to restart the greedy 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 greedy 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

innerLoopStart

protected int innerLoopStart

networksVisitedSinceHighScore

protected long networksVisitedSinceHighScore

networksVisitedSinceRestart

protected long networksVisitedSinceRestart

minNetworksVisitedSinceHighScore

protected long minNetworksVisitedSinceHighScore

minNetworksVisitedBeforeRestart

protected long minNetworksVisitedBeforeRestart

maxNetworksVisitedBeforeRestart

protected long maxNetworksVisitedBeforeRestart
Constructor Detail

SearcherGreedy

public SearcherGreedy(Settings _processData)
               throws java.lang.Exception
Constructor for the greedy searcher implementation.

Method Detail

validateRequiredData

private boolean validateRequiredData()
                              throws java.lang.Exception
Validates the settings values required for the greedy 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.

checkForRestart

protected void checkForRestart()
                        throws java.lang.Exception
Method used by terminator inner classes, for checking when to restart the greedy 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