Cute Chess  0.1
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  {
39  AcceptH1
40  };
41 
44  {
46  Win,
47  Loss,
48  Draw
49  };
50 
52  struct Status
53  {
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
Definition: sprt.h:52
double lBound
Lower bound.
Definition: sprt.h:56
Result
Definition: sprt.h:35
Continue monitoring.
Definition: sprt.h:37
Accept null hypothesis H0.
Definition: sprt.h:38
First player lost.
Definition: sprt.h:47
First player won.
Definition: sprt.h:46
double llr
Log-likelihood ratio.
Definition: sprt.h:55
Result result
Test result.
Definition: sprt.h:54
double uBound
Upper bound.
Definition: sprt.h:57
A Sequential Probability Ratio Test.
Definition: sprt.h:31
GameResult
Definition: sprt.h:43
Game ended with no result.
Definition: sprt.h:45