![]() |
|
#211
|
|||
|
|||
|
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 |
|
#212
|
|||
|
|||
|
[ 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] |
|
#213
|
|||
|
|||
|
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]) |
|
#214
|
|||
|
|||
|
[ 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 |
|
#215
|
|||
|
|||
|
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?? |
|
#216
|
|||
|
|||
|
[ 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. |
|
#217
|
|||
|
|||
|
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 ? |
|
#218
|
|||
|
|||
|
[ 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! |
|
#219
|
|||
|
|||
|
thank you [img]/images/graemlins/wink.gif[/img] my program is almost 2 times faster now
|
|
#220
|
|||
|
|||
|
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.
|
![]() |
|
|