edu.duke.cs.banjo.learner.components
Class Decider

java.lang.Object
  extended byedu.duke.cs.banjo.learner.components.Decider
All Implemented Interfaces:
DeciderI
Direct Known Subclasses:
DeciderGreedy, DeciderMetropolis

public abstract class Decider
extends java.lang.Object
implements DeciderI

Combines common code shared by the different decider implementations.

Details:

Change History:
Created on Apr 13, 2004
3/24/2008 (v2.2) hjs Modify access to random numbers.

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

Field Summary
protected  long[] betterScoreChangeTypeTracker
           
protected  long comparisonsSinceLastHighScore
           
protected  long[] consideredChangeTypeTracker
           
protected  double currentScore
           
protected  int minMarkovLag
           
protected  long[] otherAcceptedChangeTypeTracker
           
protected  Settings processData
           
protected  java.util.Random rnd
           
 
Constructor Summary
Decider(BayesNetManagerI _initialBayesNet, Settings _processData)
           
 
Method Summary
 double getComparisonsSinceLastHighScore()
           
 double getCurrentScore()
           
abstract  boolean isChangeAccepted(double _newScore, BayesNetChangeI _bayesNetChange)
           
 java.lang.StringBuffer provideCollectedStatistics()
          Collects a basic set of decider-related statistics that any subclass can use as default.
 void setCurrentScore(double _currentScore)
          Sets the score of the current network.
 void updateProcessData(Settings _processData)
          Updates whatever setting within processData that is being changed in the particular decider implementation (usually called from the overarching search method; See, e.g., the exchange of data between SearcherSimAnneal and DeciderMetropolis).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentScore

protected double currentScore

rnd

protected final java.util.Random rnd

minMarkovLag

protected final int minMarkovLag

comparisonsSinceLastHighScore

protected long comparisonsSinceLastHighScore

consideredChangeTypeTracker

protected long[] consideredChangeTypeTracker

otherAcceptedChangeTypeTracker

protected long[] otherAcceptedChangeTypeTracker

betterScoreChangeTypeTracker

protected long[] betterScoreChangeTypeTracker

processData

protected Settings processData
Constructor Detail

Decider

public Decider(BayesNetManagerI _initialBayesNet,
               Settings _processData)
        throws java.lang.Exception
Method Detail

isChangeAccepted

public abstract boolean isChangeAccepted(double _newScore,
                                         BayesNetChangeI _bayesNetChange)
                                  throws java.lang.Exception
Specified by:
isChangeAccepted in interface DeciderI
Parameters:
_newScore - The score of the network.
_bayesNetChange - The change to the network.
Returns:
Returns whether to keep the newScore based on the bayesNetChange.
Throws:
java.lang.Exception

getCurrentScore

public final double getCurrentScore()
Returns:
Returns the currentScore.

getComparisonsSinceLastHighScore

public double getComparisonsSinceLastHighScore()
Returns:
Returns the comparisonsSinceLastHighScore.

setCurrentScore

public void setCurrentScore(double _currentScore)
Description copied from interface: DeciderI
Sets the score of the current network.

Specified by:
setCurrentScore in interface DeciderI
Parameters:
_currentScore - The currentScore to set.

updateProcessData

public void updateProcessData(Settings _processData)
                       throws java.lang.Exception
Description copied from interface: DeciderI
Updates whatever setting within processData that is being changed in the particular decider implementation (usually called from the overarching search method; See, e.g., the exchange of data between SearcherSimAnneal and DeciderMetropolis).

Specified by:
updateProcessData in interface DeciderI
Parameters:
_processData - The data to be exchanged.
Throws:
java.lang.Exception

provideCollectedStatistics

public java.lang.StringBuffer provideCollectedStatistics()
                                                  throws java.lang.Exception
Collects a basic set of decider-related statistics that any subclass can use as default.

Specified by:
provideCollectedStatistics in interface DeciderI
Returns:
The statistics about the particular decider implementation.
Throws:
java.lang.Exception