Calculate the heuristic value of the board.

Calculate the heuristic value of the board. More...


Files

file  h_init.c
 Heuristic initialization - source file.
file  h_init.h
 Heuristic initialization - header file.
file  heuristic.c
 Calculate the heuristic value of the board - source file.
file  heuristic.h
 Calculate the heuristic value of the board - header file.

Defines

#define COEF_FILE   "coefficients"
 Name of coefficients file.

Functions

int heuristic_1 (void)
 Calculate the heuristic value of the board.

Variables

static int coefficients [NUM_COEF]
 Contains the coefficients for the scoring polynomial.
int apply_trap_1
 Apply trap 1 checking?
int apply_poly_1
 Apply polynomial checking?
int agr_flag_1
 Aggression flag.

Detailed Description

Calculate the heuristic value of the board.

The heuristic is calculated as follows:

1) three_row() is called to check if Alpha has three-ina-row.

If so, return THREE_ROW.

2) t_evaluate() is called to see if a trap exists.

If so, return the associated value.

3) Otherwise, call p_evaluate() to apply the scoring polynomial.


Define Documentation

#define COEF_FILE   "coefficients"
 

Name of coefficients file.


Function Documentation

heuristic_1 void   ) 
 

Calculate the heuristic value of the board.

Returns:
int : heuristic value of the board.


Variable Documentation

agr_flag_1
 

Aggression flag.

apply_poly_1
 

Apply polynomial checking?

apply_trap_1
 

Apply trap 1 checking?

Value for apply_trap_1:

0 - do not apply trap check. 1 - apply trap1. 2 - apply trap1 and trap2.

coefficients [static]
 

Contains the coefficients for the scoring polynomial.


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