social_learning.QLearningAgent.activateNetwork C# (CSharp) Method

activateNetwork() public method

Called at every step in the world. Given the sensor input, returns the change in orientation and velocity in the range [0,1].
public activateNetwork ( double sensors ) : ISignalArray
sensors double
return ISignalArray
        public override ISignalArray activateNetwork(double[] sensors)
        {
            // Update the value function for the previously-chosen actions
            updateValueFunction(sensors);

            // Select the actions to take
            _prevState = selectEpsilonGreedy(sensors);

            // Return the result
            var results = new SignalArray(new double[] { _prevState[_prevState.Length - 2], _prevState[_prevState.Length - 1] }, 0, 2);

            //Console.WriteLine("Selecting: ({0},{1})", results[0], results[1]);
            
            return results;
        }