package com.github.forhacks.evolve2048;

import java.util.List;

public class WeightNeuron extends Neuron{

    static final double MAX_INIT_WIEGHT = 2;

    public double wieght;

    public WeightNeuron(List<Integer> parents, Layer prev) {
        super(parents, prev);
        wieght = Math.random()*MAX_INIT_WIEGHT;
    }

    @Override
    public void mutate(Layer prev) {
        int n = (int) (Math.random() * prev.neurons.size());
        parents.add(n);

        wieght += Math.random() * 2 * MAX_CHANGE - MAX_CHANGE;
    }

    @Override
    public double[] getData() {
        int parent = parents.get(parents.size()-1);
        double[] parentData = prev.neurons.get(parent).getData();
        double value = parentData[0]*wieght;
        double[] data = new double[]{value, parentData[1], parentData[2], parentData[3], parentData[4]};
        return data;
    }
}

@@ -135,18 +135,18 @@
 X_INIT_W
-I
 E
+I
 GHT = 2;
@@ -166,18 +166,18 @@
 double w
-i
 e
+i
 ght;%0A%0A  
@@ -270,26 +270,26 @@
 );%0A        w
-i
 e
+i
 ght = Math.r
@@ -296,16 +296,17 @@
 andom()*
+ 
 MAX_INIT
@@ -311,10 +311,10 @@
 IT_W
-I
 E
+I
 GHT;
@@ -467,18 +467,18 @@
        w
-i
 e
+i
 ght += M
@@ -733,11 +733,12 @@
 %5B0%5D*
-wie
+ wei
 ght;

Fix spelling @thegithubgeek