Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

PerfectPlayer Class Reference

Player using Solver to generate moves. More...

#include <PerfectPlayer.hpp>

Inheritance diagram for PerfectPlayer:
BenzenePlayer HexPlayer

List of all members.

Public Member Functions

 PerfectPlayer (DfpnSolver &solver, DfpnStates &positions)
virtual ~PerfectPlayer ()
std::string Name () const
 Returns "perfect".
double MaxTime () const
 Maximum time to use per search.
void SetMaxTime (double time)
 See MaxTime().
bool PropagateBackwards () const
 See DfpnSolver::PropagateBackwards().
void SetPropagateBackwards (bool flag)
 See PropagateBackwards().
HexPoint GenMove (const HexState &state, const Game &game, HexBoard &brd, double maxTime, double &score)
 Generates a move from this board position.
bool SearchSingleton () const
 Search states with only a single move?
void SetSearchSingleton (bool flag)
 See SetSearchSingleton().

Protected Member Functions

bool FillinCausedWin () const

Protected Attributes

bool m_fillinCausedWin
HexColor m_fillinWinner

Private Member Functions

HexPoint Search (const HexState &state, const Game &game, HexBoard &brd, const bitset_t &consider, double maxTime, double &score)
 Generates a move in the given gamestate using DfpnSolver.

Private Attributes

DfpnSolverm_solver
DfpnStatesm_positions
double m_maxTime
bool m_propagateBackwards

Detailed Description

Player using Solver to generate moves.

Works best on boards 7x7 and smaller.

Note:
This player is currently not used!!

Definition at line 22 of file PerfectPlayer.hpp.


Constructor & Destructor Documentation

PerfectPlayer::PerfectPlayer ( DfpnSolver solver,
DfpnStates positions 
) [explicit]

Definition at line 36 of file PerfectPlayer.cpp.

PerfectPlayer::~PerfectPlayer (  )  [virtual]

Definition at line 45 of file PerfectPlayer.cpp.


Member Function Documentation

bool BenzenePlayer::FillinCausedWin (  )  const [inline, protected, inherited]

Definition at line 86 of file BenzenePlayer.hpp.

References BenzenePlayer::m_fillinCausedWin.

Referenced by Search().

HexPoint BenzenePlayer::GenMove ( const HexState state,
const Game game,
HexBoard brd,
double  maxTime,
double &  score 
) [virtual, inherited]

Generates a move from this board position.

If the game is already over (somebody has won), returns RESIGN.

Derived Benzene players that use different search algorithms should not extend this method, but the protected virtual method Search() below.

If state is terminal (game over, vc/fill-in win/loss), returns "appropriate" move. Otherwise, calls Search().

Bug:
Subtract time spent to here from max_time after each step.

Implements HexPlayer.

Definition at line 27 of file BenzenePlayer.cpp.

References BenzenePlayer::CheckEndgame(), BenzenePlayer::InitSearch(), INVALID_POINT, LogInfo(), BenzenePlayer::Search(), and HexState::ToPlay().

Referenced by MoHexEngine::DoSearch(), WolveEngine::GenMove(), PlayAndSolve::PlayerThread::operator()(), and BookBuilder< PLAYER >::Worker::operator()().

double PerfectPlayer::MaxTime (  )  const [inline]

Maximum time to use per search.

Definition at line 65 of file PerfectPlayer.hpp.

References m_maxTime.

Referenced by BenzeneTestEngine::CmdParamPlayer().

std::string PerfectPlayer::Name (  )  const [inline, virtual]

Returns "perfect".

Implements HexPlayer.

Definition at line 60 of file PerfectPlayer.hpp.

bool PerfectPlayer::PropagateBackwards (  )  const [inline]
HexPoint PerfectPlayer::Search ( const HexState state,
const Game game,
HexBoard brd,
const bitset_t consider,
double  maxTime,
double &  score 
) [private, virtual]
bool BenzenePlayer::SearchSingleton (  )  const [inline, inherited]

Search states with only a single move?

Definition at line 76 of file BenzenePlayer.hpp.

References BenzenePlayer::m_search_singleton.

Referenced by MoHexEngine::MoHexParam(), and WolveEngine::WolveParam().

void PerfectPlayer::SetMaxTime ( double  time  )  [inline]

See MaxTime().

Definition at line 70 of file PerfectPlayer.hpp.

References m_maxTime.

Referenced by BenzeneTestEngine::CmdParamPlayer().

void PerfectPlayer::SetPropagateBackwards ( bool  flag  )  [inline]

See PropagateBackwards().

Definition at line 80 of file PerfectPlayer.hpp.

References m_propagateBackwards.

Referenced by BenzeneTestEngine::CmdParamPlayer().

void BenzenePlayer::SetSearchSingleton ( bool  flag  )  [inline, inherited]

Member Data Documentation

bool BenzenePlayer::m_fillinCausedWin [protected, inherited]

Definition at line 46 of file BenzenePlayer.hpp.

Referenced by BenzenePlayer::FillinCausedWin(), and BenzenePlayer::InitSearch().

HexColor BenzenePlayer::m_fillinWinner [protected, inherited]

Definition at line 48 of file BenzenePlayer.hpp.

Referenced by BenzenePlayer::InitSearch(), and Search().

double PerfectPlayer::m_maxTime [private]

Definition at line 50 of file PerfectPlayer.hpp.

Referenced by MaxTime(), Search(), and SetMaxTime().

Definition at line 48 of file PerfectPlayer.hpp.

Referenced by Search().

Definition at line 52 of file PerfectPlayer.hpp.

Referenced by PropagateBackwards(), Search(), and SetPropagateBackwards().

Definition at line 46 of file PerfectPlayer.hpp.

Referenced by Search().


The documentation for this class was generated from the following files:


6 Jan 2011 Doxygen 1.6.3