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

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

public class RandomConversationBlockSelector
extends AbstractConversationBlockSelector
implements EnsembleMember

Randomly chooses a feature to question next.

See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList allKeys
           
protected  java.util.LinkedList unknownFeatureKeys
           
 
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
RandomConversationBlockSelector(CCBRDomain domain)
          Creates a new instance of RandomConversationBlockSelector
 
Method Summary
 void decisionMade(java.lang.Object decision)
          The decision indicates the key chosen by the ensemble, so don't consider that key again.
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
 

Field Detail

allKeys

protected java.util.ArrayList allKeys

unknownFeatureKeys

protected java.util.LinkedList unknownFeatureKeys
Constructor Detail

RandomConversationBlockSelector

public RandomConversationBlockSelector(CCBRDomain domain)
Creates a new instance of RandomConversationBlockSelector

Method Detail

getNextFeatureKeyImpl

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

reset

public void reset()
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)
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, so don't consider that key again.

Specified by:
decisionMade in interface EnsembleMember