You are required to write a program to move the agent to the goal. To use the gridworld, importgridworld.py
(your script should be in the same directory asgridworld.py
)
# create a world objectworld = gridworld.GridWorld()# access Height and Widthprint(world.WORLD_WIDTH)print(world.WORLD_HEIGHT)# access the obstaclesprint(wolrd.obstacles)# access start and goal positionprint(world.START)print(world.GOAL)# access the actions, for others see gridworld.pyprint(world.ACTION_UP)# run the step functionpresent_state = world.STARTnext_state, reward = world.step(present_state, world.ACTION_UP)print(next_state)print(reward)output1510[[2, 3], [3, 3], [7, 3], [8, 3], [9, 3], [7, 8], [8, 8], [9, 8]][6, 1][8, 11]0[5, 0]-1