114 uint MinDepthCheckTime;
137 byte TranTableSequence;
142 bool (*CallbackFunction)(
Engine *,
void *);
149 int SearchRoot (
int depth,
int alpha,
int beta,
MoveList * mlist);
150 int Search (
int depth,
int alpha,
int beta,
bool tryNullMove);
151 int Quiesce (
int alpha,
int beta);
156 inline void SetPVLength (
void);
158 void Output (
const char * format, ...);
159 void PrintPV (
uint depth,
int score) { PrintPV (depth, score,
""); }
160 void PrintPV (
uint depth,
int score,
const char * annotation);
161 inline void PushRepeat (
Position * pos);
162 inline void PopRepeat (
void);
163 void StoreHash (
int depth,
scoreFlagT flag,
int score,
167 inline void ClearKillerMoves (
void);
171 inline void ClearHistoryValues (
void);
172 inline void HalveHistoryValues (
void);
173 inline void IncHistoryValue (
simpleMoveT * sm,
int increment);
176 int Score (
int alpha,
int beta);
177 inline int ScoreWhiteMaterial (
void);
178 inline int ScoreBlackMaterial (
void);
180 bool IsMatingScore (
int score);
181 bool IsGettingMatedScore (
int score);
183 bool OutOfTime (
void);
184 void AdjustTime (
bool easyMove);
190 MinSearchTime = MaxSearchTime = SearchTime;
191 MinDepthCheckTime = 4;
202 TranTableSequence = 0;
207 CallbackFunction = NULL;
211 for (
auto& e : PV) { e.length = 0; }
214 ~
Engine() { my_Tcl_Free((
char*) TranTable); my_Tcl_Free((
char*) PawnTable); }
216 ~Engine() {
delete[] TranTable;
delete[] PawnTable; }
219 if (ply < 1) { ply = 1; }
224 MinSearchTime = SearchTime = MaxSearchTime = ms;
232 MinDepthCheckTime = depth;
243 void SetHashTableKilobytes (
uint sizeKB);
244 void SetPawnTableKilobytes (
uint sizeKB);
247 void ClearHashTable (
void);
248 void ClearPawnTable (
void);
255 CallbackFunction = fn;
261 bool NoMatingMaterial (
void);
262 bool FiftyMoveDraw (
void);
263 uint RepeatedPosition (
void);
268 void RetractMove (
void);
270 int ScoreMaterial (
void);
279 Engine::SetPVLength (
void)
292 if (InNullMove > 0) {
return; }
295 PV[Ply].
move[Ply] = *sm;
296 for (
uint j = Ply + 1; j < PV[Ply + 1].
length; j++) {
297 PV[Ply].
move[j] = PV[Ply+1].
move[j];
316 Engine::ClearKillerMoves (
void)
363 Engine::ClearHistoryValues (
void)
373 Engine::HalveHistoryValues (
void)
384 Engine::IncHistoryValue (
simpleMoveT * sm,
int increment)
391 History[p][to] += increment;
395 HalveHistoryValues();
405 return History[p][to];
408 #endif // SCID_ENGINE_H
long long MilliSecs(void) const
void SetSearchDepth(uint ply)
const squareT NULL_SQUARE
principalVarT * GetPV(void)
const uint ENGINE_MAX_PLY
const scoreFlagT SCORE_LOWER
const int ENGINE_MAX_HISTORY
void SetCallbackFunction(bool(*fn)(Engine *, void *), void *data)
Position * GetPosition(void)
const uint ENGINE_PAWN_KB
simpleMoveT move[ENGINE_MAX_PLY]
const int ENGINE_HASH_SCORE
void SetSearchTime(uint min, uint ms, uint max)
void SetXBoardMode(bool b)
void SetMinDepthCheckTime(uint depth)
const scoreFlagT SCORE_NONE
const uint ENGINE_HASH_KB
uint NumHashTableEntries(void)
void SetLogFile(FILE *fp)
const scoreFlagT SCORE_EXACT
uint NumPawnTableEntries(void)
const scoreFlagT SCORE_UPPER
void SetSearchTime(uint ms)
void ClearHashTables(void)