com.anji.nn
Class Pattern

java.lang.Object
  extended bycom.anji.nn.Pattern

public class Pattern
extends java.lang.Object

Converts double array stimuli to Connection objects.

Author:
Philip Tucker

Field Summary
protected  double[] values
          protected visibility increases performance of PatternConnection.read()
static java.lang.String XML_TAG
          base XML tag
 
Constructor Summary
Pattern(double[] aValues)
          Create Pattern with aValues as inputs.
Pattern(int dimension)
          Create Pattern with dimension inputs.
 
Method Summary
 void clear()
          set values to 0
 Connection getConnection(int idx)
          Get connection to stimulus idx.
 int getDimension()
           
 void setValue(int idx, double value)
          Set stimulus value at idx to value.
 void setValues(double[] someValues)
          Set stimulus values.
 java.lang.String toString()
           
 java.lang.String toXml()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_TAG

public static final java.lang.String XML_TAG
base XML tag

See Also:
Constant Field Values

values

protected double[] values
protected visibility increases performance of PatternConnection.read()

Constructor Detail

Pattern

public Pattern(int dimension)
        throws java.lang.IllegalArgumentException
Create Pattern with dimension inputs. This ctor should be called if Pattern object is to manage array of values.

Parameters:
dimension -
Throws:
java.lang.IllegalArgumentException

Pattern

public Pattern(double[] aValues)
        throws java.lang.IllegalArgumentException
Create Pattern with aValues as inputs. This ctor should be called if caller is to manager array of values;

Parameters:
aValues -
Throws:
java.lang.IllegalArgumentException
Method Detail

clear

public void clear()
set values to 0


setValues

public void setValues(double[] someValues)
               throws java.lang.IllegalArgumentException
Set stimulus values.

Parameters:
someValues -
Throws:
java.lang.IllegalArgumentException

setValue

public void setValue(int idx,
                     double value)
              throws java.lang.IllegalArgumentException
Set stimulus value at idx to value.

Parameters:
idx -
value -
Throws:
java.lang.IllegalArgumentException

getConnection

public Connection getConnection(int idx)
                         throws java.lang.IllegalArgumentException
Get connection to stimulus idx.

Parameters:
idx -
Returns:
Connection
Throws:
java.lang.IllegalArgumentException

getDimension

public int getDimension()
Returns:
int dimension of stimuli

toString

public java.lang.String toString()
See Also:
Object.toString()

toXml

public java.lang.String toXml()
Returns:
String XML respresentation of object