AForge.MachineLearning.Sarsa.UpdateState C# (CSharp) Метод

UpdateState() публичный Метод

Update Q-function's value for the previous state-action pair.
Updates Q-function's value for the previous state-action pair in the case if the next state is terminal.
public UpdateState ( int previousState, int previousAction, double reward ) : void
previousState int Curren state.
previousAction int Action, which lead from previous to the next state.
reward double Reward value, received by taking specified action from previous state.
Результат void
        public void UpdateState( int previousState, int previousAction, double reward )
        {
            // previous state's action estimations
            double[] previousActionEstimations = qvalues[previousState];
            // update expexted summary reward of the previous state
            previousActionEstimations[previousAction] *= ( 1.0 - learningRate );
            previousActionEstimations[previousAction] += ( learningRate * reward );
        }
    }

Same methods

Sarsa::UpdateState ( int previousState, int previousAction, double reward, int nextState, int nextAction ) : void