The Pedigree Project  0.1
Engine.h
1 /*
2  *
3  * Copyright (c) 2008-2014, Pedigree Developers
4  *
5  * Please see the CONTRIB file in the root of the source tree for a full
6  * list of contributors.
7  *
8  * Permission to use, copy, modify, and distribute this software for any
9  * purpose with or without fee is hereby granted, provided that the above
10  * copyright notice and this permission notice appear in all copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 #ifndef ENGINE_H
22 #define ENGINE_H
23 
24 #include <pthread.h>
25 #include "Move.h"
26 #include "BoardState.h"
27 #include "SearchAlgorithm.h"
28 
29 class Engine
30 {
31 public:
35  Engine();
36 
40  ~Engine();
41 
45  void run();
46 
50  void ponder(bool b);
51 
55  void startSearch(Side s, int minD, int maxD);
56 
60  void stopSearch();
61 
65  bool searchComplete() volatile;
66 
70  Move getMove();
71 
75  void move(Move m);
76 
80  void printMoveList();
81 
85  static void *threadTramp(void *ptr);
86 
91 private:
95  //OpeningBook book;
96 
101 
105  volatile bool doSearch;
106 
110  volatile Side side;
111 
115  volatile int minDepth, maxDepth;
116 
120  MoveList moveList;
121  long heuristic;
122 
123 };
124 
125 #endif
volatile int minDepth
Definition: Engine.h:115
bool searchComplete() volatile
Definition: Engine.cc:99
void ponder(bool b)
Definition: Engine.cc:82
BoardState state
Definition: Engine.h:90
Move getMove()
Definition: Engine.cc:104
SearchAlgorithm * search
Definition: Engine.h:100
Definition: Engine.h:29
~Engine()
Definition: Engine.cc:46
void stopSearch()
Definition: Engine.cc:94
volatile Side side
Definition: Engine.h:110
void startSearch(Side s, int minD, int maxD)
Definition: Engine.cc:86
Definition: Move.h:29
volatile bool doSearch
Definition: Engine.h:105
static void * threadTramp(void *ptr)
Definition: Engine.cc:127
MoveList moveList
Definition: Engine.h:120
void move(Move m)
Definition: Engine.cc:109
void printMoveList()
Definition: Engine.cc:113
void run()
Definition: Engine.cc:50
Engine()
Definition: Engine.cc:32