public class MutableSemanticMemoryLite extends AbstractSemanticMemoryLite
| Constructor and Description |
|---|
MutableSemanticMemoryLite(SemanticIdentifierMap semanticIdentifierMap,
MutablePatternRecognizerLite recognizer)
Creates a new instance of MutableSemanticMemoryLite.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(SemanticLabel label)
Adds a node to the semantic memory.
|
protected void |
assertArgumentIsNode(SemanticLabel label)
Asserts that the given argument is a node, throwing an
IllegalArgumentException if it is not a node.
|
protected void |
buildInputMapping()
Builds the mapping of identifiers to input indices.
|
int |
findInputIndexForIdentifier(SemanticIdentifier semanticIdentifier)
Finds the input vector index for a given identifier.
|
java.lang.String |
getName()
Gets the human-readable name of module.
|
MutablePatternRecognizerLite |
getSettings()
Gets the pattern recognizer.
|
boolean |
isNode(SemanticLabel label)
Returns true if the given semantic label is a node in the network.
|
void |
removeNode(SemanticLabel label)
Removes a node and all links associated with that node from the semantic
memory.
|
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.
|
buildOutputMapping, getNetwork, getOutputIdentifiers, getRecognizer, getSemanticIdentifierMap, initializeState, updatepublic MutableSemanticMemoryLite(SemanticIdentifierMap semanticIdentifierMap, MutablePatternRecognizerLite recognizer)
semanticIdentifierMap - The SemanticIdentifierMap to use.recognizer - The pattern recognizer to use, which is copied and
stored internally.protected void buildInputMapping()
public int findInputIndexForIdentifier(SemanticIdentifier semanticIdentifier)
findInputIndexForIdentifier in class AbstractSemanticMemoryLitesemanticIdentifier - The identifier to find the input index of.public boolean isNode(SemanticLabel label)
label - The label to look at.public void addNode(SemanticLabel label)
label - The label for the node to add.public void removeNode(SemanticLabel label)
label - The label of the node to remove.public boolean trySetInputLabel(SemanticLabel label, boolean inputLabel)
label - The label to set whether or not it is input label.inputLabel - Whether or not the label is an input label.public boolean trySetOutputLabel(SemanticLabel label, boolean outputLabel)
label - The label to set whether or not it is output label.outputLabel - Whether or not the label is an output label.public void setAssociation(SemanticLabel from, SemanticLabel to, double weight)
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.protected void assertArgumentIsNode(SemanticLabel label)
label - The label to assert that it is a node in the recognizer.java.lang.IllegalArgumentException - If the given label is not a node.public java.lang.String getName()
public MutablePatternRecognizerLite getSettings()