GithubHelp home page GithubHelp logo

pathfindingrl's Introduction

Objectives : simulate to find the best path on a 2D grid, using RL Input : a grid of 16x16, 32x32 or 64x64 , it is impossible to do higher grid, but I didnt test . try to keep the grid square or edit a bit the code.

Code :

main.py

  • run the code

declaration.py

simulation specification epoch_max = 70000
gamma = 0.95

simulation reward reward_goal = 100 /reach the goal
reward_preferred = 50 /path which is preferred
reward_crossable = -20 /wall that can be crossed
reward_nothing = 0 / dont change
reward_init = -30 / any tiles

prepare UC

the code allows to prepare csv files which can be uploaded using the Open Command
Check under setup folder for exemple like the one below

line 1: comment
line 2 grid size
line 3 start position
line 4 end position
Line 5 to EOF : gris description (0 = blank, X = Wall , C = crossable wall , P = preferred path)

#header : table UC for grid 32x32
32
3,6
27,27
0,0,0,0,X,0,0,0,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,0,
0,0,0,0,X,0,0,0,0,0,0,0,0,0,0,C,0,0,0,0,0,0,0,C,0,0,0,0,0,0,0,0,
0,0,0,0,X,0,0,P,P,P,P,P,0,0,0,X,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,0,
C,C,C,X,X,0,0,P,X,X,X,P,0,0,0,X,X,X,X,X,X,X,X,X,X,X,C,C,C,X,X,X,
0,0,0,0,X,0,0,P,X,X,X,P,0,0,0,X,P,P,P,P,P,P,P,C,0,0,0,0,0,0,0,0,
0,0,0,0,X,0,0,P,X,X,X,P,0,0,0,X,0,0,0,0,0,0,0,C,0,0,0,0,0,0,0,0,
0,0,0,0,C,0,0,P,X,X,X,P,0,0,0,X,X,X,X,X,X,X,X,X,X,X,C,C,C,X,X,X,
0,0,0,P,X,0,0,P,X,X,X,P,0,0,0,X,P,P,P,P,0,0,0,X,0,0,0,P,0,0,0,0,
0,0,0,P,X,0,0,P,X,X,X,P,0,0,0,X,0,0,0,P,0,0,0,X,0,0,0,P,0,0,0,0,
0,0,0,P,X,0,0,P,P,P,P,P,0,0,0,X,0,0,0,P,0,0,0,C,0,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P,P,P,P,P,P,X,0,0,0,0,0,0,0,0,
0,0,0,P,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,P,X,0,0,0,0,0,0,0,0,
0,0,0,P,X,0,0,0,X,X,X,0,0,0,0,0,0,0,0,0,0,0,P,X,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,P,X,0,0,0,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,0,
0,0,0,P,X,0,0,0,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,X,0,0,0,0,0,0,0,0,

pathfindingrl's People

Contributors

amdsoo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.