Ejemplo n.º 1
0
    public float GetActivation(float[] inputs)
    {
        if (type == TYPE.SENSOR)
        {
            return(inputs[id - 1]);
        }

        else
        {
            float summedActivation = 0;
            foreach (NodeGene node in directInNodes.Keys)
            {
                ConnectionGene connectionIn = directInNodes[node];

                summedActivation += (connectionIn.getExpressed())? node.GetActivation(inputs) * connectionIn.getWeight() : 0;
            }

            return(History.Sigmoid(summedActivation));
        }
    }