updateQsecondState: Update Q-values at Second State

Description Usage Arguments Value

View source: R/Q.R

Description

This function takes the Q$stateActionPair dataframe initialized in the background and filters it to pull the Q-table index that matches the state-action pair. It then updates the Q-value according to the Q-learning algorithm.

Usage

1
updateQsecondState(state, action, alpha, gamma)

Arguments

state

The state the agent is currently in.

action

The action (right or left) an agent performs.

alpha

The learning rate alpha.

gamma

The temporal discounting factor gamma.

Value

Updated second state Q-value


jdtrat/dynaq documentation built on July 24, 2020, 7:18 a.m.