Skip to content

Aleexm/bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bridge environments ♣️

This github contains an environment for both the bidding (gym-bridge) and playing out the cards (gym-play). Installation is simple:

  • Navigate to the desired local directory where you wish to place the codebase.
  • Run git clone git@github.com:Aleexm/bridge.git
  • Enter the created directory
  • Run pip install -r requirements.txt
  • Run pip install -e gym-bridge
  • Run pip install -e gym-play
  • Run pip install tensorflow==1.5.0 if you want to train another bidding agent.

Gym Play ♠

List of features

  • PlayEnv can fully simulate the playing of the cards, including tricks taken, scoring, IMP conversion, etc.
  • Has an integrated POMCP solver, which you can play against interactively. See run_pomcp.py

Gym Bridge ♥️

OpenAI Gym environment for Bridge Bidding, with an integrated Double-Dummy Solver courtesy of Bo Haglund. Using the DDS, we can check quickly whether a contract was made.

List of Features

Environment overview

  • A hand is encoded as a 52-bitvector of the ordered set of cards, i.e. 2C<2D<...<AH<AS. A '1' indicates this card is held.
  • The vulnerability is encoded as a 2-bitvector. First bit is NS vuln, second bit is EW vuln.
  • The bidding history is encoded as a 318-bitvector, where a 1 in the i-th entry denotes that the i-th bid in the possible maximum bidding sequence is called, i.e. p-p-p|1C-p-p-d-p-p-r-p-p|1D-p-p-d-p-p-r-p-p|...|7N-p-p-d-p-p-r-p-p. The final pass can be inferred. See https://arxiv.org/abs/1903.00900 for details.
  • Observations in this environment are the State, which contains all global information. A Controller then filters the joint observation and passes the correct local information to the acting agent.
  • At each timestep, one of the four agents makes a bid and the state is updated. After three consecutive passes, the bidding phase concludes (4 passes if no contract bid was ever made.).
  • A Double Dummy Solver is used to approximate the tricks made by the declaring partnership.

About

Work done for the Dutch Bridge Association

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages