org.joone.structure
Class AbstractNode

java.lang.Object
  extended by org.joone.structure.AbstractNode
All Implemented Interfaces:
Node
Direct Known Subclasses:
ContextNode, InputNode

public class AbstractNode
extends java.lang.Object
implements Node

An abstract node class, used to represent a general node type.

Author:
mg

Field Summary
protected  java.util.List<Connection> connections
          List of input connections
protected  DoubleFunction derivativeFunction
          The function that calculates the derivative
protected  double lastDerivative
          The derivative value at the last pattern
protected  int lastDerivativePattern
          Last pattern at which derivative was calculated
protected  double lastInputValue
          The calculated input value at this pattern
protected  double lastOutputValue
          The calculated output value at this pattern
protected  int lastPattern
          The most recent pattern number seen
protected  int order
          The node order
protected  DoubleFunction transportFunction
          The function that transforms the input into the output value
 
Constructor Summary
AbstractNode()
          Constructor - creates a linear node
AbstractNode(DoubleFunction transportFunction, DoubleFunction derivativeFunction)
          Constructor
 
Method Summary
 int calculateOrder()
          Calculate and set the node's order and return it, or 0 if it was not able to calculate it yet
 java.util.List<Connection> getConnections()
          Retrieve the list of connections that fire into this node
 double getDerivative(int pattern)
          The node's current derivative value
 double getInputValue(int pattern)
          The node's input value at the given pattern number
 int getOrder()
          The node's order
 double getOutputValue(int pattern)
          The node's current output value
 javax.swing.tree.MutableTreeNode getTreeNode()
          Return a suitable treeview description of the node
 void setOrder(int order)
          Set the node's order
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastPattern

protected int lastPattern
The most recent pattern number seen


lastInputValue

protected double lastInputValue
The calculated input value at this pattern


lastOutputValue

protected double lastOutputValue
The calculated output value at this pattern


lastDerivativePattern

protected int lastDerivativePattern
Last pattern at which derivative was calculated


lastDerivative

protected double lastDerivative
The derivative value at the last pattern


order

protected int order
The node order


transportFunction

protected DoubleFunction transportFunction
The function that transforms the input into the output value


derivativeFunction

protected DoubleFunction derivativeFunction
The function that calculates the derivative


connections

protected java.util.List<Connection> connections
List of input connections

Constructor Detail

AbstractNode

public AbstractNode()
Constructor - creates a linear node


AbstractNode

public AbstractNode(DoubleFunction transportFunction,
                    DoubleFunction derivativeFunction)
Constructor

Method Detail

getInputValue

public double getInputValue(int pattern)
The node's input value at the given pattern number

Specified by:
getInputValue in interface Node
Parameters:
pattern - the pattern number, 1 for the first pattern

getOutputValue

public double getOutputValue(int pattern)
Description copied from interface: Node
The node's current output value

Specified by:
getOutputValue in interface Node
Parameters:
pattern - the pattern number, 1 for the first pattern

getDerivative

public double getDerivative(int pattern)
Description copied from interface: Node
The node's current derivative value

Specified by:
getDerivative in interface Node
Parameters:
pattern - the pattern number, 1 for the first pattern

getOrder

public int getOrder()
The node's order

Specified by:
getOrder in interface Node

setOrder

public void setOrder(int order)
Set the node's order


calculateOrder

public int calculateOrder()
Calculate and set the node's order and return it, or 0 if it was not able to calculate it yet


getConnections

public java.util.List<Connection> getConnections()
Retrieve the list of connections that fire into this node

Specified by:
getConnections in interface Node

getTreeNode

public javax.swing.tree.MutableTreeNode getTreeNode()
Return a suitable treeview description of the node

Specified by:
getTreeNode in interface Node


Submit Feedback to pmarrone@users.sourceforge.net