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 non terminal.
public UpdateState ( int previousState, int previousAction, double reward, int nextState, int nextAction ) : 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.
nextState int Next state.
nextAction int Next action.
Результат void
        public void UpdateState( int previousState, int previousAction, double reward, int nextState, int nextAction )
        {
            // 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 + discountFactor * 
                                                           qvalues[nextState][nextAction] ) );

        }

Same methods

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