edu.indiana.iucbrf.ccbr.conversationblock.selector
Class FrequencyConversationBlockSelector

java.lang.Object
  extended by edu.indiana.iucbrf.ccbr.conversationblock.selector.AbstractConversationBlockSelector
      extended by edu.indiana.iucbrf.ccbr.conversationblock.selector.FrequencyConversationBlockSelector
All Implemented Interfaces:
ConversationBlockSelector, SwingRepresentableWithDomain, EnsembleMember, SwingRepresentable, java.io.Serializable

public class FrequencyConversationBlockSelector
extends AbstractConversationBlockSelector
implements EnsembleMember

This ConversationBlockSelector will always return a Question, the one corresponding to the FeatureKey most frequently appearing in the cases under consideration.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.indiana.iucbrf.ccbr.conversationblock.selector.AbstractConversationBlockSelector
differentiator
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Constructor Summary
FrequencyConversationBlockSelector()
          Creates a new instance of FrequencyConversationBlockSelector
 
Method Summary
protected  edu.indiana.iucbrf.ccbr.conversationblock.selector.FrequencyConversationBlockSelector.FrequencyCounter countFrequencies(Problem problemSoFar, RetrievalResults casesUnderConsideration)
           
 void decisionMade(java.lang.Object decision)
          The decision indicates the key chosen by the ensemble.
 java.util.ArrayList getFeatureKeyOrdering(Problem problemSoFar, RetrievalResults casesUnderConsideration)
           
protected  FeatureKey getNextFeatureKeyImpl(Problem problemSoFar, RetrievalResults casesUnderConsideration, CCBRDomain domain)
           
protected  void initConversationImpl(Problem initialProblem)
           
 SuggestionSet makeSuggestions(java.lang.Object[] args, double totalStrength)
          By default, a conversation block selector as an ensemble member gives all its strength to its single greatest suggestion.
 void reset()
          Reset the state of the conversation block selector, to prepare for a new conversation.
 javax.swing.JComponent toSwing(Domain domain)
           
 javax.swing.JComponent toSwing(int detailLevel)
          Detail level may be ignored by implementations.
 
Methods inherited from class edu.indiana.iucbrf.ccbr.conversationblock.selector.AbstractConversationBlockSelector
getNextBlock, getNextFeatureKey, initConversation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrequencyConversationBlockSelector

public FrequencyConversationBlockSelector()
Creates a new instance of FrequencyConversationBlockSelector

Method Detail

getNextFeatureKeyImpl

protected FeatureKey getNextFeatureKeyImpl(Problem problemSoFar,
                                           RetrievalResults casesUnderConsideration,
                                           CCBRDomain domain)
Specified by:
getNextFeatureKeyImpl in class AbstractConversationBlockSelector

countFrequencies

protected edu.indiana.iucbrf.ccbr.conversationblock.selector.FrequencyConversationBlockSelector.FrequencyCounter countFrequencies(Problem problemSoFar,
                                                                                                                                  RetrievalResults casesUnderConsideration)

getFeatureKeyOrdering

public java.util.ArrayList getFeatureKeyOrdering(Problem problemSoFar,
                                                 RetrievalResults casesUnderConsideration)

reset

public void reset()
Description copied from interface: ConversationBlockSelector
Reset the state of the conversation block selector, to prepare for a new conversation. For some conversation block selectors, this may be a dummy operation.

Specified by:
reset in interface ConversationBlockSelector

initConversationImpl

protected void initConversationImpl(Problem initialProblem)
Specified by:
initConversationImpl in class AbstractConversationBlockSelector

toSwing

public javax.swing.JComponent toSwing(Domain domain)
Specified by:
toSwing in interface SwingRepresentableWithDomain

toSwing

public javax.swing.JComponent toSwing(int detailLevel)
Description copied from interface: SwingRepresentable
Detail level may be ignored by implementations. If used, the standard is for detailLevel 0 to be least detail, with higher values growing more detailed. 0 is least detail, higher numbers are more

Specified by:
toSwing in interface SwingRepresentable

makeSuggestions

public SuggestionSet makeSuggestions(java.lang.Object[] args,
                                     double totalStrength)
By default, a conversation block selector as an ensemble member gives all its strength to its single greatest suggestion.

Specified by:
makeSuggestions in interface EnsembleMember
Parameters:
args - The arguments take the following form:
args[0] is Problem problemSoFar
args[1] is RetrievalResults casesUnderConsideration
args[2] is CCBRDomain domain
totalStrength - The total amount of strength that this ensemble member may divide among its suggestions. The simplest case has each ensemble member with totalStrength = 1.0, giving all its strength to its single strongest suggestion.

decisionMade

public void decisionMade(java.lang.Object decision)
The decision indicates the key chosen by the ensemble.

Specified by:
decisionMade in interface EnsembleMember