説明を見る。00001 #ifndef EVAL_ML_PROGRESS_H
00002 #define EVAL_ML_PROGRESS_H
00003
00004 #include "osl/progress.h"
00005 #include "osl/eval/weights.h"
00006
00007 namespace osl
00008 {
00009 namespace eval
00010 {
00011 namespace ml
00012 {
00013 class ProgressBonus
00014 {
00015 public:
00016 enum { DIM = 256 };
00017 static int eval(Progress16 black, Progress16 white);
00018 static void setUp(const Weights &weights);
00019 private:
00020 static int index(Progress16 black, Progress16 white)
00021 {
00022 return black.value() * 16 + white.value();
00023 }
00024 static CArray<int, 256> table;
00025 };
00026 class ProgressAttackDefense
00027 {
00028 public:
00029 enum { DIM = 256 };
00030 static int eval(Progress16 black_attack, Progress16 white_defense,
00031 Progress16 white_attack, Progress16 black_defense);
00032 static void setUp(const Weights &weights);
00033 private:
00034 static int index(Progress16 attack, Progress16 defense)
00035 {
00036 return attack.value() * 16 + defense.value();
00037 }
00038 static CArray<int, 256> table;
00039 };
00040
00041 class ProgressAttackDefenseAll
00042 {
00043 public:
00044 enum { DIM = 65536 };
00045 static int eval(Progress16 black_attack,
00046 Progress16 white_defense,
00047 Progress16 white_attack, Progress16 black_defense);
00048 static void setUp(const Weights &weights);
00049 private:
00050 static int index(Progress16 black_attack, Progress16 white_defense,
00051 Progress16 white_attack, Progress16 black_defense)
00052 {
00053 return white_attack.value() +
00054 16 * (black_defense.value() +
00055 16 * (black_attack.value() * 16 + white_defense.value()));
00056 }
00057 static CArray<int, 65536> table;
00058 };
00059 }
00060 }
00061 }
00062
00063 #endif // EVAL_ML_PROGRESS_H
00064
00065
00066
00067
00068