gov.sandia.cognition.framework.learning.converter
Class CogxelWeightedInputOutputPairConverter<InputType,OutputType>

java.lang.Object
  extended by gov.sandia.cognition.framework.learning.converter.CogxelWeightedInputOutputPairConverter<InputType,OutputType>
Type Parameters:
InputType - Type of input to convert into the inputs of the InputOutputPairs
OutputType - Type of outputs to convert into the outputs of the InputOutputPairs
All Implemented Interfaces:
CogxelConverter<WeightedInputOutputPair<InputType,OutputType>>, CloneableSerializable, Serializable, Cloneable

public class CogxelWeightedInputOutputPairConverter<InputType,OutputType>
extends Object
implements CogxelConverter<WeightedInputOutputPair<InputType,OutputType>>

A CogxelConverter for creating WeightedInputOutputPairs

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

Constructor Summary
CogxelWeightedInputOutputPairConverter()
          Creates a new instance of CogxelWeightedInputOutputPairConverter
CogxelWeightedInputOutputPairConverter(CogxelConverter<InputType> inputConverter, CogxelConverter<OutputType> outputConverter, CogxelConverter<Double> weightConverter)
          Creates a new instance of CogxelWeightedInputOutputPairConverter
CogxelWeightedInputOutputPairConverter(CogxelWeightedInputOutputPairConverter<InputType,OutputType> other)
          Copy constructor
 
Method Summary
 CogxelWeightedInputOutputPairConverter<InputType,OutputType> clone()
          Creates a new clone (shallow copy) of this object.
 WeightedInputOutputPair<InputType,OutputType> fromCogxels(CogxelState cogxels)
          Converts from a CogxelState object to an object of type DataType.
 CogxelInputOutputPairConverter<InputType,OutputType> getPairConverter()
          Getter for pairConverter
 SemanticIdentifierMap getSemanticIdentifierMap()
          Gets the SemanticIdentifierMap used by this converter.
 CogxelConverter<Double> getWeightConverter()
          Getter for weightConverter
 void setPairConverter(CogxelInputOutputPairConverter<InputType,OutputType> pairConverter)
          Setter for pairConverter
 void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
          Sets the SemanticIdentifierMap that the converter is to use.
 void setWeightConverter(CogxelConverter<Double> weightConverter)
          Setter for weightConverter
 void toCogxels(WeightedInputOutputPair<InputType,OutputType> data, CogxelState cogxels)
          Converts from an object of type DataType to an updated CogxelState.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CogxelWeightedInputOutputPairConverter

public CogxelWeightedInputOutputPairConverter()
Creates a new instance of CogxelWeightedInputOutputPairConverter


CogxelWeightedInputOutputPairConverter

public CogxelWeightedInputOutputPairConverter(CogxelConverter<InputType> inputConverter,
                                              CogxelConverter<OutputType> outputConverter,
                                              CogxelConverter<Double> weightConverter)
Creates a new instance of CogxelWeightedInputOutputPairConverter

Parameters:
inputConverter - Converts Cogxels for the input
outputConverter - Converts Cogxels for the output
weightConverter - Converts the Cogxel for the weight

CogxelWeightedInputOutputPairConverter

public CogxelWeightedInputOutputPairConverter(CogxelWeightedInputOutputPairConverter<InputType,OutputType> other)
Copy constructor

Parameters:
other - Object to clone
Method Detail

clone

public CogxelWeightedInputOutputPairConverter<InputType,OutputType> clone()
Creates a new clone (shallow copy) of this object.

Specified by:
clone in interface CogxelConverter<WeightedInputOutputPair<InputType,OutputType>>
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class Object
Returns:
A new clone (shallow copy) of this object.

getWeightConverter

public CogxelConverter<Double> getWeightConverter()
Getter for weightConverter

Returns:
Adds the weight to the InputOutputPair

setWeightConverter

public void setWeightConverter(CogxelConverter<Double> weightConverter)
Setter for weightConverter

Parameters:
weightConverter - Adds the weight to the InputOutputPair

fromCogxels

public WeightedInputOutputPair<InputType,OutputType> fromCogxels(CogxelState cogxels)
Converts from a CogxelState object to an object of type DataType.

Specified by:
fromCogxels in interface CogxelConverter<WeightedInputOutputPair<InputType,OutputType>>
Parameters:
cogxels - The CogxelState to convert to DataType.
Returns:
An object of DataType extracted from the given CogxelState.

toCogxels

public void toCogxels(WeightedInputOutputPair<InputType,OutputType> data,
                      CogxelState cogxels)
Converts from an object of type DataType to an updated CogxelState.

Specified by:
toCogxels in interface CogxelConverter<WeightedInputOutputPair<InputType,OutputType>>
Parameters:
data - The object to convert into the CogxelState.
cogxels - The CogxelState to update with the converted data.

getPairConverter

public CogxelInputOutputPairConverter<InputType,OutputType> getPairConverter()
Getter for pairConverter

Returns:
Creates the underlying InputOutputPair

setPairConverter

public void setPairConverter(CogxelInputOutputPairConverter<InputType,OutputType> pairConverter)
Setter for pairConverter

Parameters:
pairConverter - Creates the underlying InputOutputPair

getSemanticIdentifierMap

public SemanticIdentifierMap getSemanticIdentifierMap()
Gets the SemanticIdentifierMap used by this converter.

Specified by:
getSemanticIdentifierMap in interface CogxelConverter<WeightedInputOutputPair<InputType,OutputType>>
Returns:
The SemanticIdentifierMap used by this converter.

setSemanticIdentifierMap

public void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
Sets the SemanticIdentifierMap that the converter is to use.

Specified by:
setSemanticIdentifierMap in interface CogxelConverter<WeightedInputOutputPair<InputType,OutputType>>
Parameters:
semanticIdentifierMap - The SemanticIdentifierMap the converter is to use.