gov.sandia.cognition.framework.lite
Class CognitiveModelLiteState

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

public class CognitiveModelLiteState
extends AbstractCloneableSerializable
implements CognitiveModelState

The CognitiveModelLiteState class implements a CognitiveModelState object for the CognitiveModelLite.

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

Constructor Summary
CognitiveModelLiteState(CognitiveModelLiteState other)
          Creates a new copy of a CognitiveModelLiteState.
CognitiveModelLiteState(int numModules)
          Creates a new instance of CognitiveModelState.
CognitiveModelLiteState(int numModules, int expectedMaxIdentifier)
          Creates a new instance of CognitiveModelState.
 
Method Summary
 void clear()
          Clears this CognitiveModelLite state, resetting it to being uninitialized.
 CognitiveModelLiteState clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 CogxelStateLite getCogxels()
          Gets the CogxelState.
 CognitiveModelInput getInput()
          Gets the input to the model for this state.
 Collection<CognitiveModuleState> getModuleStates()
          Gets the collection of module states.
 CognitiveModuleState[] getModuleStatesArray()
          Gets the module states array.
 int getNumModuleStates()
          Returns the number of module states in this model state.
 boolean isInitialized()
          Returns true if the state has been initialized.
protected  void setCogxels(CogxelStateLite cogxels)
          Setter for cogxels
 void setInitialized(boolean initialized)
          Sets whether or not this state has been initialized.
 void setInput(CognitiveModelInput input)
          Sets the input for this model state.
protected  void setModuleStatesArray(CognitiveModuleState[] moduleStatesArray)
          Sets the array of module states.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CognitiveModelLiteState

public CognitiveModelLiteState(int numModules)
Creates a new instance of CognitiveModelState.

Parameters:
numModules - The number of modules in the model.

CognitiveModelLiteState

public CognitiveModelLiteState(int numModules,
                               int expectedMaxIdentifier)
Creates a new instance of CognitiveModelState.

Parameters:
numModules - The number of modules in the model.
expectedMaxIdentifier - The expected maximum identifier.

CognitiveModelLiteState

public CognitiveModelLiteState(CognitiveModelLiteState other)
Creates a new copy of a CognitiveModelLiteState.

Parameters:
other - The CognitiveModelLiteState to copy.
Method Detail

clone

public CognitiveModelLiteState 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 CognitiveModelState
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

clear

public void clear()
Clears this CognitiveModelLite state, resetting it to being uninitialized.


getInput

public CognitiveModelInput getInput()
Gets the input to the model for this state.

Specified by:
getInput in interface CognitiveModelState
Returns:
The model input.

getCogxels

public CogxelStateLite getCogxels()
Gets the CogxelState.

Specified by:
getCogxels in interface CognitiveModelState
Returns:
The current state of the Cogxels.

getModuleStates

public Collection<CognitiveModuleState> getModuleStates()
Gets the collection of module states.

Specified by:
getModuleStates in interface CognitiveModelState
Returns:
The collection of module states.

getNumModuleStates

public int getNumModuleStates()
Returns the number of module states in this model state. This includes the null states. It should be equal to the number of states in the model from which it was created.

Returns:
The number of module states in this model state.

isInitialized

public boolean isInitialized()
Returns true if the state has been initialized.

Returns:
True if the state has been initialized.

setInitialized

public void setInitialized(boolean initialized)
Sets whether or not this state has been initialized.

Parameters:
initialized - True if the state has been initialized.

setInput

public void setInput(CognitiveModelInput input)
Sets the input for this model state.

Specified by:
setInput in interface CognitiveModelState
Parameters:
input - The new input.

setCogxels

protected void setCogxels(CogxelStateLite cogxels)
Setter for cogxels

Parameters:
cogxels - The state of the Cogxels.

getModuleStatesArray

public CognitiveModuleState[] getModuleStatesArray()
Gets the module states array.

Returns:
The array containing module states.

setModuleStatesArray

protected void setModuleStatesArray(CognitiveModuleState[] moduleStatesArray)
Sets the array of module states.

Parameters:
moduleStatesArray - The new array of module states.