Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

path planning using Q learning algorithm

NotificationsYou must be signed in to change notification settings

zaid-24/The-RL-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Grid world as described in the Task is shown below:

grid

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)

Using Gridworld

import gridworld

Then you can create a world object and access various constants and thestep function which is used to move the agent

# 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

Important Notes

  • In the grid world the origin is at the top left corner and the coordinates are specified as (y,x) and not (x,y).
  • You should not make any changes togridworld.py

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp