Image Image Image




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Fri Jul 18, 2008 4:15 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
We have ported the ICM Calculator (ICM.cs) and the NashCalculator that is using it (calcRanges.cs) to Java. There is also a Test class that includes two examples (they are also illustrated below). If you are a Java programmer, getting into it is just straightforward.

Note: Only the logic was ported, and not the GUI or the scrapers. The screenshot examples that you see below are from the standard SNGEGT.


Attachment:
SNGEGT-Java.rar [343.01 KB]
Downloaded 1044 times



Example 1
Attachment:
PushExample.PNG
PushExample.PNG [ 39.45 KB | Viewed 8313 times ]


Example 2
Attachment:
CallExample.PNG
CallExample.PNG [ 38.97 KB | Viewed 8314 times ]


Code:
public class Test {

  public static void main(String[] args) {
    CalcRanges cr = new CalcRanges();

    // Example 1
    int players = 7;
    double[] payouts = {0.50, 0.30, 0.20, 0, 0, 0, 0};
    int[] stacks = {5000, 5000, 5000, 5000, 5000, 5000, 5000};
    int[] ranges = new int[players]; // stores the result
    int raisor = 2;  // my position when there is no raised before me
    int BB = 300;
    int ante = 0;
    boolean noSmallBlind = false;
    double evTreshold = 0;
    cr.calc(players, stacks, raisor, BB, ante, noSmallBlind, evTreshold, payouts, ranges);
    System.out.println("Push Example (#1): ");
    for (int i = 0; i < players; i++) System.out.println("#" + i + ": " + ranges[i] + "% ");
    System.out.println();
   
    // Example 2
    players = 7;
    payouts = new double[]{0.50, 0.30, 0.20, 0, 0, 0, 0};
    stacks = new int[]{5000, 5000, 5000, 5000, 5000, 5000, 5000};
    ranges = new int[players]; // stores the result
    raisor = 5;  // my position when there is no raised before me
    BB = 300;
    ante = 0;
    noSmallBlind = false;
    evTreshold = 0;
    cr.calc(players, stacks, raisor, BB, ante, noSmallBlind, evTreshold, payouts, ranges);
    System.out.println("Call Example (#2): ");
    for (int i = 0; i < players; i++) System.out.println("#" + i + ": " + ranges[i] + "% ");
    System.out.println();
  }

}

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Sat Oct 25, 2008 10:57 am 
Offline
PokerAI fellow
User avatar

Posts: 1673
Favourite Bot: none
I have two things that need to be mentioned:

I compared a couple of results of this port with the results I get from the ICM Nash Calculator over at HoldemRessources and got surprisingly different results. Not by much but sometimes up to 3 percentage points which results in handranges that (when played against each other) have 51:49 or even 52:48 matchup results.
Thats a lot imo. Or does this not matter??

Also I would like to see an overcalling range cause from my understanding so far this can not be calculated yet. Would this be so hard to implement?

_________________
Cheers.


Top
 Profile  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Sat Oct 25, 2008 11:25 am 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Can you give exact example, and also to what exactly did you compared with?

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Sat Oct 25, 2008 11:51 am 
Offline
PokerAI fellow
User avatar

Posts: 1673
Favourite Bot: none
Okay. I used this http://www.holdemresources.net/hr/sngs/icmcalculator.html calculator to check the results.

For the two examples up there we get the following results:

Example 1:
BU pushes 27%, SB and BB each call with 7% ranges according to sngegt
BU pushes 26.4%, SB calls 7.1%, BB calls 8.0% ranges according to HR's calculator

Example 2:
CO+2/UTG+1 (same thing here) pushes 6%, CO+1(/UTG+2), CO, BU, SB call 3%, BB calls 4% according to sngegt
UTG+1 pushes 9.8%, UTG+2, CO, BU call 2.3%, SB and BB call 2.6% according to HR

Example 3:
4 Players (BB=4000, SB=3000, BU=2000, CO=1000)
BU pushes:
Code:
// Example 3
    players = 4;
    payouts = new double[]{0.50, 0.30, 0.20, 0};
    stacks = new int[]{4000, 3000, 2000, 1000};
    ranges = new int[players];
    raisor = 2;
    cr.calc(players, stacks, raisor, BB, ante, noSmallBlind, evTreshold, payouts, ranges);
    System.out.println("Call Example (#3): ");
    for (int i = 0; i < players; i++) System.out.println("#" + i + ": " + ranges[i] + "% ");
    System.out.println();


OUTPUT:

iPlayers: 4
iRaiserIndex: 2
iBB: 300
6 5 8 3 Call Example (#3):
#0: 11%
#1: 7%
#2: 21%

means BU pushes 21%, SB calls 7%, BB 11% according to sngegt
BU pushes 24.3%, SB calls 7.1%, BB calls 12.4% according to HR


Now what I was talking about in the match up is this:
21% range vs. 24.3% range is about 51.5% vs. 48.5% winning chance.

_________________
Cheers.


Top
 Profile  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Sat Oct 25, 2008 12:05 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Have to look into that, but basically often even a large looking differences (like 3%) in the played ranges make no huge difference in the EV. Usually best is to check and compare out what's the EV displayed by both tools.

Both programs do approximation - so they are supposed to have some differences. Not that big, I guess.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 4:36 pm 
Offline
PokerAI fellow
User avatar

Posts: 1673
Favourite Bot: none
I didnt get the chance to check the EVs of both outputs in the last couple of days.
Did you investigate that matter some more?

Also is it possible to calculate an Overcalling range with this with just minor changes to the code?

_________________
Cheers.


Top
 Profile  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 5:47 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
I did not have time either, what is meant by "overcalling range"?

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 5:53 pm 
Offline
PokerAI fellow
User avatar

Posts: 1673
Favourite Bot: none
This program gives us pushing ranges as well as calling ranges (both indicated by the raisor position, the range given for raisor is his pushing range and the other ranges are calling ranges).
Now if I want t know what to do if BU pushes, SB calls (I have both ranges with what hands they should do that already from the program) but now I am in the BB and would liek to know with what hands I can also put all my chips in the middle.

Basically an overcall is a call (for all of Heros or villains chips) after one player has pushed and another has called that push in front of Hero.

_________________
Cheers.


Top
 Profile  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 6:07 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
So it is a special scenario of non jam/fold play. You can think (obviously) of others - obviously if someone limped in front of you, raised etc.

That would then be a search for a general NEQ - which is much more computationally complex.

Fast patch (workaround) on the 'defensive side' would be to ignore the call - i.e. just count the calling player as one that still has to act (and ignore the money he put it). This will make you play tighter than optimal.

The other possibility is to count his money as dead money - then you will assume he has ANY cards, why in reallity he won't call with ANY cards. In this scenario you will play looser than optimal.

You can also go for something 'in the middle', another heuristic. But as you can see, there is no "clean" solution (at least I can't see it).

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 7:03 pm 
Offline
PokerAI fellow
User avatar

Posts: 1673
Favourite Bot: none
Well it is part of a jam/fold tactic imo.
Its just that a player in front (or more: two) also play push or fold. Or is is jam or fold always fold if more than one player is in the pot already?

Also your assumption that one would call tighter by just ignoring him is wrong imo. If we know that this player (that already called) plays somewhat ICM-style, which I assume at the levels I want to play, then he will call with a range that is strong enough to beat the pushers range. therefore we would need an even stronger hand to beat this player aswell, therefore a range that only takes the pusher into account would be to loose.

For an example of OC ranges for my Example #3 see this:
http://www.holdemresources.net/hr/sngs/icmcalculator.html?action=calculate&bb=300&sb=150&ante=0&structure=0.5%2C0.3%2C0.2&s1=1000&s2=2000&s3=3000&s4=4000&s5=&s6=&s7=&s8=&s9=

The table should be self explaining.

Edit: Against a limp I would probably push just a couple of percent tighter than calculated and against a raise I would probably push just a little lighter than as if he had pushed. I have to re-read some strategy parts about that when I get to coding this. But this should solve those two scenarios. Same goes for more than one player, e.g. raise, call -> adjust the range according to some values, each caller of a raise makes us 10% tighter or whatever.
You get the idea, I think that should result in a pretty good strategy for bubble play and super-turbos.

_________________
Cheers.


Top
 Profile  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 7:29 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Coffee4tw wrote:
Well it is part of a jam/fold tactic imo. Its just that a player in front (or more: two) also play push or fold.


But the player in front of you didn't pushed his whole stack - but only called the previous pusher (which is no longer push/fold)?

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 7:44 pm 
Offline
PokerAI fellow
User avatar

Posts: 1673
Favourite Bot: none
Well you can generally take this as a push, because:

if the caller has a smaller or equal stack to the pusher: he is allin
if the caller has a stack slightly (up to 30%) bigger than the pusher: he will push allin because it makes no real difference
if the caller has a stack way bigger than the pusher: he will most likely push allin as part of what is called an isolation move or he will just call
then we have two other scenarios:
the bet has us already covered or we have a slightly bigger stack: well this is an allin for us again
the bet doent have us covered at all

thats the only case where this is not jam/fold: pusher with a small stack, caller only calls and has like us a much bigger stack then the pusher, in either way this should be considered a jam/fold play because that case happens not very often, and if it does: well, still the same things apply: we should push tighter than if we were just calling the pusher because of that other caller, that already has the range for calling etc pp.

This should maybe go on the SNG strategy subforum aswell somehow...
Anyway just in general: calling a pusher generally means going allin, rather than just calling if we have a bigger stack.

_________________
Cheers.


Top
 Profile  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 8:07 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Well the case you ended to was the one bothering me. The rest make sense. Still, I wouldn't go to just patch that.

How frequent is the occurence of such situation? It shouldn't be more frequent than a caller in front of you (And well, ok, in most of the cases it's jam/fold - btu these kind of expert 'precalculations' you can do as well, right - before the ICM calls - i.e. just see what the case is, and adjust the money before the ICM call).

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 8:40 pm 
Offline
PokerAI fellow
User avatar

Posts: 1673
Favourite Bot: none
Adjust the money how? You mean stack sizes?

_________________
Cheers.


Top
 Profile  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Tue Oct 28, 2008 8:50 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Yes - stack sizes.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Question regarding use
PostPosted: Fri Dec 26, 2008 3:05 pm 
Offline
Senior member
User avatar

Posts: 138
Favourite Bot: the one I'm building
<Place at the end of the java port thread if more appropriate, I opted to place it here as not to go off-topic there>

I'm trying to use the java port of ICM and I'm having trouble understanding how to use it reading the code (Test mainly):

First, I don't understand how to specify the button location and second I don't understand how to specify actions already taken (what if somebody pushes in front of us?). I think it has something to do with the following:

Code:
    int raisor = 2;  // my position when there is no raised before me


But what does this mean exactly? Is this the index of the person that raised in front of us? If so, what index are we and where do we start counting? How do specify multiple pushes?

As you can see I'm having a bit of trouble comprehending how to capture the current game-state in the variables you are using :).


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Fri Dec 26, 2008 4:38 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Check also that one: http://pokerai.org/pf3/viewtopic.php?f=58&t=836

If you specify the raisor different than yoru position, then you will have a raise before you (the SNGEGT will calculate his push range, i.e. the optimal range this guy would push). Now, that we have a pusher in front of us - for everyone behind we calculate the optimal call range.

So for us - we would have an optimal call range - what we look anyway. If our stack is bigger (than the pusher in front of us), then it becomes more tricky (i.e. the SNGEGT will not calculate the stuff correctnly I think). So for us it is assumed that when there is a raisor in from of us, then our optimal call range = optimal push range.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Fri Dec 26, 2008 5:20 pm 
Offline
Senior member
User avatar

Posts: 138
Favourite Bot: the one I'm building
Ok I think I understand the positioning now. The order is quite weird however:

#0: BB
#1: SB
#2: Button
#3: CO
#4: MP
#5: MP
#6: MP
#7: LP
#8: LP
#9: LP

quite an odd order but who cares. Is this correct?

Secondly, in the GUI I see how to specify the HERO position. If HERO==initial raiser then we face a pushing dilemma. However, I still don't get how we specify the Hero position in the function call.


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Fri Dec 26, 2008 6:28 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Yeah - the order is like in the GUI.

wachtwoord wrote:
Secondly, in the GUI I see how to specify the HERO position. If HERO==initial raiser then we face a pushing dilemma. However, I still don't get how we specify the Hero position in the function call.

You don't specify hero position in the function call when there is raisor in-front - cause hero's position is not needed for this calculation. You only specify the raisor position. ALL callers values (including heros imaginary one) are calculated anyway - so just "know" your heros position and check it once you get the result.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: SNGEGT: Java port of ICM and Nash Calculators
PostPosted: Fri Dec 26, 2008 7:01 pm 
Offline
Senior member
User avatar

Posts: 138
Favourite Bot: the one I'm building
Thanks a lot for being patient with me, I don't know why I didn't get this earlier :|

I get it now though :P


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 2 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: