fixed threats hist? | bench 6448969
This commit is contained in:
1 parent
1dd0e33d2b
commit
10a0f502ae
3 files changed
+18
-41
No files matched your search
+2
-23
@@ -102,9 +102,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class ThreatsHistory {
|
||||
class History {
|
||||
private:
|
||||
// indexed by [stm][from][to][threatSource][threatTarget]
|
||||
// indexed by [stm][from][to][threatenedSource][threatenedTarget]
|
||||
MultiArray<int, 2, 64, 64, 2, 2> historyMoves;
|
||||
public:
|
||||
void Update(bool stm, Move move, bool source, bool target, int bonus) {
|
||||
@@ -122,25 +122,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class History {
|
||||
private:
|
||||
MultiArray<int, 2, 64, 64> historyMoves;
|
||||
public:
|
||||
void Update(bool stm, Move move, int bonus) {
|
||||
int clampedBonus = std::clamp(bonus, -MAX_HISTORY, MAX_HISTORY);
|
||||
historyMoves[stm][move.MoveFrom()][move.MoveTo()] +=
|
||||
clampedBonus - historyMoves[stm][move.MoveFrom()][move.MoveTo()] * std::abs(clampedBonus) / MAX_HISTORY;
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
std::fill(&historyMoves[0][0][0], &historyMoves[0][0][0] + sizeof(historyMoves) / sizeof(int), 0);
|
||||
}
|
||||
|
||||
auto& operator[](int index) {
|
||||
return historyMoves[index];
|
||||
}
|
||||
};
|
||||
|
||||
class PVLine {
|
||||
private:
|
||||
int length[MAX_PLY] = {};
|
||||
@@ -199,7 +180,6 @@ public:
|
||||
|
||||
PVLine pvLine;
|
||||
History history;
|
||||
ThreatsHistory threatsHist;
|
||||
ContHistory conthist;
|
||||
CorrHist corrhist;
|
||||
|
||||
@@ -216,7 +196,6 @@ public:
|
||||
SearchContext(){
|
||||
pvLine.Clear();
|
||||
history.Clear();
|
||||
threatsHist.Clear();
|
||||
conthist.Clear();
|
||||
corrhist.Clear();
|
||||
TT.Clear();
|
||||
|
||||
Reference in new issue
Block a user