Question: ` ` ` # TASK 2 . 3 # Complete the update _ q _ table function ( in Task 2 . 3 ) #
# TASK
# Complete the updateqtable function in Task
# This function will be called from the qlearning function
# Inputs:
# qtable, rtable, currentstateindex, action, nextstateindex, alpha gamma
# Outputs:
# qtable: with updated Q values
def updateqtableqtable, rtable, currentstateindex, action, nextstateindex, alpha gamma:
bestnextaction npargmaxqtablenextstateindex
tdtarget rtablecurrentstateindexaction gamma qtablenextstateindexbestnextaction
tderror tdtarget qtablecurrentstateindexaction
qtablecurrentstateindexaction alpha tderror
return qtable
Task Points Test updateqtable function
Test Failed: unsupported operand types for divmod: 'tuple' and 'int'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
