*/
@Override
protected void updateNetworkWeights(double[] patternError) {
int i = 0;
for(Neuron outputNeuron : neuralNetwork.getOutputNeurons()) {
ThresholdNeuron neuron = (ThresholdNeuron)outputNeuron;
double outputError = patternError[i];
double thresh = neuron.getThresh();
double netInput = neuron.getNetInput();
double threshError = thresh - netInput; // distance from zero
// use output error to decide weathet to inrease, decrase or leave unchanged weights
// add errorCorrection to threshError to move above or below zero
double neuronError = outputError * (Math.abs(threshError) + errorCorrection);
// use same adjustment principle as PerceptronLearning,
// just with different neuronError
neuron.setError(neuronError);
updateNeuronWeights(neuron);
i++;
} // for
}