Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #211  
Old 05-10-2007, 10:14 AM
advis0r advis0r is offline
Member
 
Join Date: Apr 2007
Location: Southern Germany
Posts: 99
Default Re: 7 Card Hand Evaluators

does anyone know a java implementation of an equity calculator for given hands and a board? optional features: allows Ranges like TT+ and AQs+, is fast [img]/images/graemlins/wink.gif[/img]

i know that there is a poker-eval project, but i have no clue how to compile a DLL that i can call out of java OR use the java native interface to call c functions directly (im too stupid to compile those ;D)

thx in advance
Reply With Quote
  #212  
Old 05-10-2007, 10:19 AM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: 7 Card Hand Evaluators

[ QUOTE ]
i know that there is a poker-eval project, but i have no clue how to compile a DLL that i can call out of java OR use the java native interface to call c functions directly (im too stupid to compile those ;D)

[/ QUOTE ]
The JNI is incredibly easy to use and has a very good tutorial to follow. It pretty much writes all the code stubs and creates the DLL project for you - all you have to do is fill in the functionality and then hit built and you're done. If if you are a Java programmer and not a C/C++ programmer, your knowledge of Java syntax and a quick read of some FAQ about the differences should be enough to interface some C/C++ code via the JNI.

Juk [img]/images/graemlins/smile.gif[/img]
Reply With Quote
  #213  
Old 05-10-2007, 10:34 AM
advis0r advis0r is offline
Member
 
Join Date: Apr 2007
Location: Southern Germany
Posts: 99
Default Re: 7 Card Hand Evaluators

thanks for the reply, i know the JNI isnt that difficult to use (tutorial etc) but the problem is the compilation itself (when i use functions defined in the poker-eval library).

i would spend some hours figuring it all out but first i was gonna ask if something that is ready-to-use is available already [img]/images/graemlins/wink.gif[/img]

http://svn.gna.org/viewcvs/pokersour...ker-eval/java/
here are some java to pokereval bindings via JNI but when i tried to get it running real quick i failed (not keen with make scripts).
the java code there also has support for hand ranges etc. which is pretty neat - so if nobody has something for me already, i might invest some time and make it work [img]/images/graemlins/smile.gif[/img]

(i think it could improve the AllinCalc performance a lot if i dont have to run pokenum.exe and parse its output [img]/images/graemlins/laugh.gif[/img])
Reply With Quote
  #214  
Old 05-10-2007, 12:26 PM
Steve Brecher Steve Brecher is offline
Member
 
Join Date: Sep 2004
Posts: 45
Default Re: 7 Card Hand Evaluators

[ QUOTE ]
does anyone know a java implementation of an equity calculator for given hands and a board? optional features: allows Ranges like TT+ and AQs+, is fast [img]/images/graemlins/wink.gif[/img]

[/ QUOTE ]Sorry, no optional features:
http://www.stevebrecher.com/Software/software.html
Reply With Quote
  #215  
Old 05-10-2007, 02:27 PM
advis0r advis0r is offline
Member
 
Join Date: Apr 2007
Location: Southern Germany
Posts: 99
Default Re: 7 Card Hand Evaluators

Hello Steve,

Thanks for your Code [img]/images/graemlins/smile.gif[/img]
Problem: Your Enumerator Class has Package visibility and thus isnt directly usable for other java programs. I did copy your source into my own files for this little Test:

http://nopaste.byte-welt.de/view.php?id=357

output:
[ QUOTE ]
WINS: [1140, 186]
TIED: [0, 0]
PaPo: [0.0, 0.0]

[/ QUOTE ]

while pokerstove and pokenum give me other results:
[ QUOTE ]
990 games 0.005 secs 198,000 games/sec

Board: 2c 7d Ts
Dead:

equity win tie pots won pots tied
Hand 0: 91.616% 91.62% 00.00% 907 0.00 { AcAs }
Hand 1: 08.384% 08.38% 00.00% 83 0.00 { KdKh }

[/ QUOTE ]

[ QUOTE ]
Holdem Hi: 990 enumerated boards containing Ts 2c 7d
cards win %win lose %lose tie %tie EV
As Ac 907 91.62 83 8.38 0 0.00 0.916
Kd Kh 83 8.38 907 91.62 0 0.00 0.084

[/ QUOTE ]

did I do anything wrong in my little piece of code?
and why do the printed results change if I change the instance and number of thread parameters for Enumerator??
Reply With Quote
  #216  
Old 05-10-2007, 03:14 PM
Steve Brecher Steve Brecher is offline
Member
 
Join Date: Sep 2004
Posts: 45
Default Re: 7 Card Hand Evaluators

[ QUOTE ]
... I did copy your source into my own files for this little Test:

http://nopaste.byte-welt.de/view.php?id=357

output:
[ QUOTE ]
WINS: [1140, 186]
TIED: [0, 0]
PaPo: [0.0, 0.0]

[/ QUOTE ]

while pokerstove and pokenum give me other results:
[...]
did I do anything wrong in my little piece of code?

[/ QUOTE ]Sorry, I can't go over your code just now. Here's the output from the code downloaded from my site:
<font class="small">Code:</font><hr /><pre>
Known hole cards; two per player: acaskdkh
Number of players with unknown hole cards (0 to 2) [0]:
Known board cards [none]: 2c7dts
Dead/exposed cards [none]:
990 deals required. Start dealing? (y/n) [y]:

AcAs KdKh
% chance of outright win 91.616162 8.383838
% chance of win or split 91.616162 8.383838
expected return, % of pot 91.616162 8.383838
fair pot odds:1 0.091510 10.927711
pots won: 907.00 83.00
</pre><hr />[ QUOTE ]
and why do the printed results change if I change the instance and number of thread parameters for Enumerator??

[/ QUOTE ]Because your parameters are "lies"? The parameters must reflect the number of threads; each of n enumeration threads does 1/n of the work. For thread creation and use, see Showdown.java.
Reply With Quote
  #217  
Old 05-10-2007, 06:27 PM
advis0r advis0r is offline
Member
 
Join Date: Apr 2007
Location: Southern Germany
Posts: 99
Default Re: 7 Card Hand Evaluators

thx for the reply...
if you would have taken a quick look at the 22 lines of code i posted, u could have told me earlier that i have to remove the used cards from the deck [img]/images/graemlins/wink.gif[/img]

nevermind it seems to work well now [img]/images/graemlins/smile.gif[/img] do you plan to upload a newer version with a public Enumerator class or am i allowed to "copy" this part of your sourcecode ?
Reply With Quote
  #218  
Old 05-10-2007, 06:32 PM
Steve Brecher Steve Brecher is offline
Member
 
Join Date: Sep 2004
Posts: 45
Default Re: 7 Card Hand Evaluators

[ QUOTE ]
do you plan to upload a newer version with a public Enumerator class or am i allowed to "copy" this part of your sourcecode ?

[/ QUOTE ]Copy at will!
Reply With Quote
  #219  
Old 05-10-2007, 08:22 PM
advis0r advis0r is offline
Member
 
Join Date: Apr 2007
Location: Southern Germany
Posts: 99
Default Re: 7 Card Hand Evaluators

thank you [img]/images/graemlins/wink.gif[/img] my program is almost 2 times faster now
Reply With Quote
  #220  
Old 05-20-2007, 03:07 PM
StickGuy StickGuy is offline
Junior Member
 
Join Date: May 2007
Posts: 1
Default Re: 7 Card Hand Evaluators

The number of unique 6 card IDs can be reduced from about 350,000 to about 280,000 by setting the rank of cards that won't factor into the final hand to 0. If the hand is already a flush, for example, any non-suited cards will be irrelevant. This is the single biggest reduction, but smaller ones can be made for four of a kind, full houses, flushes and straights.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.