b-inary / postflop-solver

[Development suspended] An efficient open-source postflop solver library written in Rust
GNU Affero General Public License v3.0
246 stars 97 forks source link

Example usage and solver tests are incorrect #44

Closed mhluska closed 1 year ago

mhluska commented 1 year ago

Is the target_exploitability arg of the solve method supposed to be a percentage like 0.005 (representing 0.5% EV) or is it supposed to be a big blind amount? Like pot_size * 0.005?

Reading through the code, it seems like it's supposed to just be a raw percentage like 0.005 but basic.rs is suggesting using a big blind amount:

let target_exploitability = game.tree_config().starting_pot as f32 * 0.005; // 0.5% of the pot

This has huge implications on the runtime of the software and would make it seem much faster than it is for people trying it out via the basic example.

In the tests, sometimes a percentage is directly used and other times its a percentage of the pot.

mhluska commented 1 year ago

Actually, I think I'm wrong and the exploitability arg is supposed to be a big blind amount. I'm not 100% sure but will close unless the author sees something off.

b-inary commented 1 year ago

Actually, the target_exploitability is assumed to be an absolute amount of chips. So if we want to use a percentage of the starting pot, we have to do the same as in examples/basic.rs (so the example is correct).

This confusing test only does a sanity check, and the parameter is actually a meaningless value (and also this test is not well maintained, because this feature was added by others than me). However, this is definitely confusing, so I will add a comment about it.

mhluska commented 1 year ago

Thanks for the reply. This helps a lot.