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 
32 class LIB_EXPORT Sprt
33 {
34  public:
36  enum Result
37  {
40  AcceptH1
41  };
42 
45  {
47  Win,
48  Loss,
49  Draw
50  };
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
Definition: sprt.h:53
double lBound
Lower bound.
Definition: sprt.h:57
Result
Definition: sprt.h:36
Continue monitoring.
Definition: sprt.h:38
Accept null hypothesis H0.
Definition: sprt.h:39
First player lost.
Definition: sprt.h:48
First player won.
Definition: sprt.h:47
double llr
Log-likelihood ratio.
Definition: sprt.h:56
Result result
Test result.
Definition: sprt.h:55
double uBound
Upper bound.
Definition: sprt.h:58
A Sequential Probability Ratio Test.
Definition: sprt.h:32
GameResult
Definition: sprt.h:44
Game ended with no result.
Definition: sprt.h:46