public class WeightedNode
extends java.lang.Object
| Constructor and Description |
|---|
WeightedNode(int p_index,
double p_target,
double p_weight)
Creates a new weighted node with a set index, weight and target.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustWeightByDeviation(double p_output)
Adjusts the weight of this node such that its weight multiplied by the given output is exactly equal to the target.
|
double |
getDeviation(double p_output)
Returns the difference between the weight-adjusted output neuron value and the internally stored target.
|
int |
getIndex()
Returns the current index of this node.
|
double |
getTarget()
Returns the current target value, between 0 and 1, of this weighted node.
|
double |
getWeight()
Returns the weight this node currently holds.
|
void |
setIndex(int p_index)
Sets the index number of this node.
|
void |
setTarget(double p_target)
Sets the target value, from which error is calculated
|
void |
setWeight(double p_weight)
Sets the weight of this node, by which the output of the net will be multiplied in order to fin its true output.
|
java.lang.String |
toString()
Returns this node represented as a string.
|
public WeightedNode(int p_index,
double p_target,
double p_weight)
p_index - The index number of the nodep_target - The target value of the node, initially 0p_weight - The weight value of the node, initially 1 to preserver net outputpublic void setTarget(double p_target)
p_target - The value to set as a target, from 0 to 1 inclusiveValueOutOfBoundsException - Thrown in the event that the value given in outside of the permissable rangepublic double getTarget()
public void setIndex(int p_index)
p_index - the index to set this node to.public int getIndex()
public void setWeight(double p_weight)
p_weight - The weight to setpublic double getWeight()
public double getDeviation(double p_output)
p_output - The output neuron's valuepublic void adjustWeightByDeviation(double p_output)
p_output - The output from the net stack which matches this node's index number.public java.lang.String toString()
toString in class java.lang.Object