progress.h
Go to the documentation of this file.
00001 #ifndef EVAL_ML_PROGRESS_H
00002 #define EVAL_ML_PROGRESS_H
00003 
00004 #include "osl/misc/carray.h"
00005 #include "osl/progress/progress16.h"
00006 #include "osl/eval/ml/weights.h"
00007 
00008 namespace osl
00009 {
00010   namespace eval
00011   {
00012     namespace ml
00013     {
00014       class ProgressBonus
00015       {
00016       public:
00017         enum { DIM = 256 };
00018         static int eval(Progress16 black, Progress16 white);
00019         static void setUp(const Weights &weights);
00020       private:
00021         static int index(Progress16 black, Progress16 white)
00022         {
00023           return black.value() * 16 + white.value();
00024         }
00025         static CArray<int, 256> table;
00026       };
00027       class ProgressAttackDefense
00028       {
00029       public:
00030         enum { DIM = 256 };
00031         static int eval(Progress16 black_attack, Progress16 white_defense,
00032                         Progress16 white_attack, Progress16 black_defense);
00033         static void setUp(const Weights &weights);
00034       private:
00035         static int index(Progress16 attack, Progress16 defense)
00036         {
00037           return attack.value() * 16 + defense.value();
00038         }
00039         static CArray<int, 256> table;
00040       };
00041 
00042       class ProgressAttackDefenseAll
00043       {
00044       public:
00045         enum { DIM = 65536 };
00046         static int eval(Progress16 black_attack,
00047                         Progress16 white_defense,
00048                         Progress16 white_attack, Progress16 black_defense);
00049         static void setUp(const Weights &weights);
00050       private:
00051         static int index(Progress16 black_attack, Progress16 white_defense,
00052                          Progress16 white_attack, Progress16 black_defense)
00053         {
00054           return white_attack.value() +
00055             16 * (black_defense.value() +
00056                   16 * (black_attack.value() * 16 + white_defense.value()));
00057         }
00058         static CArray<int, 65536> table;
00059       };
00060     }
00061   }
00062 }
00063 
00064 #endif // EVAL_ML_PROGRESS_H
00065 // ;;; Local Variables:
00066 // ;;; mode:c++
00067 // ;;; c-basic-offset:2
00068 // ;;; End:
00069 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines