gov.sandia.cognition.framework.lite
Class ArrayBasedCognitiveModelInput

java.lang.Object
  extended by gov.sandia.cognition.framework.lite.ArrayBasedCognitiveModelInput
All Implemented Interfaces:
CognitiveModelInput, Serializable

public class ArrayBasedCognitiveModelInput
extends Object
implements CognitiveModelInput, Serializable

The ArrayBasedCognitiveModelInput class implements a CognitiveModelInput that is used by the ArrayBasedPerceptionModule. As its name implies, it is implemented by having two arrays underneath. The two arrays must be of the same length. The first array is the array of the SemanticIdentifiers to use as inputs and the second is the array of activation values for those identifiers.

Since:
1.0
Author:
Justin Basilico
See Also:
Serialized Form

Constructor Summary
ArrayBasedCognitiveModelInput(SemanticIdentifier[] identifiers, double[] values)
          Creates a new instance of ArrayBasedCognitiveModelInput using the two given arrays underneath by copying them.
ArrayBasedCognitiveModelInput(SemanticIdentifier[] identifiers, double[] values, boolean copy)
          Creates a new instance of ArrayBasedCognitiveModelInput using the two given arrays underneath.
 
Method Summary
 SemanticIdentifier getIdentifier(int index)
          Gets the SemanticIdentifier of the given index in the array.
protected  SemanticIdentifier[] getIdentifiers()
          Gets the array of identifiers.
 int getNumInputs()
          Gets the number of inputs in the array.
 double getValue(int index)
          Gets the activation value of the given index in the array.
protected  double[] getValues()
          Gets the array of activation values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayBasedCognitiveModelInput

public ArrayBasedCognitiveModelInput(SemanticIdentifier[] identifiers,
                                     double[] values)
Creates a new instance of ArrayBasedCognitiveModelInput using the two given arrays underneath by copying them.

Parameters:
identifiers - The array of identifiers.
values - The array of values.

ArrayBasedCognitiveModelInput

public ArrayBasedCognitiveModelInput(SemanticIdentifier[] identifiers,
                                     double[] values,
                                     boolean copy)
Creates a new instance of ArrayBasedCognitiveModelInput using the two given arrays underneath.

Parameters:
identifiers - The array of identifiers.
values - The array of values.
copy - True to copy the given arrays and false to just use references to them.
Method Detail

getIdentifier

public SemanticIdentifier getIdentifier(int index)
Gets the SemanticIdentifier of the given index in the array.

Parameters:
index - The index of the SemanticIdentifier to get from the array.
Returns:
The SemanticIdentifier at the given index.

getValue

public double getValue(int index)
Gets the activation value of the given index in the array.

Parameters:
index - The index of the activation value to get from the array.
Returns:
The activation value at the given index.

getNumInputs

public int getNumInputs()
Gets the number of inputs in the array.

Returns:
The number of inputs in the array.

getIdentifiers

protected final SemanticIdentifier[] getIdentifiers()
Gets the array of identifiers.

Returns:
The array of identifiers.

getValues

protected final double[] getValues()
Gets the array of activation values.

Returns:
The array of activation values.