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. | |
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.
|
|
Name of coefficients file.
|
|
|
Calculate the heuristic value of the board.
|
|
|
Aggression flag.
|
|
|
Apply polynomial checking?
|
|
|
Apply trap 1 checking? Value for apply_trap_1: 0 - do not apply trap check. 1 - apply trap1. 2 - apply trap1 and trap2. |
|
|
Contains the coefficients for the scoring polynomial.
|
1.4.5