gov.sandia.cognition.framework.lite
Class VectorBasedCognitiveModelInput

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.framework.lite.VectorBasedCognitiveModelInput
All Implemented Interfaces:
CognitiveModelInput, CloneableSerializable, Serializable, Cloneable

public class VectorBasedCognitiveModelInput
extends AbstractCloneableSerializable
implements CognitiveModelInput

Vector-based cognitive model input used by VectorBasedPerceptionModule. This class associates SemanticSdentifiers with elements in a Vector.

Since:
1.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
VectorBasedCognitiveModelInput(SemanticIdentifier[] identifiers, Vector values)
          Creates a new instance of VectorBasedCognitiveModelInput
VectorBasedCognitiveModelInput(VectorBasedCognitiveModelInput other)
          Copy Constructor
 
Method Summary
 VectorBasedCognitiveModelInput clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 SemanticIdentifier getIdentifier(int index)
          Gets the SemanticIdentifier of the given index in the array.
protected  SemanticIdentifier[] getIdentifiers()
          Getter for identifiers
 int getNumInputs()
          Gets the number of inputs in the array.
 Vector getValues()
          Getter for values
protected  void setIdentifiers(SemanticIdentifier[] identifiers)
          Setter for identifiers
protected  void setValues(Vector values)
          Setter for values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorBasedCognitiveModelInput

public VectorBasedCognitiveModelInput(SemanticIdentifier[] identifiers,
                                      Vector values)
Creates a new instance of VectorBasedCognitiveModelInput

Parameters:
identifiers - Identifiers to use associate with the inputs
values - Activation values of the inputs, must have the same number of semantic identifiers as elements in the vector

VectorBasedCognitiveModelInput

public VectorBasedCognitiveModelInput(VectorBasedCognitiveModelInput other)
Copy Constructor

Parameters:
other - VectorBasedCognitiveModelInput to clone
Method Detail

clone

public VectorBasedCognitiveModelInput clone()
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

getIdentifiers

protected SemanticIdentifier[] getIdentifiers()
Getter for identifiers

Returns:
Identifiers to use associate with the inputs

setIdentifiers

protected void setIdentifiers(SemanticIdentifier[] identifiers)
Setter for identifiers

Parameters:
identifiers - Identifiers to use associate with the inputs

getValues

public Vector getValues()
Getter for values

Returns:
Activation values of the inputs

setValues

protected void setValues(Vector values)
Setter for values

Parameters:
values - Activation values of the inputs

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.

getNumInputs

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

Returns:
The number of inputs in the array.