Class MetastateVector

java.lang.Object
  |
  +--MetastateVector

public class MetastateVector
extends java.lang.Object

A Metastate vector represents the 15 dimensions of the character model based on the 5 aggregates.

See Also:
MetastateAttributes

Field Summary
static int METASTATE_VECTOR_SIZE
          A metastate vector has a fixed size of METASTATE_VECTOR_SIZE (= 15).
 
Constructor Summary
MetastateVector()
          Creates a new MetastateVector.
MetastateVector(float[] x)
          Creates a new MetastateVector.
 
Method Summary
 void add(float x)
          Adds the value of given float to the current MetastateVector.
 void add(MetastateVector mv)
          Adds the values of given MetastateVector to the current values.
 float[] getValues()
          Returns the values of the MetastateVector.
 float length()
          Calculates and returns the length of the MetastateVector.
 void multiply(float x)
          Multiplies the value of given float with the current MetastateVector.
 void multiply(MetastateVector mv)
          Multiplies (dot product) the values of given MetastateVector with the current values.
 void normalize()
          Normalizes the MetastateVector.
 void subtract(float x)
          Subtracts the value of given float from the current MetastateVector.
 void subtract(MetastateVector mv)
          Subtracts the values of given MetastateVector from the current values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METASTATE_VECTOR_SIZE

public static final int METASTATE_VECTOR_SIZE
A metastate vector has a fixed size of METASTATE_VECTOR_SIZE (= 15).
Constructor Detail

MetastateVector

public MetastateVector()
Creates a new MetastateVector. All values are set to zero.

MetastateVector

public MetastateVector(float[] x)
Creates a new MetastateVector. The vector is initialized using the given parameter.
Parameters:
x - initial metastate values
Method Detail

getValues

public float[] getValues()
Returns the values of the MetastateVector.

add

public void add(float x)
Adds the value of given float to the current MetastateVector.
Parameters:
x - value to be added to the vector

add

public void add(MetastateVector mv)
Adds the values of given MetastateVector to the current values.
Parameters:
mv - MetastateVector holding the values to be added to this one

subtract

public void subtract(float x)
Subtracts the value of given float from the current MetastateVector.
Parameters:
x - value to be subtracted from the vector

subtract

public void subtract(MetastateVector mv)
Subtracts the values of given MetastateVector from the current values.
Parameters:
mv - MetastateVector holding the values to be subtracted from this one

multiply

public void multiply(float x)
Multiplies the value of given float with the current MetastateVector.
Parameters:
x - value to be multiplicated with the vector

multiply

public void multiply(MetastateVector mv)
Multiplies (dot product) the values of given MetastateVector with the current values.
Parameters:
mv - MetastateVector holding the values to be multiplicated with this one

length

public float length()
Calculates and returns the length of the MetastateVector.

normalize

public void normalize()
Normalizes the MetastateVector. This means that the values of the MetatstateVector are divided by the length of the vector.