/*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
/*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
enum OptionType { SPIN, COMBO, CHECK, STRING, BUTTON };
enum OptionType { SPIN, COMBO, CHECK, STRING, BUTTON };
o["Passed Pawn Extension (non-PV nodes)"] = Option(0, 0, 2);
o["Pawn Endgame Extension (PV nodes)"] = Option(2, 0, 2);
o["Pawn Endgame Extension (non-PV nodes)"] = Option(2, 0, 2);
o["Passed Pawn Extension (non-PV nodes)"] = Option(0, 0, 2);
o["Pawn Endgame Extension (PV nodes)"] = Option(2, 0, 2);
o["Pawn Endgame Extension (non-PV nodes)"] = Option(2, 0, 2);
o["Full Depth Moves (non-PV nodes)"] = Option(3, 1, 100);
o["Threat Depth"] = Option(5, 0, 100);
o["Full Depth Moves (non-PV nodes)"] = Option(3, 1, 100);
o["Threat Depth"] = Option(5, 0, 100);
- o["Futility Pruning (Main Search)"] = Option(true);
- o["Futility Pruning (Quiescence Search)"] = Option(true);
- o["LSN filtering"] = Option(false);
- o["LSN Time Margin (sec)"] = Option(4, 1, 10);
- o["LSN Value Margin"] = Option(200, 100, 600);
o["Randomness"] = Option(0, 0, 10);
o["Minimum Split Depth"] = Option(4, 4, 7);
o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);
o["Threads"] = Option(1, 1, 8);
o["Hash"] = Option(32, 4, 4096);
o["Clear Hash"] = Option(false, BUTTON);
o["Randomness"] = Option(0, 0, 10);
o["Minimum Split Depth"] = Option(4, 4, 7);
o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);
o["Threads"] = Option(1, 1, 8);
o["Hash"] = Option(32, 4, 4096);
o["Clear Hash"] = Option(false, BUTTON);
o["Ponder"] = Option(true);
o["OwnBook"] = Option(true);
o["MultiPV"] = Option(1, 1, 500);
o["UCI_ShowCurrLine"] = Option(false);
o["UCI_Chess960"] = Option(false);
o["Ponder"] = Option(true);
o["OwnBook"] = Option(true);
o["MultiPV"] = Option(1, 1, 500);
o["UCI_ShowCurrLine"] = Option(false);
o["UCI_Chess960"] = Option(false);
// Any option should know its name so to be easily printed
for (Options::iterator it = o.begin(); it != o.end(); ++it)
// Any option should know its name so to be easily printed
for (Options::iterator it = o.begin(); it != o.end(); ++it)
+ // Specialization for std::string where instruction 'ss >> ret;'
+ // would erroneusly tokenize a string with spaces.
+
+ template<>
+ string get_option_value<string>(const string& optionName) {
+
+ if (options.find(optionName) == options.end())
+ return string();
+
+ return options[optionName].currentValue;
+ }
+
options["Threads"].defaultValue = stringify(Min(cpu_count(), 7));
options["Threads"].currentValue = stringify(Min(cpu_count(), 7));
options["Threads"].defaultValue = stringify(Min(cpu_count(), 7));
options["Threads"].currentValue = stringify(Min(cpu_count(), 7));
-
- // Increase the minimum split depth when the number of CPUs is big.
- // It would probably be better to let this depend on the number of threads
- // instead.
- if (cpu_count() > 4)
- {
- options["Minimum Split Depth"].defaultValue = "6";
- options["Minimum Split Depth"].currentValue = "6";
- }
else if (it->type == COMBO)
for (ComboValues::const_iterator itc = it->comboValues.begin();
itc != it->comboValues.end(); ++itc)
else if (it->type == COMBO)
for (ComboValues::const_iterator itc = it->comboValues.begin();
itc != it->comboValues.end(); ++itc)
/// get_option_value_string() returns the current value of a UCI parameter as
/// a string. It is used with parameters of type "combo" and "string".
/// get_option_value_string() returns the current value of a UCI parameter as
/// a string. It is used with parameters of type "combo" and "string".
/// the function does not check that the new value is legal for the given
/// parameter: This is assumed to be the responsibility of the GUI.
/// the function does not check that the new value is legal for the given
/// parameter: This is assumed to be the responsibility of the GUI.
}
/// push_button() is used to tell the engine that a UCI parameter of type
/// "button" has been selected:
}
/// push_button() is used to tell the engine that a UCI parameter of type
/// "button" has been selected:
/// been selected since the last time the function was called, in this case
/// it also resets the button.
/// been selected since the last time the function was called, in this case
/// it also resets the button.