heurísticas no relatório
[xYpjg3TdSw.git] / MinimaxEnemy.h
blob7b80048a4ad24859eb09f07d89aa901ba9af50f6
1 #ifndef __MINIMAX_ENEMY_H__
2 #define __MINIMAX_ENEMY_H__
4 #include "Enemy.h"
5 #include "Board.h"
7 #include <ctime>
8 #include <cstdlib>
9 //#include <iostream>
10 //using namespace std;
12 #include <cfloat>
13 #define HeuTypeMax DBL_MAX
14 #define NUM_HEU 8
16 class MinimaxEnemy: public Enemy
18 public:
19 typedef double HeuType;
20 MinimaxEnemy(bool player, int minimaxDepth): Enemy(player, minimaxDepth)/*, _game_boards(board_compare)*/ {
21 rep(i, NUM_HEU)
22 _heu[i] = 1.;
23 _heu_total = NUM_HEU;
25 void move(Board *board, int& fromX, int& fromY, int& toX, int& toY);
26 HeuType alphabeta(const Board &board, int depth, HeuType alpha, HeuType beta, int player);
27 virtual
28 HeuType heuristica(Board &board, bool player, bool plastmove);
29 HeuType centro(Board &board, bool player, bool plastmove);
30 HeuType concentration(Board &board, bool player, bool plastmove);
31 HeuType centralisation(Board &board, bool player, bool plastmove);
32 HeuType masscenter(Board &board, bool player, bool plastmove);
33 HeuType quads(Board &board, bool player, bool plastmove);
34 HeuType connectedness(Board &board, bool player, bool plastmove);
35 HeuType uniformity(Board &board, bool player, bool plastmove);
36 void set_weights(HeuType heu[NUM_HEU]);
37 virtual void undo(Board *board) {
38 //_game_boards.erase(board->to_comp());
40 for(Board::Set::iterator i = _game_boards.begin(); i != _game_boards.end(); ++i) {
41 cout << i->first << ' ' << i->second << endl;
43 cout << endl;//*/
45 protected:
46 int _choice;
47 HeuType _heu[NUM_HEU], _heu_total;
48 //Board::Set _game_boards;
51 #endif