Files | |
| file | polylearn.c |
| Polynomial Learning - source file. | |
| file | polylearn.h |
| Polynomial Learning - header file. | |
Defines | |
| #define | BUF_SIZE 512 |
| Buffer size. | |
| #define | AWIN 1 |
| Value of an Alpha win. | |
| #define | BWIN 5 |
| Value of a Beta win. | |
| #define | DRAW 0 |
| Value of a draw. | |
| #define | NUM_COEF 3 |
| Maximum value of a coefficient. | |
Functions | |
| static void | _init (int argc, char *argv[]) |
| Perform initialization for Polylearn. | |
| static void | _usage (void) |
| Print usage message for Polylearn. | |
| int | play (int alpha_first) |
| Play a game between Alpha and Beta. | |
Variables | |
| MOVE | o_move_1 |
| Move chosen by get_move(). Used by learn(). | |
| int | debug_1 |
| Is the debug flag on? | |
| int | a_coeff [NUM_COEF] |
| Alpha coefficients. | |
| int | b_coeff [NUM_COEF] |
| Beta coefficients. | |
| static int | session |
| Maximum of PLAYOFF_LEN sessions. | |
| static int | n_flag |
| Show games but do not play them? | |
Apply the learning algorithm to PLAYOFF_LEN number of different sets of coefficients. Each coefficient set is viewed as a 3-tuple. PLAYOFF_LEN = (NUM_VALUES * NUM_VALUES * NUM_VALUES) and INTERVAL_SZ = (MAX_COEF / NUM_VALUES). Thus we can get a uniform distribution of 3-tuples by restricting coefficient values to be factors of INTERVAL_SZ.
usage: polylearn [-a] [-n] [-s] [-t 1|2]
-a : use aggression with polynomial. -n : show, but don't play, games. -s : starting session number. -t : apply trap heuristic (1 or 2).
|
|
Value of an Alpha win.
|
|
|
Buffer size.
|
|
|
Value of a Beta win.
|
|
|
Value of a draw.
|
|
|
Maximum value of a coefficient.
|
|
||||||||||||
|
Perform initialization for Polylearn.
|
|
|
Print usage message for Polylearn.
|
|
|
Play a game between Alpha and Beta.
|
|
|
Alpha coefficients.
|
|
|
Beta coefficients.
|
|
|
Is the debug flag on?
|
|
|
Show games but do not play them?
|
|
|
Move chosen by get_move(). Used by learn().
|
|
|
Maximum of PLAYOFF_LEN sessions.
|
1.4.5