Code Monkey home page Code Monkey logo

netlogo-pong's Introduction

Netlogo-pong

Simple netlogo implementation of a learning agent playing pong.

You can read a survey on "Learning Agents for Pong" here.

drawing

Folders


├── pong_exp                                # Experiments folder
├── survey                                  # LaTeX survey
|── Learning_Agents_for_Pong__A_Survey.pdf  # PDF survey
|── quality.csv                             # A quality matrix
└── pong.nlogo                              # Actual code

PLAY

If you want to see how an agent plays pong against a Scripted AI just do SETUP, LOAD (optional) and then PLAY. This way the agent is not learning but simply playing the best action based on the quality matrix (quality.csv). If you don't press LOAD the agent operates with an empty quality matrix (zeros only). In the pong_exp folder you can find quality matrices (quality_20k_episodes_rnd-prob-0.1.csv, etc.). By renaming them to quality.csv and putting them in the directory where the netlogo code is (pong.nlogo) you can see how the agent plays.

LEARN

You can generate your own quality matrix by doing SETUP, LOAD (optional), select the algorithm between SARSA and Q-Learning and then press LEARN. This way the agent is learning and generating a quality matrix (quality.csv). If you don't press LOAD the learning starts with an empty quality matrix (zeros only).

CONFIGURATION

Algorithm

You can choose whether the learning algorithm will be Q-Learning or SARSA.

State-type

You can choose whether, during learning, the opponent's state, that is the coordinate x, is known to the agent or not.

Reward-type

You can choose between two types of rewards. The basic reward is a reward that gives +1 in case of victory and -1 in case of defeat. The reward distance is based the basic reward but it also takes into accout the distance of the ball bounce from the center of the paddle.

netlogo-pong's People

Contributors

davidepietrasanta avatar magazzugaetano avatar saiteki-kai avatar

Stargazers

 avatar

Watchers

 avatar  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.