Coder Social home page Coder Social logo

fedorajzf / angrybirds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imanolarrieta/angrybirds

0.0 2.0 0.0 46.01 MB

AI Final Project

License: MIT License

TeX 5.80% Python 30.01% C 13.38% C++ 5.70% Objective-C 0.27% HTML 40.04% CSS 1.02% JavaScript 3.19% Makefile 0.31% Batchfile 0.28%

angrybirds's Introduction

###File description (src):

#abAPI
This API contains the definition of the Angry Birds as an approximate MDP (define states and their successors by manipulating the AngryBirdsGame class in AngryBirds.py). We also define a simplified version of the Game States by extracting all necessary information to run algorthms.

#AngryBirds
The original code was modified into an object-oriented setting, creating the class AngryBirdsGame. We define the basic methods that will let us extract all game features and manipulate the underlying game mechanics- we will now be able to set levels, get scores, extract pig positions, perform an action, run a certain number of frames, and so on.

#characters
This file defines all characteristics for pigs and birds, such as mass, life, radius, body, shape and velocity.

#evaluation
This file contains the codes for generating results and graphs by running it as __main__ and uncommenting the evaluator functions for each feature extractor (PP, NPP, NPPO, NPPS) and algorithm (Q-Learning, RLSVI).

#GameAgent
The class GameAgent defines the possible actions the bird can take, as well as all feature extractors described in the paper.

#DenseLearnerRLSVI
In this code the RLSVI algorithm is defined and adapted to our code using the RLSVI_wrapper class.

#level
This code contains the elements that define all 11 levels (number and positions of pigs and beams).

#polygon
Similar to characters, this code defines all characteristics of beams.

#QLearner
This code defines the Q-Learning algorithm based on the class’s code.

#sparseLearnerRLSVI
This code is DenseLearnerRLSVI.py except we treat sparse matrix operations at all steps. This highly improves the performance when running simulations.

#util
This file contains the basic tools we used in class to run simulations of the reinforcement learning algorithm. We adapted it so that we can set feedback incorporation after each action or after each episode.


### Codes to run and produce results

-To run as human play, run AngryBirds.py as __main__
-To produce the results (including those shown in the paper), run evaluation.py as __main__ and uncomment the evaluator functions for each feature extractor (PP, NPP, NPPO, NPPS) and algorithm (Q-Learning, RLSVI).
-To run either RL algorithm, run GameAgent as __main__ and uncommenting the appropriate function (RLSVI_wrapper for RLSVI, and QLearningAlgorithm for Q-Learning). One can also set parameters in calling these functions, for example setting show=True to see what the algorithm takes as actions.


angrybirds's People

Contributors

estevaofon avatar imanolarrieta avatar larsroemheld 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.