Polynomial Learning utility.

Polynomial Learning. More...


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?

Detailed Description

Polynomial Learning.

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).


Define Documentation

#define AWIN   1
 

Value of an Alpha win.

#define BUF_SIZE   512
 

Buffer size.

#define BWIN   5
 

Value of a Beta win.

#define DRAW   0
 

Value of a draw.

#define NUM_COEF   3
 

Maximum value of a coefficient.


Function Documentation

static void _init int  argc,
char *  argv[]
[static]
 

Perform initialization for Polylearn.

Parameters:
argc int : sizeof argv[].
argv char * [] : command line arguments.
Returns:
void.

static void _usage void   )  [static]
 

Print usage message for Polylearn.

Returns:
void.

play int  alpha_first  ) 
 

Play a game between Alpha and Beta.

Parameters:
alpha_first int : flag - does Alpha go first?
Returns:
int.
Return values:
AWIN - Alpha won the game.
BWIN - Beta won the game.
DRAW - cat game.


Variable Documentation

a_coeff
 

Alpha coefficients.

b_coeff
 

Beta coefficients.

debug_1
 

Is the debug flag on?

n_flag [static]
 

Show games but do not play them?

o_move_1
 

Move chosen by get_move(). Used by learn().

session [static]
 

Maximum of PLAYOFF_LEN sessions.


Generated on Sat Sep 24 09:00:12 2011 for ScoreFour by  doxygen 1.4.5