public class AbstractNode extends java.lang.Object implements Node
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
AbstractNode()
Constructor - creates a linear node
|
AbstractNode(DoubleFunction transportFunction,
DoubleFunction derivativeFunction)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
protected int lastPattern
protected double lastInputValue
protected double lastOutputValue
protected int lastDerivativePattern
protected double lastDerivative
protected int order
protected DoubleFunction transportFunction
protected DoubleFunction derivativeFunction
protected java.util.List<Connection> connections
public AbstractNode()
public AbstractNode(DoubleFunction transportFunction, DoubleFunction derivativeFunction)
public double getInputValue(int pattern)
getInputValue
in interface Node
pattern
- the pattern number, 1 for the first patternpublic double getOutputValue(int pattern)
Node
getOutputValue
in interface Node
pattern
- the pattern number, 1 for the first patternpublic double getDerivative(int pattern)
Node
getDerivative
in interface Node
pattern
- the pattern number, 1 for the first patternpublic void setOrder(int order)
public int calculateOrder()
public java.util.List<Connection> getConnections()
getConnections
in interface Node
public javax.swing.tree.MutableTreeNode getTreeNode()
getTreeNode
in interface Node
Submit Feedback to pmarrone@users.sourceforge.net