More reading brought up a question about the random generation of the
cards.
>From looking at the poker-eval source code I noted that:
DECK_MONTECARLO_N_CARDS_D and DECK_MONTECARLO_PERMUTATIONS_D do not
produce unique random decks.
To force a new random deck every time these #defines are used, I
modified them to do a srand( value ) every time they are called.
To produce the argument for srand, I used read /def/urandom.
The following is my modified version of #define
DECK_MONTECARLO_N_CARDS_D found in includes/enumerate.h
#define DECK_MONTECARLO_N_CARDS_D(deck, cards_var, dead_cards, \
num_cards, num_iter, action) \
\
int value = 0; \
read((open("/dev/urandom", O_RDONLY)), &value, 4); \
srand( value); \
\
do { \
int _i, _j, _c; \
\
for (_i=0; _i<num_iter; _i++) { \
deck##_CardMask _used; \
_used = dead_cards; \
deck##_CardMask_RESET(cards_var); \
for (_j=0; _j<num_cards; _j++) { \
do { \
_c = RANDOM() % deck##_N_CARDS; \
} while (deck##_CardMask_CARD_IS_SET(_used, _c)); \
deck##_CardMask_SET(cards_var, _c); \
deck##_CardMask_SET(_used, _c); \
} \
{ action }; \
}; \
} while (0)
To modify the #define DECK_MONTECARLO_PERMUTATIONS_D the same approach
was taken.
NOTE: By doing this, the tests provided in the poker-eval tree will
fail if the compiled code uses these #define .....
That is because the results will change every time you test. The change
will be small, but it will not match perfectly.
As an example:
el...@elmer-desktop:~/poker-eval/examples$ ./pokenum -mc 100000 -h Ac 7c
- 5s 4s - Ks Kd
Holdem Hi: 100000 sampled boards
cards win %win lose %lose tie %tie EV
Ac 7c 27250 27.25 72422 72.42 328 0.33 0.274
5s 4s 19982 19.98 79690 79.69 328 0.33 0.201
Ks Kd 52440 52.44 47232 47.23 328 0.33 0.525
el...@elmer-desktop:~/poker-eval/examples$ ./pokenum -mc 100000 -h Ac 7c
- 5s 4s - Ks Kd
Holdem Hi: 100000 sampled boards
cards win %win lose %lose tie %tie EV
Ac 7c 27354 27.35 72331 72.33 315 0.32 0.275
5s 4s 20037 20.04 79648 79.65 315 0.32 0.201
Ks Kd 52294 52.29 47391 47.39 315 0.32 0.524
Note that running the same thing produces different results.
This means that the shuffling of the deck produces different results
every time the #define DECK_MONTECARLO_PERMUTATIONS_D is used.
Anyhow, that is what I think.
> Message: 1
> Date: Mon, 09 Aug 2010 14:37:51 -0500
> From: Elmer Fittery <[email protected]>
> Subject: [Pokersource-users] LOKI negative/positive hand potential
> To: [email protected]
> Message-ID: <1281382671.2484.12.ca...@elmer-desktop>
> Content-Type: text/plain; charset="UTF-8"
>
> http://webdocs.cs.ualberta.ca/~jonathan/Grad/papp/node40.html
>
> I read this section of the university of alberta's documentation
> on hold'em poker.
>
> Hand Potential is something I would like to empliment using the
> poker-eval library.
>
> Before I start, is there anybody out there that has written a program to
> do this?
>
> The basic idea is to use your hold cards and if they exist any board
> cards as input.
>
> Then iterate through all the available cards to determine your hands
> potential to improve or degrade.
>
> Ideas or suggestions would be appreciated.
>
>
>
>
> ------------------------------
>
> _______________________________________________
> Pokersource-users mailing list
> [email protected]
> https://mail.gna.org/listinfo/pokersource-users
>
>
> End of Pokersource-users Digest, Vol 51, Issue 2
> ************************************************
_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users