social_learning.QLearningAgent.greedyValue C# (CSharp) Method

greedyValue() private method

private greedyValue ( double sensors ) : double
sensors double
return double
        private double greedyValue(double[] sensors)
        {
            double[] stateActionPair = new double[sensors.Length + 2];
            sensors.CopyTo(stateActionPair, 0);
            double max = -1;

            for (int i = 0; i < _numOrientationActions; i++)
                for (int j = 0; j < _numVelocityActions; j++)
                {
                    stateActionPair[stateActionPair.Length - 2] = i / (double)(_numOrientationActions-1);
                    stateActionPair[stateActionPair.Length - 1] = j / (double)(_numVelocityActions-1);
                    double value = base.activateNetwork(stateActionPair)[0];
                    if (value > max)
                        max = value;
                }

            return max;
        }