Scarabin Posted July 7, 2012 Report Share Posted July 7, 2012 I am intrigued by the number of BBO'rs who mention that they are writing bridge computer simulations or playing programs either as a hobby or commercially and I would like to learn who is involved and what you are working on. To start things off, I am engaged on two programs, both of hobby rather than professional standard: - an aid to counting in play, and - a program to compare bidding systems and hand evaluation systems. Hope to hear from you all. :rolleyes: 1 Quote Link to comment Share on other sites More sharing options...
Siegmund Posted July 7, 2012 Report Share Posted July 7, 2012 Many of us who "write simulations" including myself, are writing scripts to feed to someone else's dealer and double dummy analyzer software. The front ends can be quite involved, doing things like taking a given defender's hand, dealing out 1000 hands consistent with a given auction, and trying every possible lead against each one (double-dummy play for the remaining 51 cards each time), to see which lead gives up a trick least often. My most elaborate such front end will take a set of BBO hand records, go through bid by bid and card by card, flag every move that costs vs. double-dummy par and vs. the state of the game before that bid or card, and create statistics on the frequency of such errors by each player. I have dabbled in other bridge software in the past -- creating a timer application for use in bridge clubs, a LaTeX package for typesetting hands, and explored several computationally expensive approaches to developing a rating system. The timer and the LaTeX package were of a quality to be suitable to give them away to others, though they were intended originally as tools for my local club and to make my own life easier as a teacher and director. Quote Link to comment Share on other sites More sharing options...
antonylee Posted July 8, 2012 Report Share Posted July 8, 2012 I'll jump on the opportunity to re-advertise my dealer program, Redeal (https://github.com/anntzer/redeal), which should be reasonably easy to use if 1/ you know Python, and 2/ you work on Linux/Mac or don't need the double-dummy solver. Mostly, my goal is to have an easy way to compare different bidding strategies (such as, holding ♠652♥K752♦53♣9862 opposite a partner who has shown a 22-24NT, should you pass, bid 3N or bid Stayman? and does it matter whether you play regular or Puppet?) 1 Quote Link to comment Share on other sites More sharing options...
Finch Posted July 8, 2012 Report Share Posted July 8, 2012 Most people are using already-existing software to run simulations.Like (I would guess) many others, I have written my own dealing/simulation programme, more or less just to prove that I could, but I actually use someone else's when I want to do a lot because it runs much faster than mine. Quote Link to comment Share on other sites More sharing options...
RossSCann Posted July 8, 2012 Report Share Posted July 8, 2012 I am intrigued by the number of BBO'rs who mention that they are writing bridge computer simulations or playing programs either as a hobby or commercially and I would like to learn who is involved and what you are working on. To start things off, I am engaged on two programs, both of hobby rather than professional standard: - an aid to counting in play, and - a program to compare bidding systems and hand evaluation systems. Hope to hear from you all. :rolleyes:I am writing a bidding question evaluation program to test alternate bidding decisions using a bridge teaching program that I offer for free trial on the netat www.bridgegame.com This program is aimed at beginners primarily, but it's bidding and play is intermediate level.I have an active thread going now in this forum over the accuracy of my program's results. My program version on the net doesn't have this simulation feature at this point. My program works by entering the S cards and the bidding up to the point of the bids in question, which are always made by S. Two alternate bids are entered as the question in point. The program runs 500 random cases simulating each of the two bidding alternatives. The play is not double dummy because I don't need double duumy play for teaching. I am trying to find sources of results of similar analysis that I can test the results of my simulations against. 1 Quote Link to comment Share on other sites More sharing options...
myfish Posted July 9, 2012 Report Share Posted July 9, 2012 Hi,I want to ask is there any link for the existing bridge simulation program? 1 Quote Link to comment Share on other sites More sharing options...
antonylee Posted July 9, 2012 Report Share Posted July 9, 2012 Thomas Andrews' Deal (http://bridge.thomasoandrews.com/deal/) is quite good. 2 Quote Link to comment Share on other sites More sharing options...
Scarabin Posted July 13, 2012 Author Report Share Posted July 13, 2012 Thanks for your responses. In starting this Topic I had 3 thoughts: 1) It is always nice to know you are not entirely alone. 2) It would be interesting to discover a common thread in people who combine bridge and computer programming. I suspect they are usually also mathematicians, for starters? 3) If enough people respond it might be worthwhile to float the possibility of a joint endeavour to write a mammoth bridge playing program. I know there are other programmers out there who have still to respond. What do you think? 1 Quote Link to comment Share on other sites More sharing options...
bluecalm Posted July 13, 2012 Report Share Posted July 13, 2012 Like (I would guess) many others, I have written my own dealing/simulation programme, more or less just to prove that I could, but I actually use someone else's when I want to do a lot because it runs much faster than mine. I am still to prove it to myself :)One thing which is bothering me when it comes to dmpro (don't know about other software) is that it doesn't run in parallel on multiple cores. As the problem of calculating double dummy results for many hands should scale linearly that would be huge boost on modern processors (like 8x faster on i7). It would require just few line of code more (assuming the software is written in C or C++) but without the source I can't do anything about it.Same goes for dealing software, although I admit I have no idea if for example deal runs on multiple cores.I am involved in writing simulation software for other card game now but once I am done with it I think I am going to spend some time on my own simulator just to have it run on multi cores (and deal cards faster I think dealing programs are really bad when it comes to rare hands). If enough people respond it might be worthwhile to float the possibility of a joint endeavour to write a mammoth bridge playing program. Yeah, bridge playing program would be cool. It's high time to knock GIB out of BBO :)What I would be very interested in for starters is a simulator which can solve defensive problems after several tricks are already played. It would require a lot of human input but could give valuable output about what play is the best at given stage. As far as I am aware there is no such software available but the concept is not that complicated. Quote Link to comment Share on other sites More sharing options...
Antrax Posted July 13, 2012 Report Share Posted July 13, 2012 Well, I'm a software engineer, not mathematically inclined beyond what is common in this profession, and haven't chimed in until now as I'm not writing any Bridge software - what exists is quite enough for me. However, this: One thing which is bothering me when it comes to dmpro (don't know about other software) is that it doesn't run in parallel on multiple cores. is basically what I do, so if there's an interest in a community effort of some sort, I can help with optimization, single or multi threaded. Quote Link to comment Share on other sites More sharing options...
rhm Posted July 13, 2012 Report Share Posted July 13, 2012 How I understand the best modern Bridge Playing Software works is, that it samples possible hands for opponents and then chooses the line, which works on most deals. I would like to see such an interface to software which would be a merger of simulation and Double Dummy solver with a different sort of output. Give that software 26 cards for declarer and dummy. Now I would like to specify some parameters as input, depending (among others) on how long I am prepared to wait for the result and the speed of my computer. The input parameters would be: How many deals (e.g. 1000) should be generated out of the remaining 26 cards for opponents for the double dummy solver to check As a result the software would list probability of success for different incompatible lines of play for declarer and give their relative success rate. Incompatible of course here means that you have to make a decision in the play affecting your success before having crucial information, like somebody showing out. If line A always wins when line B does, they are not incompatible but line A is simply superior. Of course you would also like to specify restrictions on the opponents hand, say West can not have more than 5 spades and 9 HCP. You might want to specify the opening lead or even the first few tricks etc. Once this has been accomplished it would not be very difficult to do the same from a defender's point of view.The goal being defeating contracts or maximizing defensive tricks. One problem alone is how you store and output different lines of play, which could be numerous, in a meaningful way. At the moment we have this type of information only for the opening lead, but not for complete lines of play or defense. Of course such a software might be a killer to challenging single dummy problems like the double dummy solver is to double dummy problems. So my request is a double-edged sword. Rainer Herrmann 1 Quote Link to comment Share on other sites More sharing options...
Siegmund Posted July 13, 2012 Report Share Posted July 13, 2012 One thing which is bothering me when it comes to dmpro (don't know about other software) is that it doesn't run in parallel on multiple cores. As the problem of calculating double dummy results for many hands should scale linearly that would be huge boost on modern processors (like 8x faster on i7). It would require just few line of code more (assuming the software is written in C or C++) but without the source I can't do anything about it.Same goes for dealing software, although I admit I have no idea if for example deal runs on multiple cores. Deal is 1 processor only. But you can start several threads, assign each to a different processor, have each thread return some statistics, and combine the answers, to get more hands processed faster. (I didn't do that; but if I had a family of cases to simulate, I would have two problems going at once each on their own processor.) I seem to recall that a new version of Bo Haglund's double dummy solver came out recently that has improved ability to take advantage of new hardware - but has not yet been integrated into the Andrews Deal package. Deal is open source, though, if you want to try to improve upon it. Quote Link to comment Share on other sites More sharing options...
RossSCann Posted July 15, 2012 Report Share Posted July 15, 2012 Thomas Andrews' Deal (http://bridge.thomasoandrews.com/deal/) is quite good.I downloaded and extracted but it wouldn't work. It said it was missing a .dll but that dll was clearly present.It is unfortnately written in some obscure script language.We should be working in C++.Ross 1 Quote Link to comment Share on other sites More sharing options...
catch22 Posted July 15, 2012 Report Share Posted July 15, 2012 I wrote a program that uses a domain specific language that can be used to define any bidding system - It could be used as a deal simulator, but I use it to practice the bidding system I play with gnasher. This is a snippet 1nt:"Strong NT" (p#3 15-17hcp s#5422|4333|4432|5332|5422|4441) { name f1NTResponses 2c:"4M inv+ raise or 1-suited major bad suit or 1 suited minor fg" (p#2 4h 3-s 8+hcp, 4s 3-h 8+hcp, 6+h 12+hcp q#hh-h, 6+s 12+hcp q#hh-s, 6+c 10+hcp 3-s 3-h, 6+d 10+hcp 3-s 3-h, s#5422 4+d 4+c 10+hcp) { name f1NT2C 2d:"Forced" { name f1NT2C2DResponses 2h:"Spades inv+" (4+s 8+hcp [$M=s, $OM=h]) { 2s:"Forced" ->f1NTInvPlusOne4CardMajor } 2s:"1-suiter minor gf or 22(54) gf" (6+c 10+hcp, 6+d 10+hcp, s#5422 4+d 4+c 10+hcp) 1 Quote Link to comment Share on other sites More sharing options...
Scarabin Posted July 16, 2012 Author Report Share Posted July 16, 2012 I wrote a program that uses a domain specific language that can be used to define any bidding system - It could be used as a deal simulator, but I use it to practice the bidding system I play with gnasher. This is a snippet 1nt:"Strong NT" (p#3 15-17hcp s#5422|4333|4432|5332|5422|4441) { name f1NTResponses 2c:"4M inv+ raise or 1-suited major bad suit or 1 suited minor fg" (p#2 4h 3-s 8+hcp, 4s 3-h 8+hcp, 6+h 12+hcp q#hh-h, 6+s 12+hcp q#hh-s, 6+c 10+hcp 3-s 3-h, 6+d 10+hcp 3-s 3-h, s#5422 4+d 4+c 10+hcp) { name f1NT2C 2d:"Forced" { name f1NT2C2DResponses 2h:"Spades inv+" (4+s 8+hcp [$M=s, $OM=h]) { 2s:"Forced" ->f1NTInvPlusOne4CardMajor } 2s:"1-suiter minor gf or 22(54) gf" (6+c 10+hcp, 6+d 10+hcp, s#5422 4+d 4+c 10+hcp) May we know the name of the domain specific language you use, please? Your snippet is interesting in a tantalizing sort of way. Quote Link to comment Share on other sites More sharing options...
catch22 Posted July 16, 2012 Report Share Posted July 16, 2012 May we know the name of the domain specific language you use, please? Your snippet is interesting in a tantalizing sort of way. It is my own DSL, which originally was defined using ANTLR. I have recently ported it to XText so I could create an eclipse based editor. Basic syntax is: <BID>:<DESCRIPTION> <PRIORITY + CONSTRAINT>{ <BID>:<DESCRIPTION> <PRIORITY + CONSTRAINT> <BID>:<DESCRIPTION> <PRIORITY + CONSTRAINT>....} Continuations can be embedded or can be calls to fragments e.g.1H : "5 card major" (5+h 10+hcp [$M=h]) ->f5CardMajorCont1S : "5 card major" (5+s 10+hcp [$M=s]) ->f5CardMajorCont $M is a variable that can be used in subsequent constraints. e.g.f5CardMajorCont2$M : "Rebid major" (6+$M) Quote Link to comment Share on other sites More sharing options...
Scarabin Posted July 18, 2012 Author Report Share Posted July 18, 2012 Thanks Catch22. I am currently researching expert systems (probably a dead end since all rule based systems are expert systems) and database applications of Visual Basic. I am a very amateur programmer! Quote Link to comment Share on other sites More sharing options...
blackshoe Posted July 18, 2012 Report Share Posted July 18, 2012 There was once a bridge playing "expert system" called, iirc, "Bridge Partner". You taught it your bidding system by bidding many hands. Eventually it figured out what you were doing. That was the theory, anyway. I never did get it to that point. I think the project was abandoned (or moved to Windoze — either one would spell its end for me). Quote Link to comment Share on other sites More sharing options...
Scarabin Posted July 19, 2012 Author Report Share Posted July 19, 2012 There was once a bridge playing "expert system" called, iirc, "Bridge Partner". You taught it your bidding system by bidding many hands. Eventually it figured out what you were doing. That was the theory, anyway. I never did get it to that point. I think the project was abandoned (or moved to Windoze — either one would spell its end for me). Cannot trace it through Google so probably abandoned. On a related point, has anyone found a learning program (neural networks in the jargon?) that is beyond trivial and that actually works? Quote Link to comment Share on other sites More sharing options...
Scarabin Posted July 23, 2012 Author Report Share Posted July 23, 2012 Thanks for your replies. My first aim, at least, is satisfied. :rolleyes: While I cannot claim to have discovered overwhelming support for a collaborative bridge simulation, I guess we have reached the stage where I should put the question directly:"Would you join a group effort to write a new bridge simulation?". I will open a new topic to do this. :) Quote Link to comment Share on other sites More sharing options...
Quantumcat Posted July 23, 2012 Report Share Posted July 23, 2012 I started writing a suit combination solver recently, using uninformed search algorithm, and I'm sure I can improve it a lot by the time I finish this semester, as one of my classes is Computational Intelligence which is mostly about designing algorithms. It's not too useful if you own a copy of Deep Finesse, but perhaps it will be useful for some if they want to win an argument with a friend about a suit combination in isolation and The Encyclopedia of Bridge doesn't give a good answer. Quote Link to comment Share on other sites More sharing options...
laststandb Posted July 23, 2012 Report Share Posted July 23, 2012 I don't want to start a new thread or anything for this, but are there any programs out there that calculate how often a bid is made? Mainly I'm interested in figuring out opening frequencies / mean opening rates (see here http://bridgewithdan.com/systems/bridge-system-collection.txt) for a couple of systems / conventions / conventional responses. Quote Link to comment Share on other sites More sharing options...
Quantumcat Posted July 23, 2012 Report Share Posted July 23, 2012 You can do this on a normal simulation program, just write down every type of hand that can make that bid. For instance, if a 1♥ opening, you'd write down 5 hearts, 2-4 of the other suits, 11-14 HCP or 18+ HCP, and 6+ hearts, 0-6 diamonds or clubs, 0-5 spades, 11-19 hcp, etc. Now you just have to translate what you wrote into the right syntax for the program. You can also do this on the new BBO. If you are doing a Bidding table, and select deal source, you can select what sorts of hands come up (2-5 clubs, etc), and if you click the "odds" button, it tells you the odds for the hand type you selected. So if you choose 0-13 of every suit, 0-37 HCP it will say 100%. Quote Link to comment Share on other sites More sharing options...
inquiry Posted July 24, 2012 Report Share Posted July 24, 2012 I don't want to start a new thread or anything for this, but are there any programs out there that calculate how often a bid is made? Mainly I'm interested in figuring out opening frequencies / mean opening rates (see here http://bridgewithdan...-collection.txt) for a couple of systems / conventions / conventional responses. Here is data from nearly 1 million hands played online in ACBL events on bbo. The first table shows the frequency, based on percentage, of an opening bid (nothing below 0.5% shown). The 2nd table shows all the actual number of bids for each bid, so there are the occasional opening bid of 7NT and the like. 1C 20.90% 1D 22.00% 1H 14.50% 1S 15.90% 1NT 12.50% 2C 1.90% 2D 1.60% 2H 2.20% 2S 2.30% 2NT 2.00% 3C 0.90% 3D 0.60% 3H 0.60% 1C 201683 1D 212062 1H 140541 1S 153573 1NT 120919 2C 18477 2D 15769 2H 21402 2S 22605 2NT 20086 3C 9102 3D 6383 3H 5990 3S 4303 3NT 848 4C 586 4D 679 4H 3837 4S 3125 4NT 28 5C 282 5D 323 5H 5 5S 3 5NT 8 6C 17 6D 21 6H 11 6S 19 6NT 11 7C 1 7D 0 7H 3 7S 1 7NT 3 Total "hands" 974,924 This type of data is very easy to find and extract using Bridgebrowser. Quote Link to comment Share on other sites More sharing options...
Zelandakh Posted July 24, 2012 Report Share Posted July 24, 2012 Mainly I'm interested in figuring out opening frequencies / mean opening rates.Something like was done for this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.