The Pedigree Project  0.1
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
Engine Class Reference
+ Collaboration diagram for Engine:

Public Member Functions

 Engine ()
 
 ~Engine ()
 
void run ()
 
void ponder (bool b)
 
void startSearch (Side s, int minD, int maxD)
 
void stopSearch ()
 
bool searchComplete () volatile
 
Move getMove ()
 
void move (Move m)
 
void printMoveList ()
 

Static Public Member Functions

static void * threadTramp (void *ptr)
 

Public Attributes

BoardState state
 

Private Attributes

SearchAlgorithmsearch
 
volatile bool doSearch
 
volatile Side side
 
volatile int minDepth
 
volatile int maxDepth
 
MoveList moveList
 
long heuristic
 

Detailed Description

Definition at line 29 of file Engine.h.

Constructor & Destructor Documentation

Engine::Engine ( )

Creates an engine, spawning a new thread and having that call run().

Definition at line 32 of file Engine.cc.

References doSearch, minDepth, search, and threadTramp().

Engine::~Engine ( )

Destroys an engine, killing the thread.

Definition at line 46 of file Engine.cc.

Member Function Documentation

Move Engine::getMove ( )

Get the move the search recommends.

Definition at line 104 of file Engine.cc.

References moveList.

void Engine::move ( Move  m)

Used to update the board position with either our or an opponent's move.

Definition at line 109 of file Engine.cc.

void Engine::ponder ( bool  b)

Enables or disables pondering.

Definition at line 82 of file Engine.cc.

void Engine::printMoveList ( )

For debug purposes.

Definition at line 113 of file Engine.cc.

References moveList, and search.

Referenced by run().

+ Here is the caller graph for this function:

void Engine::run ( )

Main runloop. Called solely by the spawned thread from Engine().

Definition at line 50 of file Engine.cc.

References doSearch, moveList, printMoveList(), search, side, and state.

Referenced by threadTramp().

+ Here is the caller graph for this function:

bool Engine::searchComplete ( ) volatile

Is the search complete?

Definition at line 99 of file Engine.cc.

References doSearch.

void Engine::startSearch ( Side  s,
int  minD,
int  maxD 
)

Starts a new search, given the current board state.

Definition at line 86 of file Engine.cc.

References doSearch, minDepth, and side.

void Engine::stopSearch ( )

Force an exit of the current search.

Definition at line 94 of file Engine.cc.

References doSearch.

void * Engine::threadTramp ( void *  ptr)
static

Trampoline.

Definition at line 127 of file Engine.cc.

References run().

Referenced by Engine().

+ Here is the caller graph for this function:

Member Data Documentation

volatile bool Engine::doSearch
private

Should the worker thread be searching?

Definition at line 105 of file Engine.h.

Referenced by Engine(), run(), searchComplete(), startSearch(), and stopSearch().

volatile int Engine::minDepth
private

The maximum and minimum depths to search to.

Definition at line 115 of file Engine.h.

Referenced by Engine(), and startSearch().

MoveList Engine::moveList
private

The move list that the engine found.

Definition at line 120 of file Engine.h.

Referenced by getMove(), printMoveList(), and run().

SearchAlgorithm* Engine::search
private

The opening book that we can query. The algorithm that does the brunt work for us.

Definition at line 100 of file Engine.h.

Referenced by Engine(), printMoveList(), and run().

volatile Side Engine::side
private

The side to search for a move for.

Definition at line 110 of file Engine.h.

Referenced by run(), and startSearch().

BoardState Engine::state

The current state of the board.

Definition at line 90 of file Engine.h.

Referenced by run().


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