Giter VIP home page Giter VIP logo

guidehim's Introduction

Guide Him

screen_shot

This is a quick programming game exercise on Markov Decision Processes and Dynamic Programming.

Requirement

dependencies:

  • numpy (>=1.10.x)
  • gym (>=0.8.0)
  • pygame (>=1.9.3)

type in terminal

sudo pip install gym numpy pygame

Installation

To install to your system:

git clone https://github.com/kiddos/guidehim.git
cd guidehim
sudo python setup.py install

Goal

The goal is to guide Stone Lin moving towards the goal. If your command move Stone Lin out of the Screen, game is over and you will need to reset the environemnt to play.

Objects

You might see these objects on the map:

  • Empty: (grid value: 0)

  • Wall: Stone Lin cannot run through wall (grid value: 1)

  • Fire: If Stone Lin caught on fire, game over. (grid value: 2)

  • Pond: If Stone Lin fell into a pond, also game over. (grid value: 3)

  • Poop: It's ok to step on poop. Totally ok. (grid value: 4)

  • 尻尻: It's not ok to 尻尻 in public. (grid value: 5)

  • 肛肛: It's also not ok to 肛肛 someone else. (grid value 6)

  • Stone Lin: G8 guy. (grid value: 8)

  • goal: Stone Lin's goal. (grid value: 9)

Properties of Stone Lin

Stone Lin does not always follow the command you gave him, since he is such a dick. He has a probablility of 87.87% to follow your command. For 12.13% chance, he will go the other way. This makes the game a little harder to play.

Task

Your job is to gave Stone Lin action so that he can get to the goal.

import

from guidehim.guide_him import GuideHim

initialize environemnt:

env = GuideHim('map/simple.map')

reset the environemnt:

observation = env.reset()

give action:

observation, reward, done, _ = env.step(env.action_space.sample())

render:

env.render()

sample code:

from guidehim.guide_him import GuideHim
import numpy as np

def main():
  env = GuideHim('map/simple.map')
  observation = env.reset()
  while True:
    observation, reward, done, _ = env.step(env.action_space.sample())
    env.render()

if __name__ == '__main__':
  main()

Maps

I currently create 3 maps:

  • empty.map
  • simple.map
  • easy.map

You can play around with these.

Examples

I implement 2 dynamic programming methods:

  • value iteration value_iteration.py
  • policy iteration policy_iteration.py

I suggest you implement your own first.

guidehim's People

Contributors

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