-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMCOTable.h
40 lines (33 loc) · 975 Bytes
/
MCOTable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef MCOTABLE_H_INCLUDED
#define MCOTABLE_H_INCLUDED
#include <array>
#include <atomic>
#include "FastBoard.h"
#include "Playout.h"
#include "SMP.h"
class MCOwnerTable {
public:
/*
return the global TT
*/
static MCOwnerTable * get_MCO();
void clear();
/*
update_blackowns corresponding entry
*/
void update_owns(Playout::bitboard_t & blacksq,
bool blackwon, float board_score);
float get_blackown(const int color, const int vertex) const;
int get_blackown_i(const int color, const int vertex) const;
float get_criticality_f(const int vertex) const;
float get_board_score() const;
bool is_primed() const;
private:
MCOwnerTable();
std::array<std::atomic<int>, FastBoard::MAXSQ> m_mcblackowner;
std::array<std::atomic<int>, FastBoard::MAXSQ> m_mcwinowner;
std::atomic<int> m_mcsimuls;
std::atomic<int> m_blackwins;
std::atomic<double> m_blackscore;
};
#endif