Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

MoHexMain.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file MoHexMain.cpp
00003  */
00004 //----------------------------------------------------------------------------
00005 
00006 #include "SgSystem.h"
00007 
00008 #include "config.h"
00009 #include "HexProgram.hpp"
00010 #include "MoHexEngine.hpp"
00011 #include "MoHexPlayer.hpp"
00012 
00013 using namespace benzene;
00014 
00015 //----------------------------------------------------------------------------
00016 
00017 /** @page mohexmainpage MoHex
00018 
00019     @section overview Overview
00020 
00021     MoHex is Hex player that uses monte-carlo tree search with
00022     knowledge computation. It links with the UCT search classes from
00023     the Fuego library.
00024     
00025     MoHex uses HexBoard to compute VCs/fillin for nodes in the search
00026     tree that have been visited more than a certain threshold number
00027     of times.
00028 
00029     @section search Classes
00030     - MoHexEngine
00031     - MoHexPlayer
00032     - HexUctSearch
00033 
00034     @section htpcommands HTP Commands
00035     - @ref hexhtpenginecommands
00036     - @ref benzenehtpenginecommands
00037 
00038     @todo Add more documentation about MoHex!
00039 */
00040 
00041 //----------------------------------------------------------------------------
00042 
00043 namespace {
00044 
00045 const char* build_date = __DATE__;
00046 
00047 }
00048 
00049 //----------------------------------------------------------------------------
00050 
00051 int main(int argc, char** argv)
00052 {
00053     HexProgram& program = HexProgram::Get();
00054     program.SetInfo("Mohex", VERSION, build_date);
00055     program.PrintStartupMessage();
00056     program.Initialize(argc, argv);
00057     MoHexPlayer player;
00058     try
00059     {
00060         MoHexEngine gh(program.BoardSize(), player);
00061             std::string config = program.ConfigFileToExecute();
00062         if (config != "")
00063             gh.ExecuteFile(config);
00064         GtpInputStream gin(std::cin);
00065         GtpOutputStream gout(std::cout);
00066         gh.MainLoop(gin, gout);
00067         program.Shutdown();
00068     }
00069     catch (const GtpFailure& f)
00070     {
00071         std::cerr << f.Response() << std::endl;
00072         return 1;
00073     }
00074     return 0;
00075 }
00076 
00077 //----------------------------------------------------------------------------


6 Jan 2011 Doxygen 1.6.3