Poker-AI.org Poker AI and Botting Discussion Forum 2014-03-12T12:59:46+00:00 http://poker-ai.org/phpbb/feed.php?f=26&t=2714 2014-03-12T12:59:46+00:00 2014-03-12T12:59:46+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2714&p=5828#p5828 <![CDATA[Re: ProPokerTools syntax language and range creation]]>
So, I finally managed to write the code to parse range input (this was actually quite easy using the Irony parser, only problem was the lack of documentation; I will maybe write a very basic tutorial for others once I get a little more familiar with it) and generate ranges (v1 of the code is pretty slow, will have to work on this a lot more I guess).

So now I have a range (= an array of ulongs representing hands) for each player and I want to compute equities, monte carlo style.

The problem I have now is that I do not know how to randomly select hands from ranges in a way that doesnt skew the other random selections.
Like if I have ranges (AA) vs (AA,KK) and I first randomly select a hand from range (AA), then randomly select a hand from range (AA,KK), check if there is no card overlap and if there is, I repeat the selection. Now it matters which range is the first to select from. If range (AA) is first, then range (AA,KK) will have AA much less often than if if were first to select from.

Hope you guys can help me out here.
Joe

EDIT: Seems that I solved the problem. Now the algorithm draws all hands again (not just the last one) in a loop until there is no card overlap. I havent thought it through enough to be 100% sure its the correct solution, but so far what I tried it gives the same results as ProPokerTools.

Statistics: Posted by JoeSham — Wed Mar 12, 2014 12:59 pm


]]>
2014-03-06T18:02:33+00:00 2014-03-06T18:02:33+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2714&p=5787#p5787 <![CDATA[Re: ProPokerTools syntax language and range creation]]> antlr.
Learning how to use a lexer/parser is definitely high up on my TODO list, I think a good start would be this course.

One thing to keep in mind that the learning curve for sth like antlr is, without doubt, much much harder than using a suboptimal approach like regex.

Statistics: Posted by Bliss — Thu Mar 06, 2014 6:02 pm


]]>
2014-03-06T08:31:33+00:00 2014-03-06T08:31:33+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2714&p=5786#p5786 <![CDATA[Re: ProPokerTools syntax language and range creation]]>
Don't know about the software you mentioned, but Openholdem uses the boost spirit parser library.

http://stackoverflow.com/questions/3241 ... he-grammar

Statistics: Posted by spears — Thu Mar 06, 2014 8:31 am


]]>
2014-03-06T01:31:45+00:00 2014-03-06T01:31:45+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2714&p=5785#p5785 <![CDATA[ProPokerTools syntax language and range creation]]> I just recently jumped into poker related programming (with just a little overall programming experience), so pardon my ignorance if my questions were already answered.

I decided to test my skills and create an omaha tool - evaluator, calculator, simulator, ... Basically working towards what PPT/Odds oracle is doing, minus a lot of things and plus some things. Not sure how far I will get obviously.

Right now I have a decent Omaha evaluator (originally based on the Keith Rule's library, but as it is now, most of the code is new, just often inspired or using same speed-ups etc.). After improving it over and over in the last couple days, I decided it is fast enough for now and I want to move on to other stuff.

So, what I want to do now is write parser code to translate submitted range strings into actual ranges. I want to start with ProPokerTools syntax (ie. AxKyxz:65+!TT or whatever) and hopefully improve it further in a similar manner to what PokerJuice uses (ie. 2p+, fd+, ...).

Atm I dont really know which way to go. I was thinking of trying to learn some language parser software, like Irony, but it seems like a lot of learning before I could use it well and I am not sure if I need something that robust. The other way is obviously to write my own simple parser, which is the way I started, but I am a bit lost tbh. Too many possible ways to do it and all of them seem quite difficult.

To simplify a couple more specific questions:
1. How to create ranges? Is it best to just compute all the hands that fit the criteria and store them in some big array? Or is it better to create ranges by combining range bit masks? Or some other way?
2. Am I better off writing my own parser or is this big enough task to rather learn to use Irony or some other robust parser?
3. How is PPT or PokerJuice code doing this?

Statistics: Posted by JoeSham — Thu Mar 06, 2014 1:31 am


]]>