Aei Class Reference

Arimaa Engine Interface Controller. More...

#include <aei.h>

List of all members.

Public Member Functions

 Aei (aeiCommandSet_e commandSet)
 Constructor with specified command set.
void runLoop ()
 Waits for commands in loop.
void initFromFile (string fn)
 Hardcoded beginning of session.

Private Member Functions

void init ()
 Initialization.
void handleInput (const string &input)
 Handles single command;.
void handleOption (const string &commandRest)
 Parse option from setoption command.
void startSearch (const string &arg)
 Initiates thread creation and search start.
void goalCheck ()
 Performs static goal check on the current position.
void trapCheck ()
 Performs static trap check on the current position.
void evalActPos ()
 Evaluates actual position.
void searchInThread ()
 Threaded wrapper around engine.doSearch().
void stopSearch (bool fromThread=false)
 Stop search.
void sendSearchInfo ()
 Sends bestmove/winration/timeinfo.
void aeiLog (const string &msg, const aeiLogLevel_e logLevel) const
 Communicate log messages.
void sendInfo (const string &type, const string &value) const
 Sending additional information.
void quit () const
 Quit the program.
void sendId () const
 Send id information.
void send (const string &s) const
 Wrapper around sending.

Static Private Member Functions

static void * SearchInThreadWrapper (void *instance)
 Wrapper around Aei::searchinThread().

Private Attributes

AeiRecordList records_
 Records of aei finite automata.
TimeControlList timeControls_
 List of pairs <option name, time control for time manager>.
aeiState_e state_
 State of the automata.
string response_
 Response to be send through communication channel.
aeiCommandSet_e commandSet_
Boardboard_
Engineengine_
pthread_t engineThread_
 Thread handler for running search.


Detailed Description

Arimaa Engine Interface Controller.

This class operates communication with external interface(gameroom, user) and controls the searching engine.


Member Function Documentation

void Aei::init (  )  [private]

Initialization.

Inits the parsing automata states and variables. Reused in both constructors.

void Aei::initFromFile ( string  fn  ) 

Hardcoded beginning of session.

For debugging purposes.

void * Aei::SearchInThreadWrapper ( void *  instance  )  [static, private]

Wrapper around Aei::searchinThread().

Declared as static so it can be threaded.

void Aei::sendId (  )  const [private]

Send id information.

Uses information from ID_ macros - ID_AUTHOR, IT_NAME, ID_VERSION.

void Aei::startSearch ( const string &  arg  )  [private]

Initiates thread creation and search start.

Parameters:
arg Search arguments - e.g. ponder, infinite, etc.

void Aei::stopSearch ( bool  fromThread = false  )  [private]

Stop search.

Gives request to stop the search. Waits for the search thread to join.

Parameters:
fromThread If true, method is called from thread -> doesn't need to join the thread otherwise does nothing ( e.g. when makemove stopped go ponder)


Member Data Documentation

pthread_t Aei::engineThread_ [private]

Thread handler for running search.

AeiRecordList Aei::records_ [private]

Records of aei finite automata.

string Aei::response_ [private]

Response to be send through communication channel.

aeiState_e Aei::state_ [private]

State of the automata.


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

Generated on Thu Aug 6 23:29:08 2009 for akimot by  doxygen 1.5.7.1