ICM Calculator

March 1, 2010 at 05:46:41
Specs: Windows 7, n/a
hey all,

I'm not a programmer but wanted to get a programmers opinion on something?

The below link brings you to whats called an ICM calculator. I would like to create a Java app or any format that will run on a windows system.

Is it possible to create such a program? and can the source be taken from this site or does it need to be written from scratch?

http://www.holdemresources.net/hr/s...

Thanks


See More: ICM Calculator

Report •

#1
March 1, 2010 at 07:51:38
this looks "ready to use" java script:
http://www.holdemresources.net/hr/s...
----------------- content: -----------------


/**
* \param payouts Payout structure, e.g.: new double[]{0.5,0.3,0.2}
* \param stacks Player stacks
* \param player Index of selected player in the stack-array
* \returns ICM equity for selected player
*/
public static double getEquity ( double [] payouts, double [] stacks, int player )
{
double total = 0 ;
for ( int i = 0 ; i < stacks.length; i++ )
total += stacks [ i ] ;
return getEquity ( payouts, stacks.clone () , total, player, 0 ) ;
}

//Recursive method doing the actual calculation.
private static double getEquity ( double [] payouts, double [] stacks, double total, int player, int depth )
{
double eq = stacks [ player ] / total * payouts [ depth ] ;

if ( depth + 1 < payouts.length )
for ( int i = 0 ; i < stacks.length; i++ )
if ( i != player && stacks [ i ] > 0.0 ) {
double c = stacks [ i ] ;
stacks [ i ] = 0.0 ;
eq += getEquity ( payouts, stacks, total - c, player, depth + 1 ) * c / total;
stacks [ i ] = c;
}

return eq;
}

Code converted with Java2html (java2html.de).


Report •

#2
March 1, 2010 at 09:11:48
its really this bit im worried about:

"As long as all players have >0 chips, the implementation above is correct. This will be fine for most use-cases. For a fully fledged ICM implementation, we would have to deal with some special cases that bloat up the code considerably. e.g.: How to correctly deal with multiple players having zero chips"

sounds like it wouldn't be as functional as the one on the site


Report •
Related Solutions


Ask Question