![]() |
7 Card Hand Evaluators
Hi all, new user but was told this was a good poker forum!
Not sure if this is the right place to post, please move if it is not. Anyway, I've finished writing a 7 card hand evaluator for poker, and I'm managing to get around 14-15 million hands evaluated per second (14,000 to 15,000 per millisecond). I've had a look around, and is anyone aware of any software that can beat this? Tests where done on a P4 2.4ghz PC with 1GB Ram. Thanks for your time! Tom |
Re: 7 Card Hand Evaluators
When u say it evaluates hands, what exactly does it do? Solve for the equity value vs a random distribution, a specified distribution, tell you your hands rank, or does some sort of opponent/bidding modelling?
As far as whether I'm aware of faster software? Again it depends what it does. If you just have it look up equity values poker stove caps off at about 100,000 million games a second - but it "cheats" - because it looks them up in tables. If you specify part of the flop, then it slows to about 5-10 million games a second. And if you specify distribution vs. distribution analysis with multiple players it slows a to a crawl, it slows to a few thousand a second. Because of that I've wrote a poker evaluator as well that is 10,000 faster than poker stove for distribution vs. distribution analysis and partial flop analysis, which i'm using as an engine to try write a bot that approximates Nash EQ play. It lets you specify distribtuions more precisely than pokerstove currently does - which honestly isn't much use to the average poker player. E.g. you can assign any decimal between [0,1] to the probability that when your opponent is dealt XY, he plays XY (or is on XY at that point in time). This allows you to capture the full range of possible distributions. The purpose of my program is to be interacted with by another program, not realy for some human to plug in by hand a bunch of values between [0,1] for each of the 1326 XY combinations. Anyways, need to know what exactly your program does, if u want to know if something else does it faster. "Evaluation" is an ambiguous term [img]/images/graemlins/smile.gif[/img] |
Re: 7 Card Hand Evaluators
I think he means ranks hands-- takes a combination of 7 cards and returns an integer. A better hand has a higher integer value than a worse hand.
A faster evaluator means a faster bot/analysis program etc. |
Re: 7 Card Hand Evaluators
oh ok. In terms of merely assigning a integer value to a hand ranking i'm getting slightly over 60 million per second. I have a AMD Dual FX-60, 2 Gigs of ram. For purposes of conductnig the evaluation I assigned a static flop and hands to 10 players and fed that repeatedly to my "determine winner" function which ranks all 10 hands.
The determine winner function contains no memory of the previous hand fed to it, so its like receiving a new hand, but it isolates the processing time, from the time it takes to generate new hands, etc.... I could write a function that is about 1000x faster but the memory requirements would increase 10 fold. Right now it uses about 200 Mbs of memory. Well, I would still say yours might be faster than any available commercial software, (I think mine are). If anyone has serious intentions on making commercial or proprietary software using these types of algorithms they can contact me. Right now i'm using mine to design bots. |
Re: 7 Card Hand Evaluators
I'd be very interested in a program where you could put a player on a preflop range, choose a flop, and let the program calculate how often the player would have flopped every possible combination. (Top pair, a gutshot, top pair AND a gutshot should be different combinations, so the total adds up to 100%, if you know what i mean)
I don't know if such a thing exists, but you guys seem to know a lot about programming. |
Re: 7 Card Hand Evaluators
D&L:
I find 60 million per second extremely impressive. Because you are on dual core, we can cut that in half and say 30 million per second, which is still a darn sight faster than mine. Just to clarrify: The problem is, to take in 7 UNORDERED integers (0-52) representing a hand, and convert them into a ranking which can be compared with other hands ranking to quickly determine the winner. I can't cap 13.5million per second! Is this what your evaluator does? |
Re: 7 Card Hand Evaluators
Update: Managed to get it to nearly 15 million per second.
|
Re: 7 Card Hand Evaluators
[ QUOTE ]
Update: Managed to get it to nearly 15 million per second. [/ QUOTE ] This is similar to my numbers on propokertools , although ranking a 7-card hand is not what my code spends most of its time doing these days. I might try and whip something up faster for fun in the next few hours. Cheers, bachfan |
Re: 7 Card Hand Evaluators
[ QUOTE ]
[ QUOTE ] Update: Managed to get it to nearly 15 million per second. [/ QUOTE ] This is similar to my numbers on propokertools , although ranking a 7-card hand is not what my code spends most of its time doing these days. I might try and whip something up faster for fun in the next few hours. Cheers, bachfan [/ QUOTE ] Oops, off by a factor of two. I'm closer to 30million on one core of a core duo 1.6ghz. This is JUST the compute ranking function. - bachfan |
Re: 7 Card Hand Evaluators
So, to clear things up, your program can work out the rank of a hand given to it in any order, IE given random unordered set of 7 integers it can work out 30 million of them per second? Or as a pre condition must they be ordered?
|
Re: 7 Card Hand Evaluators
actually dual core isn't coming into play yet...it simiply allows me to be surfing the web without degrading the speed of other programs. Its still 60 million...but i am on a faster machine overall i think.
|
Re: 7 Card Hand Evaluators
Mine is 60million unordered. Keep in mind my function takes about 200MB of memory. I was trying to make the fastest algorithm my machine could support. The only faster algorithm I could think of would have taken multiple gigabytes of memory. Memory and speed are almost always tradeoffs.
Remember my dual core processor doesn't effect speed. Although I am on a faster comp i think. Anyways, I'm not writing to say that mines faster. I'm really impressed that others are coming up with similar results. I've worked for a while on various altorithms, as part of trying to apply game theory to poker. If any of u are working on commercial software, tell me about it, and if its interesting and u sound serious, I may be willing to share my techniques. P.s. I'm not a programmer. _D&L_ = Dirty and Litigious - i'm a lawyer, with a background in gametheory and economics. It's quite possible that if a professional programmer looked at my code they could find further optimizations. I programmed in VisualBasic 5.0, which might be slower than if it were converted to something like C++. -_D&L_ |
Re: 7 Card Hand Evaluators
So you are getting 60 million evaluations per second (that's 40 cpu cycles per hand) using VB?
|
Re: 7 Card Hand Evaluators
Yes Gull, thats what I said...
Look if memory was no object you could just do this: Dim HandValue(52, 52, 52, 52, 52, 52, 52) as Integer And write hand values for every combination of cards, for any order they are entered. It would take, i think, 2000 gigabytes of memory. I don't think there are computers that support that much memory. But the result would be that you would have hand evaluations that could be achieved in maybe 1 cpu cycle - that is the array would just be a pointer to a result. Obviously, not feasible given memory constraints. I can't reveal my methods, though i sense disbelief, but hopefully this extreme example shows what is possible. Indeed, this extreme example shows that if memory were not an object we could have a function that solved billions or maybe trillions of games a second. |
Re: 7 Card Hand Evaluators
Yeah, i don't think anything exists for that right now. It would take me about 3-7 days to transform my program into something that could do that...as well as adding a decent user interface to edit distributions (right now I use access).
If someone with (proven) experience in publishing share-ware like programs wanted to co-publish a program like this with me, I could probably be talked into doing it. As I said elsewhere in this thread, I'm not a programmer by trade. I have difficulty getting my program to run on other systems, don't know how to create an installation package, and i would want to protect my databases (part of my algorithm) from being hacked and used for other un-liscensed purposes, etc. |
Re: 7 Card Hand Evaluators
[ QUOTE ]
Because of that I've wrote a poker evaluator as well that is 10,000 faster than poker stove for distribution vs. distribution analysis and partial flop analysis [/ QUOTE ] I call BS. It may be faster than pokerstove in very specific situations, but for the majority of analyses I doubt there's much difference. And anything that requires a 200MB database on disk is not commercially viable except as a web application, a market which propokertools has pretty much owned. Sorry. Anyone can generate the lookup tables required for a blazing fast algorithm, so I don't know how you claim that PokerStove "cheats" by using them, when that's exactly what you use. You can only do about a billion bitwise (and, or, xor), comparison, or iteration operations a second, and without lookup tables you'll never get a reasonable speed using any algorithm. |
Re: 7 Card Hand Evaluators
Phil why are you hostile? Did I ever say the world needed a poker stove that was 10,000 times faster? In fact, you gloss over the fact I said the exact opposite, because you want to pick a fight.
I didn't design my program to be the next poker stove, i designed it for speed - to be used in high end bots that i work on, or game theory software, which is pretty much the same thing. BTW i'm not a programmer, and haven't worked on these algorithms in over a year, so i mistook how much memory they used. I said 200mb, that was an earlier version, I double checked, they use about 15MBs. My original version was 8 gigs of hd space...so i've made lots improvements over time. Anyways, do i fault poker stove for using "lookup tables" - of course not. I use them too. My point - which u missed, because u want a fight - was that if a result is not on the lookup table, the program slows considerably. From 100,000 million games a second, to 5,000. The difference being is that for my algorithm no result is "off table." -Dirty & Litigious |
Re: 7 Card Hand Evaluators
5,000 per second? On what platform? The slowest it ever goes for me about 500,000 evals per second.
- Andrew |
Re: 7 Card Hand Evaluators
I've written an algorithm that uses NO lookup tables and can do 1.5 to 2 million evaluations per second.
My look up table version runs at 14-15 million per second. I'm sorry but without seeing your code I find it extremely difficult to believe that you can do 60 million per second with VB with a 15MB look up table. Would you be willing to expand on your methods? |
Re: 7 Card Hand Evaluators
[ QUOTE ]
oh ok. In terms of merely assigning a integer value to a hand ranking i'm getting slightly over 60 million per second. I have a AMD Dual FX-60, 2 Gigs of ram. For purposes of conductnig the evaluation I assigned a static flop and hands to 10 players and fed that repeatedly to my "determine winner" function which ranks all 10 hands. The determine winner function contains no memory of the previous hand fed to it, so its like receiving a new hand, but it isolates the processing time, from the time it takes to generate new hands, etc.... [/ QUOTE ] [ QUOTE ] So, to clear things up, your program can work out the rank of a hand given to it in any order, IE given random unordered set of 7 integers it can work out 30 million of them per second? Or as a pre condition must they be ordered? [/ QUOTE ] [ QUOTE ] Mine is 60million unordered. Keep in mind my function takes about 200MB of memory. I was trying to make the fastest algorithm my machine could support. The only faster algorithm I could think of would have taken multiple gigabytes of memory. Memory and speed are almost always tradeoffs. [/ QUOTE ] [ QUOTE ] Oops, off by a factor of two. I'm closer to 30million on one core of a core duo 1.6ghz. This is JUST the compute ranking function. [/ QUOTE ] There's a HUGE difference between assigning static cards for the flop and the players, and the general purpose solution. Are you both actually comparing your algorithms using the same metric? IE: Your function is passed an unordered vector of 7 integers in the range {0..51} and returns the hand rank for the input combination. From what I just read it sounds like one of you is generating your timings with essentially 5 of the 7 cards statically pre-assigned, and the other is generating the timings with no static cards and possibly some are using a 52 element bitstring rather than 7 unordered integers (bachfan?). [ QUOTE ] I could write a function that is about 1000x faster but the memory requirements would increase 10 fold. Right now it uses about 200 Mbs of memory. [/ QUOTE ] [ QUOTE ] So you are getting 60 million evaluations per second (that's 40 cpu cycles per hand) using VB? [/ QUOTE ] [ QUOTE ] Yes Gull, thats what I said... [/ QUOTE ] A 1000 fold increase of the existing 40 cycles per hand would be 0.04 cycles per hand??? [img]/images/graemlins/confused.gif[/img] Juk [img]/images/graemlins/smile.gif[/img] PS: I'm supposed to be having a rest from poker/coding atm (until new year at least), but this thread got me interested now... [img]/images/graemlins/smirk.gif[/img] |
Re: 7 Card Hand Evaluators
[ QUOTE ]
Phil why are you hostile? Did I ever say the world needed a poker stove that was 10,000 times faster? In fact, you gloss over the fact I said the exact opposite, because you want to pick a fight. [/ QUOTE ] Phil153 + Poker AI = Flames Juk [img]/images/graemlins/smile.gif[/img] |
Re: 7 Card Hand Evaluators
If you really did get 60 million general evals per second on a normal machine (3 MHz or so), I'm truly impressed. But you have to keep in mind that when it come to doing poker calculations there is more to it than just plain evaluation speed. The guy with the Poker Bolide software demonstrated that recently by making a fast monte carlo evaluator, but not much else.
It's unclear what you're striving for here, or what you've achieved. There is no world record for evals/second, but even at 60 million per second, interesting poker calculations can be done much faster. PokerStove can do about 2 billion evaluations per second in the optimized Enumeration code. In the unoptimized code, it does about 10 million evals per second when enumerating. That may seem slow, but many of the calculations finish with the exact solution nearly instantly. The same can't be said for monte carlo evaluation. While PokerStove does have various lookup tables, those consist mostly of things like bit counting tables. Admittedly, the monte carlo code is not it's strong point, but there's a reason for that. Under monte carlo, once the code is fast enough, it doesn't really matter too much if you make it twice as fast. You'll get close to the exact value quickly, but you'll never get the exact value. Said another way, doubling the number of evals won't double the convergence of the result. There are also issues of what sort of RNG you use, and equally important how you use it. Getting the RNG problem wrong can mean that your monte carlo simulations converge to the wrong result. If you can calculate the exact value, you're usually much better off, assuming you can actually calculate it quickly enough. The nice thing is that many of the interesting questions the people ask about poker are computable using exact enumeration, and can be done in a reasonable amount of time. In a lot of ways that was the whole point of PokerStove. If you know what you are trying to calculate, you can do it significantly faster by taking the whole calculation into consideration instead of just relying on fast 7 card hand evaluators. Unfortunatly, not all things can be calculated exactly in a short period of time, and for those you often have to resort to monte carlo, precomputation, or other methods. If you look at the work of eastbay and bachfan, you can see that they've done a great job in actually answering questions that people want to ask. As for your software, until you make it public in some fashion, it'll mean the world to you, but not much to the world. That's certainly not a bad thing. I have a lot of software which isn't public either. And it does mean quite a bit to me. On the other hand, all this thread has piqued my curiosity. I'v never really tried to make a fast general purpose evaluator. I wonder how fast I could make it? - Andrew |
Re: 7 Card Hand Evaluators
Well right now I use two lookup tables; and some on-the-fly processing. With 2 gigs of memory, you could just have one big lookup table, and reduce processing time to just retreiving a value from an array. Is that 1000x faster, maybe not, but it would be exponentially faster. Can modern CPU's retreive more than one integer value per CPU cycle? How about from a multi-dimensional Array? Well at any rate, that is the limiting factor, if memory wasn't an issue.
|
Re: 7 Card Hand Evaluators
Hey Andrew,
First, for anybody else reading Andrew is the author of poker stove. Second, Andrew you may remember me. I wrote you about a year or so ago, inquiring about access to poker stove source code, offering to make some "improvements," sign a confidentiality agreement, etc. You declined, as I probably would have too in your situation, but you can't really fault me for trying. At any rate, i wrote this code to be used with bots and junk that I was working on. I didn't have your code as a starting point, so maybe i needed to re-invent the wheel - to some extent. Certainly poker stove is great at what it's designed to do, and my intent was never to write a program to displace yours. One thing i noticed is that with poker stove is that if you set all the players to distributions, the program slows considerably. Its not a big deal for Poker_stove, because rarely are there 9 other players on the flop with you, but Pstove does slow from about 100,000 million games a sec to about 1 game every 4 seconds (9 players on broadway, final player on random all). The slow down isn't as severe with 3 or 4 players on the flop, but it still slows by a magnitude of about 200. Again, not a big deal for pokerstove, because few Pokerstove users need a question like this answered. But when you set a bot to search for the right strategy, u don't want it hit bottlenecks like that. So thats why my program tries to process everything at a more uniform speed. Besides, even if poker stove does do a better job than my program in answering these questions, i still didn't have access to the source to use in other programs. So at any rate, thats why I wrote my own... Dirty & Litigious -Dirty & Litigious |
Re: 7 Card Hand Evaluators
[ QUOTE ]
From what I just read it sounds like one of you is generating your timings with essentially 5 of the 7 cards statically pre-assigned, and the other is generating the timings with no static cards and possibly some are using a 52 element bitstring rather than 7 unordered integers (bachfan?). [/ QUOTE ] Here's what I did (and it looks like I was right with my FIRST quote of approx 15mil/sec, not 30. Oh well. [img]/images/graemlins/smile.gif[/img] I just spewed out 15 million random 7-card poker hands and computed the ranking for each. I looked up the cpu utilization for the ranking function and extrapolated the rate from that (i thought 30 mil for a minute but i forget to include a part which in all fairness really is part of the evaluation function - long story...) I've got some more comments coming. [img]/images/graemlins/smile.gif[/img] - bachfan |
Re: 7 Card Hand Evaluators
[ QUOTE ]
Under monte carlo, once the code is fast enough, it doesn't really matter too much if you make it twice as fast. You'll get close to the exact value quickly, but you'll never get the exact value. Said another way, doubling the number of evals won't double the convergence of the result. There are also issues of what sort of RNG you use, and equally important how you use it. Getting the RNG problem wrong can mean that your monte carlo simulations converge to the wrong result. [/ QUOTE ] I'd just like to echo that an elaborate a bit. While computing exact results is very satisfying (and has a certain "gee whiz" appeal), in my case generating a fast exhaustive algorithm was a lot easier than generating a fast monte-carlo algorithm. Fortunately, it doesn't matter a lot in practice, at least not for me, because in almost all cases it is pretty easy to converge on a useful result. There's another point I'd like to raise here - perhaps some other programmer types have some thoughts. In developing propokertools, one of the biggest challenges has been generating random hands for monte carlo simulations such that the results correctly approach the same results from an exhaustive simulation. Now, I am fairly confident my algorithms work, and I have automated tests to "prove" it, but there are some situations (most of them academic and not useful in practice) where the random hand generation gets really bogged down. I don't want to get into too many technical details as that isn't my point (get to it, bachfan!). My point is, there may be a tradeoff to be made in certain situations between "correctness" and speed. In fact, you can think of monte-carlo as just such a tradeoff. There may well be some psycho-fast algorithm out there that is almost-but-not-quite-entirely-correct that, for purposes of mass generation (ie, for creating a bot using neural networks or whatever), might be the right way to go. Just a thought, (babbling now) bachfan |
Re: 7 Card Hand Evaluators
Pstove does slow from about 100,000 million games a sec to about 1 game every 4 seconds (9 players on broadway, final player on random all).
Interesting behaviour. I looked at the code, and it seems that my method for selecting monte carlo hands is fairly inefficient. For those who are interested, in the monte carlo code I draw cards from an infinite deck for all the hands and then discard scenarios where two hands hold duplicate cards. Of course, when all the hands are drawn from a narrow distribution, this happens far too often. Like I said, it's not how fast you evaluate... [img]/images/graemlins/smile.gif[/img] Thanks for the info. I'll try and get a fix for that by the end of the year. - Andrew |
Re: 7 Card Hand Evaluators
[ QUOTE ]
I'v never really tried to make a fast general purpose evaluator. I wonder how fast I could make it? [/ QUOTE ] I must admit, the same thing occurred to me in the shower this morning. I even started coding up a new approach, but then I realized it was almost isomorphic to my existing one. Ooops. I did have a fun idea for a new way of evaluating omaha hands, which i coded up, but it turned out to be just about as fast as my existing code in most cases. Ooops again. I may come back to that at some point. - bachfan |
Re: 7 Card Hand Evaluators
[ QUOTE ]
Interesting behaviour. I looked at the code, and it seems that my method for selecting monte carlo hands is fairly inefficient. For those who are interested, in the monte carlo code I draw cards from an infinite deck for all the hands and then discard scenarios where two hands hold duplicate cards. Of course, when all the hands are drawn from a narrow distribution, this happens far too often. [/ QUOTE ] This is exactly the problem I was referring to a few posts back (sounds like we are taking the same approach here). I found some tricks for making things a bit faster in various cases, but I have yet to find a fast algorithm that generates the hands with the correct probability in these kinds of cases. I described the problem to my brother (a math professor at a major university), and the best he could come up with was "it sounds hard." [img]/images/graemlins/smile.gif[/img] Cheers, bachfan |
Re: 7 Card Hand Evaluators
Pretend we have two players that play only two hands:
AK or AA. First player: AK - 16 combos, AA 6 combos, total 22 First Players chance of playing AK is 16/22 First Players chance of playing AA is 6/22 Now assign the second player: If player 1 was assigned AK (p = 16/22), then Player 2: (Baysian updating) Plays AK with 9/12 probability Plays AA with 3/12 probability If player 1 was assigned AA (p = 6/22), then Player 2: (Baysian updating) Plays AK with 8/9 probability Plays AA with 1/9 probability Now what is Player 2's chance of playing AA (16/22)*(3/12) + (6/22)*(1/9) = 7/33 Now the problem: Player 1 and Player 2 had the same distributions. But 7/33 != 6/22. The problem is that assigning PLAYER 1 his distribution frist, gives player 2 an unequal chance of getting AA. The player most likely to be dealt pocket pairs, is the one where all the aces are in deck when he gets a card on his distribution. Notice that Player 2's chance of being distributed AA is less than Player 1, regardless of whether Player 1 was dealt AK or AA. (6/22 >> 3/12 or 1/9) A correct algorithm, would at the very least, have to give both players (with equal distributions) an equal chance of getting AA. Thus, dealing everyone random hands, and discarding until everyone gets a hand on their distribution is an unbiased, but albeit extremely slow method of getting the right answer. |
Re: 7 Card Hand Evaluators
[ QUOTE ]
Pretend we have two players that play only two hands: AK or AA. First player: AK - 16 combos, AA 6 combos, total 22 First Players chance of playing AK is 16/22 First Players chance of playing AA is 6/22 Now assign the second player: If player 1 was assigned AK (p = 16/22), then Player 2: (Baysian updating) Plays AK with 9/12 probability Plays AA with 3/12 probability If player 1 was assigned AA (p = 6/22), then Player 2: (Baysian updating) Plays AK with 8/9 probability Plays AA with 1/9 probability Now what is Player 2's chance of playing AA (16/22)*(3/12) + (6/22)*(1/9) = 7/33 Now the problem: Player 1 and Player 2 had the same distributions. But 7/33 != 6/22. The problem is that assigning PLAYER 1 his distribution frist, gives player 2 an unequal chance of getting AA. The player most likely to be dealt pocket pairs, is the one where all the aces are in deck when he gets a card on his distribution. A correct algorithm, would at the very least, have to give both players (with equal distributions) an equal chance of getting AA. Thus, dealing everyone random hands, and discarding until everyone gets a hand on their distribution is an unbiased, but albeit extremely slow method of getting the right answer. [/ QUOTE ] You are correct. If only you had written this earlier it would have saved me a few days of thought/work two years ago. [img]/images/graemlins/smile.gif[/img] I came up with a (relatively) fast way to generate random razz hands, but could not prove it was correct. So I in fact implemented the extremely boneheaded (but unambiguosly correct) algorithm you outlined above for comparison purposes. Took billions of hands to converge within 0.01% in some cases, but converge they did. - bachfan |
Re: 7 Card Hand Evaluators
yeah, took me longer than 2 days to figure out why player 1 kept beating player 2 through 10, when i assigned them all the same distributions [img]/images/graemlins/smile.gif[/img]
|
Re: 7 Card Hand Evaluators
[ QUOTE ]
[ QUOTE ] Phil why are you hostile? Did I ever say the world needed a poker stove that was 10,000 times faster? In fact, you gloss over the fact I said the exact opposite, because you want to pick a fight. [/ QUOTE ] Phil153 + Idiots = Flames Juk [img]/images/graemlins/smile.gif[/img] [/ QUOTE ] FYP. BTW, hand evaulation algorithms are not poker AI. |
Re: 7 Card Hand Evaluators
Please could you all run this test on your hand evaluators and let me know the results:
int c1, c2, c3, c4, c5, c6, c7; int handSetCounters[8] = {0,0,0,0,0,0,0,0}; for(c1 = 0; c1 < 52; c1++) { for(c2 = c1 + 1; c2 < 52; c2++) { for(c3 = c2 + 1; c3 < 52; c3++) { for(c4 = c3 + 1; c4 < 52; c4++) { for(c5 = c4 + 1; c5 < 52; c5++) { for(c6 = c5 + 1; c6 < 52; c6++) { for(c7 = c6 + 1; c7 < 52; c7++) { CALCULATE RANK CALCULATE SET ID (HIGH CARD TO STRAIGHT FLUSH) INCREMENT HANDSETCOUNTERS[SET ID] }}}}}}} PRINT HANDSETCOUNTERS If you could time the speed of your code in that scenario it would be most interesting! Also with a copy of your results (number of flushes etc incase your code is not designed to be 100% accurate). Thanks for anyone that participates! Tom |
Re: 7 Card Hand Evaluators
I've done the tests. It took some rewriting of my code to make your tests work, and i haven't yet checked them for accuracy.
Without the checksums i was getting 117,354,877 games per second. It took 1.14 seconds to process all 133,784,560 games in the loops. With the check sums, which i didn't spend time optimizing it took 1.71 seconds, for a speed of 78,236,584 games per second. The result of the check sums are as follows: In order from lowest hand to highest (hi-card, 1 pair, 2 pair, 3 kind, straight, flush, full house, four kind, to straight flush). 23294460 58627800 31433400 6461620 6180020 4047644 3473184 224848 41584 Let me know if you see errors in the checksum. I actually had to look at code that is no longer in my program to interpret my lookup tables, cause all my program knows now is that higher integer > better cards. I wrote a compression algorithm to make all the rankings fit on one integer, and had to decompress the results for your test, so its possible i could have made a mistake. Its also why the checksums almost double the time it takes for my program to resolve values. P.s. i know 117 million is faster than the 60 million i said earlier. My program is designed to do a lot more than just resolve hand values. I took out some of the overhead, for this test. |
Re: 7 Card Hand Evaluators
With these speeds you obviously have all your precalculated results in a single (very large) table, and nothing is calculated. The time for your algorithm is basically the time to increment the 7 counters(c1..c7), do one bitwise operation, look up the value in a a humongous table, and add the results.
This is incredibly simple to code if you don't mind a 200MB file on your hard file. It's actually easier to code than a 15 million hand/second algorithm, and far easier to code than an advanced and complex algorithm like PokerStove. If you used the same massive table in PokerStove, it'd probably run 5x faster than your code. |
Re: 7 Card Hand Evaluators
Phil - do i have lookup tables yes. The same way you have a calculator to look up multiplication, while you perform calculus. But you'd be kidding yourself if you think you could put all the results in one look up table. As I've already said such a table would be several Gigs in size - and extremely slow if you used a hardrive. Mine is 15 MB.
If you think i'm just pushing 7 counters, i'd be resolving about 6 to 9 billion games a second. Why is it you assume I'm only capable of coding a simple algorithms. My programming skills may be sub-par, but i've spent years studying game theory - so why is it u assume my algorithms "must" be simple? More specifically, why do you respond to everything with "BS" "idiot" an the like, is the fact the someone else can code something like this a "threat" to you? |
Re: 7 Card Hand Evaluators
[ QUOTE ]
If you could time the speed of your code in that scenario it would be most interesting! Also with a copy of your results (number of flushes etc incase your code is not designed to be 100% accurate). [/ QUOTE ] Gullanian, Here is my demo (210 Kb). http://www.pokerbolide.com/files/handeval7cards.exe Andrzej Nironen |
Re: 7 Card Hand Evaluators
D&L, congratulations, your numbers are correct and I am very impressed.
PokerBolide.com, wow. I am amazed. I thought I had the optimum solution, but you have out done me and months of work, im truly impressed. Congratulations both of you, I don't know how you do it but they seem to work superbly. |
Re: 7 Card Hand Evaluators
PokerBolide.com, wow, just running again and it's superb. My solution used look up tables, some faily large in size, and yours does not seem to at all. Superb.
|
| All times are GMT -4. The time now is 04:17 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.