gov.sandia.cognition.framework.lite
Interface MutablePatternRecognizerLite

All Superinterfaces:
Cloneable, CloneableSerializable, CognitiveModuleSettings, PatternRecognizerLite, Serializable
All Known Implementing Classes:
SimplePatternRecognizer

public interface MutablePatternRecognizerLite
extends PatternRecognizerLite

The MutablePatternRecognizerLite interface extends the PatternRecognizerLite interface to add methods for changing the recognizer dynamically.

Since:
1.0
Author:
Justin Basilico, Kevin R. Dixon

Method Summary
 void addNode(SemanticLabel label)
          Adds a node to the pattern recognizer.
 void removeNode(SemanticLabel label)
          Removes a node and all links associated with that node from the pattern recognizer.
 void setAssociation(SemanticLabel from, SemanticLabel to, double weight)
          Sets the association between nodes in the recognizer.
 boolean trySetInputLabel(SemanticLabel label, boolean inputLabel)
          Attempts to set whether or not the given label is an input label.
 boolean trySetOutputLabel(SemanticLabel label, boolean outputLabel)
          Attempts to set whether or not the given label is an output label.
 
Methods inherited from interface gov.sandia.cognition.framework.lite.PatternRecognizerLite
clone, createEmptyInputVector, getAllLabels, getInputDimensionality, getInputLabels, getNetwork, getOutputDimensionality, getOutputLabels, initialState, isInputLabel, isLabel, isOutputLabel, recognize
 

Method Detail

addNode

void addNode(SemanticLabel label)
Adds a node to the pattern recognizer.

Parameters:
label - The label for the node to add.

removeNode

void removeNode(SemanticLabel label)
Removes a node and all links associated with that node from the pattern recognizer. The node's entry in the vector is assumed to be removed so that the vector is now one dimension shorter.

Parameters:
label - The label of the node to remove.

setAssociation

void setAssociation(SemanticLabel from,
                    SemanticLabel to,
                    double weight)
Sets the association between nodes in the recognizer.

Parameters:
from - The label of the node the assocation is from.
to - The label of the node the assocation is to.
weight - The weight of the association.

trySetInputLabel

boolean trySetInputLabel(SemanticLabel label,
                         boolean inputLabel)
Attempts to set whether or not the given label is an input label. It returns true if the set operation was successful and false otherwise.

Parameters:
label - The label to set whether or not it is input label.
inputLabel - Whether or not the label is an input label.
Returns:
True if the operation was successful and false if it was not.

trySetOutputLabel

boolean trySetOutputLabel(SemanticLabel label,
                          boolean outputLabel)
Attempts to set whether or not the given label is an output label. It returns true if the set operation was successful and false otherwise.

Parameters:
label - The label to set whether or not it is output label.
outputLabel - Whether or not the label is an output label.
Returns:
True if the operation was successful and false if it was not.