Subversion Repositories Games.Chess Giants

Rev

Rev 169 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 169 Rev 185
Line 4... Line 4...
4
  Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
4
  Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
5
  Copyright (C) 2015-2018 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
5
  Copyright (C) 2015-2019 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
6
 
6
 
7
  Stockfish is free software: you can redistribute it and/or modify
7
  Stockfish is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License as published by
8
  it under the terms of the GNU General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
10
  (at your option) any later version.
Line 30... Line 30...
30
class Position;
30
class Position;
31
 
31
 
32
namespace Search {
32
namespace Search {
33
 
33
 
34
/// Threshold used for countermoves based pruning
34
/// Threshold used for countermoves based pruning
35
const int CounterMovePruneThreshold = 0;
35
constexpr int CounterMovePruneThreshold = 0;
36
 
36
 
37
 
37
 
38
/// Stack struct keeps track of the information we need to remember from nodes
38
/// Stack struct keeps track of the information we need to remember from nodes
39
/// shallower and deeper in the tree during the search. Each search thread has
39
/// shallower and deeper in the tree during the search. Each search thread has
40
/// its own array of Stack objects, indexed by the current ply.
40
/// its own array of Stack objects, indexed by the current ply.
41
 
41
 
42
struct Stack {
42
struct Stack {
43
  Move* pv;
43
  Move* pv;
44
  PieceToHistory* contHistory;
44
  PieceToHistory* continuationHistory;
45
  int ply;
45
  int ply;
46
  Move currentMove;
46
  Move currentMove;
47
  Move excludedMove;
47
  Move excludedMove;
48
  Move killers[2];
48
  Move killers[2];
49
  Value staticEval;
49
  Value staticEval;
Line 67... Line 67...
67
  }
67
  }
68
 
68
 
69
  Value score = -VALUE_INFINITE;
69
  Value score = -VALUE_INFINITE;
70
  Value previousScore = -VALUE_INFINITE;
70
  Value previousScore = -VALUE_INFINITE;
71
  int selDepth = 0;
71
  int selDepth = 0;
-
 
72
  int tbRank;
-
 
73
  Value tbScore;
72
  std::vector<Move> pv;
74
  std::vector<Move> pv;
73
};
75
};
74
 
76
 
75
typedef std::vector<RootMove> RootMoves;
77
typedef std::vector<RootMove> RootMoves;
76
 
78
 
Line 79... Line 81...
79
/// search the current move, maximum depth/time, or if we are in analysis mode.
81
/// search the current move, maximum depth/time, or if we are in analysis mode.
80
 
82
 
81
struct LimitsType {
83
struct LimitsType {
82
 
84
 
83
  LimitsType() { // Init explicitly due to broken value-initialization of non POD in MSVC
85
  LimitsType() { // Init explicitly due to broken value-initialization of non POD in MSVC
84
    nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] =
86
    time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = npmsec = movetime = TimePoint(0);
85
    npmsec = movestogo = depth = movetime = mate = perft = infinite = 0;
87
    movestogo = depth = mate = perft = infinite = 0;
-
 
88
    nodes = 0;
86
  }
89
  }
87
 
90
 
88
  bool use_time_management() const {
91
  bool use_time_management() const {
89
    return !(mate | movetime | depth | nodes | perft | infinite);
92
    return !(mate | movetime | depth | nodes | perft | infinite);
90
  }
93
  }
91
 
94
 
92
  std::vector<Move> searchmoves;
95
  std::vector<Move> searchmoves;
93
  int time[COLOR_NB], inc[COLOR_NB], npmsec, movestogo, depth,
96
  TimePoint time[COLOR_NB], inc[COLOR_NB], npmsec, movetime, startTime;
94
      movetime, mate, perft, infinite;
97
  int movestogo, depth, mate, perft, infinite;
95
  int64_t nodes;
98
  int64_t nodes;
96
  TimePoint startTime;
-
 
97
};
99
};
98
 
100
 
99
extern LimitsType Limits;
101
extern LimitsType Limits;
100
 
102
 
101
void init();
103
void init();