Question: ` ` ` # Global Parameters ( Do not change these parameter names ) STUDENTID = 2 0 2 1 6 2 0 7 0
# Global Parameters Do not change these parameter names
STUDENTID # Enter your student ID You may change this to try different start and goal positions
GRIDSIZE #
ACTIONS DO NOT CHANGE
EPISODES # CHANGE to an appropriate number to ensure agent learns to find the optimal path and that Q table
# Do not change number of episodes parametervariable anywhere else in the code
ALPHA # DO NOT CHANGE
EPSILON # DO NOT CHANGE
GAMMA # DO NOT CHANGE
# TASK Complete the function to get next state based on given action
def getnextstatecurrentstatepos, action, gridsize: # Ensure gridsize is passed
row, column currentstatepos # row and column are integers
if action and row : # Move up
row # Move one row up
elif action and row gridsize : # Move down
row # Move one row down
elif action and column : # Move left
column # Move one column to the left
elif action and column gridsize : # Move right
column # Move one column to the right
return row column # Ensure it returns a tuple of row column
Task I, $ Points Teskgetrext stalef function implemenlation B
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
