Go to the documentation of this file.00001 #include "osl/eval/ml/openMidEndingEval.h"
00002 #include "osl/game_playing/alphaBetaPlayer.h"
00003 #include "osl/game_playing/gameState.h"
00004 #include "osl/progress/ml/newProgress.h"
00005 #include "osl/record/kisen.h"
00006 #include "osl/search/moveWithComment.h"
00007 #include "osl/sennichite.h"
00008
00009 #include <boost/program_options.hpp>
00010 #include <iostream>
00011
00012 namespace po = boost::program_options;
00013
00014 int main(int argc, char **argv)
00015 {
00016 std::string kisen_filename;
00017 int kisen_index;
00018 po::options_description options("Options");
00019 options.add_options()
00020 ("kisen,k",
00021 po::value<std::string>(&kisen_filename),
00022 "kisen filename")
00023 ("index,i",
00024 po::value<int>(&kisen_index)->default_value(0))
00025 ("help", "produce help message")
00026 ;
00027 po::positional_options_description p;
00028 po::variables_map vm;
00029
00030 try
00031 {
00032 po::store(po::command_line_parser(argc, argv).
00033 options(options).positional(p).run(), vm);
00034 notify(vm);
00035 if (vm.count("help"))
00036 {
00037 std::cout << options << std::endl;
00038 return 0;
00039 }
00040 }
00041 catch (std::exception& e)
00042 {
00043 std::cerr << "error in parsing options" << std::endl
00044 << e.what() << std::endl;
00045 std::cerr << options << std::endl;
00046 return 1;
00047 }
00048
00049 osl::record::KisenFile kisen(kisen_filename);
00050 osl::state::NumEffectState state(kisen.getInitialState());
00051 osl::stl::vector<osl::Move> moves = kisen.getMoves(kisen_index);
00052
00053 osl::progress::ml::NewProgress::setUp();
00054 osl::progress::ml::NewProgress progress(state);
00055
00056 for (size_t i = 0; i < moves.size() + 1; ++i)
00057 {
00058 if (!state.inCheck())
00059 {
00060
00061 std::cout << i << " " << progress.progress() << std::endl;
00062 }
00063 if (i < moves.size())
00064 {
00065 state.makeMove(moves[i]);
00066 progress.update(state, moves[i]);
00067 }
00068 }
00069
00070 return 0;
00071 }