Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jchrest.architecture
Class Stm

    java.lang.Object
      jchrest.architecture.Stm

All Implemented Interfaces:
  java.lang.Iterable<Node>

    public class Stm

extends java.lang.Object
implements java.lang.Iterable<Node>

Class manages the short-term memory for one modality of a Chrest model. Each short-term memory has a maximum capacity, and stores a list of nodes.

Constructor Summary
`Stm(int size)` Constructor requires the maximum capacity to be set.

Method Summary
`void` | `add(Node node)` When adding a new node to STM, the new node is added to the top of STM with the queue cut at the bottom to keep STM to the fixed size constraints.
`void` | `clear()` Remove all items from STM.
`int` | `getCount()` Return a count of how many items are actually in the short-term memory.
`Node` | `getItem(int index)` Retrieve a node within the short-term memory by its index position.
`int` | `getSize()` Accessor for the maximum capacity.
`java.util.Iterator<Node>` | `iterator()` Support iteration over the nodes in STM.
`void` | `learnLateralLinks(Chrest model)` Add a lateral link indicating that the second node in this STM is followed by the top node.
`void` | `replaceHypothesis(Node node)` Replace the topmost (hypothesis) node with the given one.
`void` | `setSize(int size)` Alter the maximum capacity.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Stm

    public Stm(int size)

  Constructor requires the maximum capacity to be set.

Method Detail

### getSize

    public int getSize()

  Accessor for the maximum capacity.

### setSize

    public void setSize(int size)

  Alter the maximum capacity. When the size is changed, all items in the short-term memory are cleared.

### getCount

    public int getCount()

  Return a count of how many items are actually in the short-term memory.

### getItem

    public Node getItem(int index)

  Retrieve a node within the short-term memory by its index position. There is no error checking on the retrieval.

### add

    public void add(Node node)

  When adding a new node to STM, the new node is added to the top of STM with the queue cut at the bottom to keep STM to the fixed size constraints. However, the most informative node is maintained in the list, by readding it to the end of the list, if lost.

### replaceHypothesis

    public void replaceHypothesis(Node node)

  Replace the topmost (hypothesis) node with the given one.

### clear

    public void clear()

  Remove all items from STM.

### learnLateralLinks

    public void learnLateralLinks(Chrest model)

  Add a lateral link indicating that the second node in this STM is followed by the top node. The link is only added if not already present, and the model's clock is advanced by the time to add a link.

### iterator

    public java.util.Iterator<Node> iterator()

  Support iteration over the nodes in STM.

  Specified by:
    `iterator` in interface `java.lang.Iterable<Node>`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD