#include <libbenbot/engine/Engine.hpp>
The ben-bot UCI engine class.
Definition at line 49 of file Engine.hpp.
◆ CommandList
Typedef for a view of a list of engine commands.
Definition at line 171 of file EngineBase.hpp.
◆ OptionList
Typedef for a view of a list of engine options.
Definition at line 186 of file EngineBase.hpp.
◆ Engine() [1/3]
| ben_bot::Engine::Engine |
( |
| ) |
|
|
default |
◆ ~Engine()
| ben_bot::Engine::~Engine |
( |
| ) |
|
|
overridedefault |
◆ Engine() [2/3]
| ben_bot::Engine::Engine |
( |
const Engine & | | ) |
|
|
delete |
◆ Engine() [3/3]
| ben_bot::Engine::Engine |
( |
Engine && | | ) |
|
|
delete |
◆ abort_search()
| void ben_bot::Engine::abort_search |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
◆ get_author()
| auto ben_bot::Engine::get_author |
( |
| ) |
const -> string_view |
|
inlinenodiscardoverrideprivatevirtual |
◆ get_custom_uci_commands()
| auto ben_bot::Engine::get_custom_uci_commands |
( |
| ) |
const -> CommandList |
|
inlinenodiscardoverrideprivatevirtualnoexcept |
◆ get_custom_uci_options()
| auto ben_bot::Engine::get_custom_uci_options |
( |
| ) |
-> OptionList |
|
inlinenodiscardoverrideprivatevirtualnoexcept |
◆ get_name()
| auto ben_bot::Engine::get_name |
( |
| ) |
const -> std::string |
|
nodiscardoverrideprivatevirtual |
This must return the name of the engine. The returned string may optionally contain the engine's current version, such as BenBot 1.2.0.
Implements chess::uci::EngineBase.
◆ get_standard_uci_commands()
| auto chess::uci::EngineBase::get_standard_uci_commands |
( |
| ) |
const -> CommandList |
|
inlinenodiscardnoexceptinherited |
Returns the engine's list of supported standard UCI commands.
Definition at line 174 of file EngineBase.hpp.
◆ get_standard_uci_options()
| auto chess::uci::EngineBase::get_standard_uci_options |
( |
| ) |
-> OptionList |
|
inlinenodiscardnoexceptinherited |
Returns the engine's list of supported standard UCI commands.
Definition at line 195 of file EngineBase.hpp.
◆ go() [1/2]
| void ben_bot::Engine::go |
( |
const uci::GoCommandOptions & | opts | ) |
|
|
overrideprivate |
◆ go() [2/2]
Called when the "go" command is received. The engine should begin searching. After this function has been called, the engine should print to stdout a line of the form "bestmove <from><to>".
◆ handle_command()
| void chess::uci::EngineBase::handle_command |
( |
string_view | command | ) |
|
|
inherited |
Handles a UCI command. Typically you will not call this directly, you'll just invoke loop(), but this method can be used to manually invoke UCI commands if needed.
- See also
- loop()
◆ handle_registration()
| virtual void chess::uci::EngineBase::handle_registration |
( |
const RegisterOptions & | opts | ) |
|
|
inlinevirtualinherited |
Called when the user send a "register" command. The engine may simply do nothing if it does not require registration.
Definition at line 168 of file EngineBase.hpp.
◆ is_debug_mode()
| auto chess::uci::EngineBase::is_debug_mode |
( |
| ) |
const -> bool |
|
inlinenodiscardnoexceptinherited |
Returns true if the engine's debugging mode is active.
Definition at line 201 of file EngineBase.hpp.
◆ is_searching()
| auto ben_bot::Engine::is_searching |
( |
| ) |
const -> bool |
|
inlineoverrideprivatevirtualnoexcept |
This function must return true if a search is currently in progress. This function should be thread-safe.
Implements chess::uci::EngineBase.
Definition at line 80 of file Engine.hpp.
◆ loop()
| void chess::uci::EngineBase::loop |
( |
| ) |
|
|
inherited |
Runs the engine's event loop. This function blocks while reading from stdin. The calling thread becomes the engine's "main thread".
- See also
- handle_command()
◆ new_game()
| void ben_bot::Engine::new_game |
( |
bool | firstCall | ) |
|
|
overrideprivatevirtual |
This function will be called when the "ucinewgame" command is received. This should flush any game-specific data structures such as hash tables, transposition table, etc. wait() will be called after this, before the next search begins.
- Parameters
-
| firstCall | True if this is the first time new_game() has been called. |
Reimplemented from chess::uci::EngineBase.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ponder_hit()
| void ben_bot::Engine::ponder_hit |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
This function is called when the "ponderhit" command is received. This means that the engine was told to ponder on the same move the user has played. The engine should continue searching but switch from pondering to normal search.
Reimplemented from chess::uci::EngineBase.
Definition at line 76 of file Engine.hpp.
◆ read_config_file()
| void ben_bot::Engine::read_config_file |
( |
const std::filesystem::path & | file | ) |
|
Loads the engine's state from a configuration file at the given path.
◆ resize_transposition_table()
| void ben_bot::Engine::resize_transposition_table |
( |
const size_t | sizeMB | ) |
|
|
inlineoverrideprivatevirtual |
◆ set_debug_mode()
| void chess::uci::EngineBase::set_debug_mode |
( |
const bool | shouldDebug | ) |
|
|
inlinenoexceptinherited |
◆ set_ponder()
| void ben_bot::Engine::set_ponder |
( |
const bool | shouldPonder | ) |
|
|
inlineoverrideprivatevirtual |
◆ set_position()
| void ben_bot::Engine::set_position |
( |
const Position & | pos | ) |
|
|
inlineoverrideprivatevirtual |
◆ set_sanitize_positions()
| void chess::uci::EngineBase::set_sanitize_positions |
( |
const bool | shouldSanitize | ) |
|
|
inlinenoexceptinherited |
Tells the base class whether to sanitize incoming positions when processing the position command. When sanitizing is on, after evaluating each position command, the engine performs some basic checks to determine if the position is illegal, and if so, prints a diagnostic message and reverts the internal board to the previous position.
Definition at line 219 of file EngineBase.hpp.
◆ wait()
| void ben_bot::Engine::wait |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
This function will be called when the "isready" command is received, and may block while waiting for background tasks to complete. This function should be thread-safe.
Reimplemented from chess::uci::EngineBase.
Definition at line 78 of file Engine.hpp.
◆ opt_Hash
| IntOption chess::uci::EngineBase::opt_Hash |
|
inherited |
Initial value:{
"Hash",
1, 2048, 16,
"Sets the transposition table size (in MB)",
[this](const int sizeMB) {
assert(sizeMB >= 0);
}
}
void resize_transposition_table(const size_t sizeMB) override
Standard UCI option for hash size.
Definition at line 234 of file EngineBase.hpp.
◆ opt_Ponder
| BoolOption chess::uci::EngineBase::opt_Ponder |
|
inherited |
Initial value:{
"Ponder",
false,
"Controls whether pondering is allowed.",
[
this](
const bool shouldPonder) {
set_ponder(shouldPonder); }
}
void set_ponder(const bool shouldPonder) override
Standard UCI option for pondering. The engine doesn't start pondering on its own without explicitly being told to via another go command; this option is needed to inform the GUI that the engine supports pondering, and also gives the engine the opportunity to adjust its time management algorithm when pondering is enabled.
Definition at line 250 of file EngineBase.hpp.
The documentation for this class was generated from the following file: