All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
progress.h
Go to the documentation of this file.
1 #ifndef EVAL_ML_PROGRESS_H
2 #define EVAL_ML_PROGRESS_H
3 
4 #include "osl/misc/carray.h"
6 #include "osl/eval/ml/weights.h"
7 
8 namespace osl
9 {
10  namespace eval
11  {
12  namespace ml
13  {
15  {
16  public:
17  enum { DIM = 256 };
18  static int eval(Progress16 black, Progress16 white);
19  static void setUp(const Weights &weights);
20  private:
21  static int index(Progress16 black, Progress16 white)
22  {
23  return black.value() * 16 + white.value();
24  }
25  static CArray<int, 256> table;
26  };
28  {
29  public:
30  enum { DIM = 256 };
31  static int eval(Progress16 black_attack, Progress16 white_defense,
32  Progress16 white_attack, Progress16 black_defense);
33  static void setUp(const Weights &weights);
34  private:
35  static int index(Progress16 attack, Progress16 defense)
36  {
37  return attack.value() * 16 + defense.value();
38  }
39  static CArray<int, 256> table;
40  };
41 
43  {
44  public:
45  enum { DIM = 65536 };
46  static int eval(Progress16 black_attack,
47  Progress16 white_defense,
48  Progress16 white_attack, Progress16 black_defense);
49  static void setUp(const Weights &weights);
50  private:
51  static int index(Progress16 black_attack, Progress16 white_defense,
52  Progress16 white_attack, Progress16 black_defense)
53  {
54  return white_attack.value() +
55  16 * (black_defense.value() +
56  16 * (black_attack.value() * 16 + white_defense.value()));
57  }
58  static CArray<int, 65536> table;
59  };
60  }
61  }
62 }
63 
64 #endif // EVAL_ML_PROGRESS_H
65 // ;;; Local Variables:
66 // ;;; mode:c++
67 // ;;; c-basic-offset:2
68 // ;;; End:
69