#include <aei.h>
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_ |
| Board * | board_ |
| Engine * | engine_ |
| pthread_t | engineThread_ |
| Thread handler for running search. | |
This class operates communication with external interface(gameroom, user) and controls the searching engine.
| 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.
| 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.
| 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) |
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.
1.5.7.1