#include <ow_aisearch_negamax.h>
Public Member Functions | |
ow_aisearch_negamax (ow_board *owboard) | |
int | search (ow_move prinvar[], ow_board *board, int boardside, int depth) |
~ow_aisearch_negamax () | |
Private Member Functions | |
int | _negamax (ow_move prinvar[], ow_board *board, int boardside, int depth, int *nodecount) |
int | _negamax_rand (ow_move prinvar[], ow_board *board, int boardside, int depth, int *nodecount) |
ow_aisearch_negamax::ow_aisearch_negamax | ( | ow_board * | owboard | ) |
Creates a new ow_aisearch_negamax object width default values.
owboard | Pointer to the board used during the game, where to look for moves. |
ow_aisearch_negamax::~ow_aisearch_negamax | ( | ) |
Deletes the ow_aisearch_negamax object
int ow_aisearch_negamax::_negamax | ( | ow_move | prinvar[], | |
ow_board * | board, | |||
int | boardside, | |||
int | depth, | |||
int * | nodecount | |||
) | [private] |
Negamax search algoritm
prinvar | Principal variation found during the IA search. | |
board | Pointer to the board. | |
boardside | Side of the board where to look for best move. | |
depth | Depth of the search algoritm | |
nodes | Nodes (positions) analyzed during AI search. |
int ow_aisearch_negamax::_negamax_rand | ( | ow_move | prinvar[], | |
ow_board * | board, | |||
int | boardside, | |||
int | depth, | |||
int * | nodecount | |||
) | [private] |
Negamax search algoritm (random version) If two nodes have the same evaluation it chooses one randomly.
prinvar | Principal variation found during the IA search. | |
board | Pointer to the board. | |
boardside | Side of the board where to look for best move. | |
depth | Depth of the search algoritm | |
nodes | Nodes (positions) analyzed during AI search. |
int ow_aisearch_negamax::search | ( | ow_move | prinvar[], | |
ow_board * | board, | |||
int | boardside, | |||
int | depth | |||
) | [virtual] |
Abstract method to the search algoritm (negamax)
prinvar | Principal variation found during the IA search. | |
board | Pointer to the board. | |
boardside | Side of the board where to look for best move. | |
depth | Depth of the search algoritm |
Reimplemented from ow_aisearch.