public class Connection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected double |
delta
The accumulated delta of the weight.
|
protected boolean |
fixed
True if this is a fixed connection
|
protected Node |
node
The node from which this connection originates
|
protected double |
weight
The weight of this connection
|
Constructor and Description |
---|
Connection(Node node,
double weight,
boolean fixed)
Create a new connection
|
Modifier and Type | Method and Description |
---|---|
double |
getDelta()
Retrieve the current delta
|
Node |
getNode()
Retrieve the node
|
double |
getOutputValue(int pattern)
Retrieve the output value of this connection.
|
double |
getWeight()
Retrieve the weight
|
boolean |
isFixed()
See if this is a fixed weight connection
|
void |
setDelta(double delta)
Set the delta
|
void |
setWeight(double weight)
Set the weight to a new value unless it is fixed
|
void |
updateDelta(double increment)
Add the given increment amount to the delta
|
void |
updateWeight()
Update the weight - if it is not fixed - by adding the internal delta to it
and also resets that delta to zero afterwards.
|
void |
updateWeight(double delta)
Update the weight - if it is not fixed - by adding the given delta to it
|
protected Node node
protected double weight
protected double delta
protected boolean fixed
public Connection(Node node, double weight, boolean fixed)
node
- node from which this linksweight
- weight attached to the nodefixed
- if true, then this weight is fixed and can not be changedpublic Node getNode()
public double getWeight()
public double getDelta()
public boolean isFixed()
public double getOutputValue(int pattern)
pattern
- pattern numberpublic void setWeight(double weight)
public void updateWeight(double delta)
public void updateWeight()
public void setDelta(double delta)
public void updateDelta(double increment)
Submit Feedback to pmarrone@users.sourceforge.net