Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

WolveMain.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file WolveMain.cpp
00003  */
00004 //----------------------------------------------------------------------------
00005 
00006 #include "SgSystem.h"
00007 
00008 #include "config.h"
00009 #include "HexProgram.hpp"
00010 #include "WolveEngine.hpp"
00011 #include "WolvePlayer.hpp"
00012 #include "SwapCheck.hpp"
00013 
00014 using namespace benzene;
00015 
00016 //----------------------------------------------------------------------------
00017 
00018 /** @page wolvemainpage Wolve
00019 
00020     @section overview Overview
00021 
00022     Wolve is a traditional Six-like Hex player. It uses a truncated
00023     iterative deepening alpha-beta search with an electric ciruit
00024     evaluation function.
00025 
00026     @section search Search
00027     - WolveEngine
00028     - WolvePlayer
00029     - HexAbSearch
00030     - Resistance
00031 
00032     @section htpcommands HTP Commands
00033     - @ref hexhtpenginecommands
00034     - @ref benzenehtpenginecommands
00035 
00036     @todo Add more documentation about Wolve!
00037 */
00038 
00039 //----------------------------------------------------------------------------
00040 
00041 namespace {
00042 
00043 const char* build_date = __DATE__;
00044 
00045 }
00046 
00047 //----------------------------------------------------------------------------
00048 
00049 int main(int argc, char** argv)
00050 {
00051     HexProgram& program = HexProgram::Get();
00052     program.SetInfo("Wolve", VERSION, build_date);
00053     program.PrintStartupMessage();
00054     program.Initialize(argc, argv);
00055     WolvePlayer player;
00056     try
00057     {
00058         WolveEngine gh(program.BoardSize(), player);
00059         std::string config = program.ConfigFileToExecute();
00060         if (config != "")
00061             gh.ExecuteFile(config);
00062         GtpInputStream gin(std::cin);
00063         GtpOutputStream gout(std::cout);
00064         gh.MainLoop(gin, gout);
00065     
00066         program.Shutdown();
00067     }
00068     catch (const GtpFailure& f)
00069     {
00070         std::cerr << f.Response() << std::endl;
00071         return 1;
00072     }
00073     return 0;
00074 }
00075 
00076 //----------------------------------------------------------------------------


6 Jan 2011 Doxygen 1.6.3