Image Image Image Image Image Image




Post new topic Reply to topic  [ 174 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9
Author Message
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Thu Apr 22, 2010 5:56 pm 
Offline
Junior member
User avatar

Posts: 10
Favourite Bot: Johnny 5
LOL, oh the shame...

Simply added a global.

Code:
unsigned char * nBitsAndStrTable;


Code:
This hand will beat 49.9006% of opponents at showdown.


Fairly new to C++, typical as soon as you post you solve it.


Top
 Profile E-mail  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Fri Apr 23, 2010 3:35 pm 
Offline
PokerAI fellow
User avatar

Posts: 665
Location: Midwest, USA
Favourite Bot: N/A
dojopoko wrote:
LOL, oh the shame...

Simply added a global.

Code:
unsigned char * nBitsAndStrTable;

Uh, you're building a pretty ugly habit there. PSim isn't using nBitsAndStrTable just for fun, it actually needs some information from it. Your defining it is only turning a compile time error into a run time error (although your test of one function call doesn't trip it).

Now, I am going from old memories here, but I believe you haven't compiled poker-eval correctly. I think you have to compile some program in poker-eval, and then run it and it produces the file that defines nBitsAndStrTable. I don't remember the name of that program right off, but it's code should be included with poker-eval. Once this extra source file is created, you'll need to include it with your compilation of the poker-eval library.

In any case, defining variables to fix linker errors is pretty heinous. :lol:


Top
 Profile  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Fri Apr 23, 2010 10:37 pm 
Offline
Junior member
User avatar

Posts: 10
Favourite Bot: Johnny 5
Hi Timmy,

Yes I've ran into this problem now, as using your GetHandState it always tells me I have two pair, regardless of the cards :)
That poker-eval isn't the most friendly to compile in VS 2010, crashed the linker on one go...


Top
 Profile E-mail  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Mon May 03, 2010 7:31 pm 
Offline
Senior member
User avatar

Posts: 381
Favourite Bot: gimmick
Sorry for the question.

Does this library allow, to a Java programmer, equity calculation given specific distribution of opponent hole cards?
If not, does the Java API for PokerSource allow it? If so, is it reliable even if it is no longer maintained (it's not in the latest releases of PokerSource)?

Are there other libraries for doing that?

Note: i'm interested in hand *distribution*, not just hand list (like PokerStove does).


Top
 Profile E-mail  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Tue May 04, 2010 4:11 pm 
Offline
PokerAI fellow
User avatar

Posts: 665
Location: Midwest, USA
Favourite Bot: N/A
Neither PSim nor poker source will do what you want out of the box. Either could be used as a starting point for you, however.

To make a poor man's calculation over a distribution of opponents' hole cards, simply run a separate evaluation for each possible hand in your hand distribution list, then make a weighted average based on your likelihood that your opponent holds those card.

Coding the Wheel did a neat series of articles a while back you may find interesting. Link.


Top
 Profile  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Mon Jun 28, 2010 11:20 pm 
Offline
New member
User avatar

Posts: 3
Favourite Bot: Botage
Hi Timmy, superb library thanks.

I have a question which I cannot find the answer to in this thread.

Can I use a bitwise operation on the number returned by RankHand to determine if I have a pair or top pair, full house etc...(If so how to I know the flags to test against?) or is it necessary to use GetHandState.

Thanks


Top
 Profile E-mail  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Mon Jul 05, 2010 1:52 am 
Offline
New member
User avatar

Posts: 3
Favourite Bot: Botage
Perhaps I can put my question in a different fashion.

What do the numbers returned by Rankhand represent ?


Top
 Profile E-mail  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Mon Jul 05, 2010 7:49 pm 
Offline
PokerAI fellow
User avatar

Posts: 665
Location: Midwest, USA
Favourite Bot: N/A
RankHand just returns the strength of a hand. A higher number beats a lower number. You can pass it any number of cards. If two hands tie, it'll return the same number for both.

It's probably possible to glean more information for the result, but that's not its purpose.

If you want to know if you have a pair, two pair, etc, then use the GetHandState() function. See the documentation of struct PostFlopState in psim.hpp.


Top
 Profile  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Tue Jul 06, 2010 4:08 am 
Offline
New member
User avatar

Posts: 3
Favourite Bot: Botage
I thought as much, just being a little optomistic.

Thanks for the clarification.

It was just the Autoit example in the thread that threw me.


Top
 Profile E-mail  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Sat Jul 10, 2010 8:24 am 
Offline
New member
User avatar

Posts: 4
Favourite Bot: pokerai
Cool, my main remark is that better expose int[] APIs (i.e pass the hands with their ordinal values, not string). I myself convert the cards to ints immediately when I read them, and use that along. So if you want to implement HL function in java that use hand eval, you need to pass ints for speed. You can either expose the same functions with int[], or double-implement the string to int in java, and expose only the int methods.

_________________
m3i zero


Top
 Profile E-mail  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Sat Jul 10, 2010 7:15 pm 
Offline
PokerAI fellow
User avatar

Posts: 665
Location: Midwest, USA
Favourite Bot: N/A
Actually, almost all of the functions expose both int and string versions. Look at psim.hpp for some documentation.

Insisting on passing only ints for speed is kind of silly though, when we're talking about enumerating a few million hands for evaluation internally.


Top
 Profile  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Mon Jul 12, 2010 9:34 pm 
Offline
New member
User avatar

Posts: 1
Favourite Bot: mine
Thought I should give something back.
I created a Autohotkey frontend to call psim.
it consist of two files
psimdef.ahk : functions that call and interpret structures to/from psim.dll
psim_gui : the frontend that calls psimdef

psim.dll must be on same directory (or you have to change the code)

I included an exe for those that don't have autohotkey installed.

This should give you an idea : http://img31.imageshack.us/img31/920/psimwrap.jpg
Image
You can click the cards to fill the hand

This is my first post so, if the picture too big or something, plz forgive me


Attachments:
psim_ahk.zip [225.85 KB]
Downloaded 68 times
Top
 Profile  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Wed Jul 14, 2010 5:33 pm 
Offline
PokerAI fellow
User avatar

Posts: 665
Location: Midwest, USA
Favourite Bot: N/A
Thanks for sharing your code, Gc66. I think your GUI is a good way for people to get a feel for how PSim works and what it's capable of.

Just as a note to anyone trying it: you'll need to copy PSim.dll into the same folder as Gc66's script.


Top
 Profile  
 
 Post subject: Re: Timmy's Poker Sim Library (PSim) Examples in C, Java, AutoIt
PostPosted: Fri Aug 13, 2010 7:45 am 
Offline
New member
User avatar

Posts: 1
Favourite Bot: Pokerai
Thanks your sharing this Gc66 !!. Im working in a wrapper in C# for psim and that will help a lot..
Regards


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 174 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9


Who is online

Users browsing this forum: Ciclone, Google, Yahoo and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: