Git Product home page Git Product logo

snakeai's Introduction

SnakeAI

贪吃蛇 AI

参数

usage: main.py [-h] [--human] [--training] [--render] [--shape SHAPE SHAPE] [--episode EPISODE]

optional arguments:
  -h, --help           show this help message and exit
  --human              human play
  --training           training agent
  --render             render game
  --shape SHAPE SHAPE  game size, default is 4 4
  --episode EPISODE    training episode, default is inf
parameter description
shape window size of game, 4 4 for default
human play game manually or not
render show the game board or not, ignored when field human is set
training training the agent or not
episode training episode, default is inf

人工智能

人工 智能

python main.py --human --shape 4 4

人工智障

需要保证 main.py 的运行目录下有 model.h5 文件

python main.py

训练

python main.py --training

目前存在的问题

observation reward
死亡 -1
连续左转或右转四次 -1
超过一定步数没有吃到苹果 -1
吃到苹果 1

训练出来的人工智障只会一直向右或向左(蛇初始长度为 2),暂时不知道是为什么 QAQ

snakeai's People

Contributors

lucienshui avatar

Stargazers

 avatar

Watchers

 avatar  avatar

snakeai's Issues

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.