My Project
eval.h File Reference

Go to the source code of this file.

Classes

struct  Eval
 evaluation function More...
 

Typedefs

typedef struct Eval Eval
 evaluation function
 

Functions

void eval_open (const char *)
 Load the evaluation function features' weights.
 
void eval_close (void)
 Free global resources allocated to the evaluation function.
 
void eval_init (Eval *)
 Initialize a new evaluation function.
 
void eval_free (Eval *)
 Free resources used by the evaluation function.
 
void eval_set (Eval *, const struct Board *)
 
void eval_update (Eval *, const struct Move *)
 
void eval_restore (Eval *, const struct Move *)
 
void eval_pass (Eval *)
 Update/Restore the features after a passing move.
 
double eval_sigma (const int, const int, const int)
 Compute the error-type of the evaluation function according to the depths.
 

Variables

short *** EVAL_WEIGHT
 

Detailed Description

Evaluation function's header.

Date
1998 - 2017
Author
Richard Delorme
Version
4.4

Typedef Documentation

◆ Eval

typedef struct Eval Eval

evaluation function

struct Eval

Function Documentation

◆ eval_close()

void eval_close ( void )

Free global resources allocated to the evaluation function.

◆ eval_free()

void eval_free ( Eval * eval)

Free resources used by the evaluation function.

Parameters
evalEvaluation function.

◆ eval_init()

void eval_init ( Eval * eval)

Initialize a new evaluation function.

Allocate space to store the state of the evaluation function.

Parameters
evalEvaluation function.

◆ eval_open()

void eval_open ( const char * file)

Load the evaluation function features' weights.

The weights are stored in a global variable, because, once loaded from the file, they stay constant during the lifetime of the program. As loading the weights is time & resource consuming, a counter variable check that the weights are effectively loaded only once.

Parameters
fileFile name of the evaluation function data.

◆ eval_pass()

void eval_pass ( Eval * eval)

Update/Restore the features after a passing move.

Parameters
evalEvaluation function.

◆ eval_restore()

void eval_restore ( Eval * ,
const struct Move *  )

◆ eval_set()

void eval_set ( Eval * ,
const struct Board *  )

◆ eval_sigma()

double eval_sigma ( const int n_empty,
const int depth,
const int probcut_depth )

Compute the error-type of the evaluation function according to the depths.

A statistical study showed that the accuracy of the alphabeta mostly depends on the depth & the ply of the game. This function is useful to the probcut algorithm. Using a function instead of a table of data makes easier to inter- or extrapolate new values.

Parameters
n_emptyNumber of empty squares on the board.
depthDepth used in alphabeta.
probcut_depthA shallow depth used in probcut algorithm.

◆ eval_update()

void eval_update ( Eval * ,
const struct Move *  )

Variable Documentation

◆ EVAL_WEIGHT

short*** EVAL_WEIGHT
extern

eval weights