double weight = output.getData(0);
if (Math.abs(weight) > this.minWeight) {
weight = (Math.abs(weight) - this.minWeight) * c
* Math.signum(weight);
linkList.add(new NEATLink(source.getId(), target.getId(),
weight));
}
}
// now create biased links
input.clear();
final int d = substrate.getDimensions();
final List<SubstrateNode> biasedNodes = substrate.getBiasedNodes();
for (final SubstrateNode target : biasedNodes) {
for (int i = 0; i < d; i++) {
input.setData(d + i, target.getLocation()[i]);
}
final MLData output = cppn.compute(input);
double biasWeight = output.getData(1);
if (Math.abs(biasWeight) > this.minWeight) {
biasWeight = (Math.abs(biasWeight) - this.minWeight) * c
* Math.signum(biasWeight);
linkList.add(new NEATLink(0, target.getId(), biasWeight));
}
}
// check for invalid neural network
if (linkList.size() == 0) {