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