Giter Site home page Giter Site logo

oriyanh / bridge-ai Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 5.0 4.81 MB

In this project we try to create a sophisticated computer agent to play the Contact Bridge card game. Our goal is to develop an agent that is tough to play against, with fast reaction time so it is able to play in real time against humans. We approached this as a search problem, and implemented search-tree heuristics based on Minimax and Monte Carlo Tree Search. Implemented as a final project for the "Introduction to Aritifical Intelligence" course of the Hebrew University of Jerusalem.

Roff 0.84% Python 99.16%
ai minmax minmax-algorithm mcts mcts-implementations mcts-algorithm alpha-beta-pruning bridge-game

bridge-ai's Introduction

Double Dummy Bridge Solver

In this project we try to create a sophisticated computer agent to play the Contact Bridge card game. Our goal is to develop an agent that is tough to play against, with fast reaction time so it is able to play in real time against humans. We approached this as a search problem, and implemented search-tree heuristics based on Minimax and Monte Carlo Tree Search.
Implemented as a final project for the "Introduction to Aritifical Intelligence" course of the Hebrew University of Jerusalem.

Running Instructions

  • Create a virtualenv with python3.7 - virtualenv -p python3.7 venv
  • Activate virtual environment - source venv/bin/activate.csh if using tcsh; if using bash, use source venv/bin/activate
  • pip install -r requirements.txt to install project dependencies.
  • To run a match, run python3.7 match.py --agent1 <agent arguments> --agent2 <agent arguments> --num_games <int> --verbose_mode <0/1> where each agent encoding is of the form described in match.py’s documentation.
  • When done, run deactivate to deactivate the virtual environment

We encourage you to try and run match.py with some of the following arguments preferably from a console outside of an IDE (during the game press the Enter key to perform the next action):

Simple vs Simple:

  • --agent1 Random --agent2 Random
  • --agent1 HighestFirst --agent2 SoftLongGreedy

AlphaBeta vs Simple:

  • --agent1 AlphaBeta-ShortGreedyEvaluation-5 --agent2 LowestFirst
  • --agent1 AlphaBeta-LongGreedyEvaluation-10 --agent2 Random
  • --agent1 AlphaBeta-HandEvaluation-5 --agent2 HighestFirst
  • --agent1 AlphaBeta-CountOfTricksWon-10 --agent2 HighestFirst

MCTS vs Simple:

  • --agent1 MCTS-simple-HardLongGreedy-50 --agent2 HardShortGreedy
  • --agent1 MCTS-stochastic-Random-500 --agent2 SoftShortGreedy
  • --agent1 MCTS-pure-LowestFirst-250 --agent2 Random

If you wish to run games automatically without seeing each game state and without pressing Enter after each move, add the argument “--verbose_mode 0”. For more arguments, refer to match.py.

Authors

  • Ram Friedman
  • Yonny Hammer
  • Maryna Romanchuk
  • Oriyan Hermoni

bridge-ai's People

Contributors

gitpushoriginmaster avatar marchellyn avatar oriyanh avatar yonnyh avatar

Stargazers

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