Cute Chess
0.1
projects
lib
src
sprt.h
1
/*
2
This file is part of Cute Chess.
3
4
Cute Chess is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
Cute Chess is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef SPRT_H
19
#define SPRT_H
20
31
class
LIB_EXPORT
Sprt
32
{
33
public
:
35
enum
Result
36
{
37
Continue
,
38
AcceptH0
,
39
AcceptH1
40
};
41
43
enum
GameResult
44
{
45
NoResult
,
46
Win
,
47
Loss
,
48
Draw
49
};
50
52
struct
Status
53
{
54
Result
result
;
55
double
llr
;
56
double
lBound
;
57
double
uBound
;
58
};
59
61
Sprt
();
62
67
bool
isNull()
const
;
68
78
void
initialize(
double
elo0,
double
elo1,
79
double
alpha,
double
beta);
81
Status
status()
const
;
88
void
addGameResult(
GameResult
result);
89
90
private
:
91
double
m_elo0;
92
double
m_elo1;
93
double
m_alpha;
94
double
m_beta;
95
int
m_wins;
96
int
m_losses;
97
int
m_draws;
98
};
99
100
#endif // SPRT_H
Sprt::Status
Definition:
sprt.h:52
Sprt::Status::lBound
double lBound
Lower bound.
Definition:
sprt.h:56
Sprt::Result
Result
Definition:
sprt.h:35
Sprt::Continue
Continue monitoring.
Definition:
sprt.h:37
Sprt::AcceptH0
Accept null hypothesis H0.
Definition:
sprt.h:38
Sprt::Loss
First player lost.
Definition:
sprt.h:47
Sprt::Win
First player won.
Definition:
sprt.h:46
Sprt::Status::llr
double llr
Log-likelihood ratio.
Definition:
sprt.h:55
Sprt::Status::result
Result result
Test result.
Definition:
sprt.h:54
Sprt::Status::uBound
double uBound
Upper bound.
Definition:
sprt.h:57
Sprt
A Sequential Probability Ratio Test.
Definition:
sprt.h:31
Sprt::GameResult
GameResult
Definition:
sprt.h:43
Sprt::NoResult
Game ended with no result.
Definition:
sprt.h:45
Generated by
1.8.14