1
0
mirror of https://github.com/fazo96/AIrium.git synced 2025-01-10 09:34:20 +01:00

crashes workaround. working on better fix

This commit is contained in:
Enrico Fasoli 2015-07-01 17:32:04 +02:00
parent 5d9db86148
commit 4195c08745

View File

@ -94,14 +94,17 @@ public class Brain {
}
public float[][][] mutate(float mutationFactor) {
float[][][] res = new float[neurons.length][neurons[1].length][neurons[1].length];
float[][][] res = new float[neurons.length][][];
for (int i = 0; i < neurons.length; i++) // layers
{
for (int j = 0; i < neurons[i].length; j++) // neurons per layer
res[i] = new float[neurons[i].length][];
for (int j = 0; j < neurons[i].length; j++) // neurons per layer
{
if (neurons[i][j] != null) {
res[i][j] = neurons[i][j].mutate(mutationFactor);
}
}
}
return res;
}