mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Remove several unnecessary UCI options: All king safety options
except "Aggressiveness" and "Cowardice", and "UCI_ShowCurrLine". No functional change compared to the previous version with the default settings.
This commit is contained in:
parent
2a14123550
commit
a5a8830e97
3 changed files with 14 additions and 53 deletions
|
@ -224,15 +224,19 @@ namespace {
|
||||||
|
|
||||||
const int AttackWeight[] = { 0, 0, KnightAttackWeight, BishopAttackWeight, RookAttackWeight, QueenAttackWeight };
|
const int AttackWeight[] = { 0, 0, KnightAttackWeight, BishopAttackWeight, RookAttackWeight, QueenAttackWeight };
|
||||||
|
|
||||||
// Bonuses for safe checks, initialized from UCI options
|
// Bonuses for safe checks
|
||||||
int QueenContactCheckBonus, DiscoveredCheckBonus;
|
const int QueenContactCheckBonus = 3;
|
||||||
int QueenCheckBonus, RookCheckBonus, BishopCheckBonus, KnightCheckBonus;
|
const int DiscoveredCheckBonus = 3;
|
||||||
|
const int QueenCheckBonus = 2;
|
||||||
|
const int RookCheckBonus = 1;
|
||||||
|
const int BishopCheckBonus = 1;
|
||||||
|
const int KnightCheckBonus = 1;
|
||||||
|
|
||||||
// Scan for queen contact mates?
|
// Scan for queen contact mates?
|
||||||
const bool QueenContactMates = true;
|
const bool QueenContactMates = true;
|
||||||
|
|
||||||
// Bonus for having a mate threat, initialized from UCI options
|
// Bonus for having a mate threat
|
||||||
int MateThreatBonus;
|
const int MateThreatBonus = 3;
|
||||||
|
|
||||||
// InitKingDanger[] contains bonuses based on the position of the defending
|
// InitKingDanger[] contains bonuses based on the position of the defending
|
||||||
// king.
|
// king.
|
||||||
|
@ -1200,29 +1204,17 @@ namespace {
|
||||||
|
|
||||||
void init_safety() {
|
void init_safety() {
|
||||||
|
|
||||||
QueenContactCheckBonus = get_option_value_int("Queen Contact Check Bonus");
|
int maxSlope = 30;
|
||||||
QueenCheckBonus = get_option_value_int("Queen Check Bonus");
|
int peak = 0x500;
|
||||||
RookCheckBonus = get_option_value_int("Rook Check Bonus");
|
double a = 0.4;
|
||||||
BishopCheckBonus = get_option_value_int("Bishop Check Bonus");
|
double b = 0.0;
|
||||||
KnightCheckBonus = get_option_value_int("Knight Check Bonus");
|
|
||||||
DiscoveredCheckBonus = get_option_value_int("Discovered Check Bonus");
|
|
||||||
MateThreatBonus = get_option_value_int("Mate Threat Bonus");
|
|
||||||
|
|
||||||
int maxSlope = get_option_value_int("King Safety Max Slope");
|
|
||||||
int peak = get_option_value_int("King Safety Max Value") * 256 / 100;
|
|
||||||
double a = get_option_value_int("King Safety Coefficient") / 100.0;
|
|
||||||
double b = get_option_value_int("King Safety X Intercept");
|
|
||||||
bool quad = (get_option_value_string("King Safety Curve") == "Quadratic");
|
|
||||||
bool linear = (get_option_value_string("King Safety Curve") == "Linear");
|
|
||||||
|
|
||||||
for (int i = 0; i < 100; i++)
|
for (int i = 0; i < 100; i++)
|
||||||
{
|
{
|
||||||
if (i < b)
|
if (i < b)
|
||||||
SafetyTable[i] = Value(0);
|
SafetyTable[i] = Value(0);
|
||||||
else if (quad)
|
else
|
||||||
SafetyTable[i] = Value((int)(a * (i - b) * (i - b)));
|
SafetyTable[i] = Value((int)(a * (i - b) * (i - b)));
|
||||||
else if (linear)
|
|
||||||
SafetyTable[i] = Value((int)(100 * a * (i - b)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 100; i++)
|
for (int i = 0; i < 100; i++)
|
||||||
|
|
|
@ -259,9 +259,6 @@ namespace {
|
||||||
bool UseTimeManagement, InfiniteSearch, PonderSearch, StopOnPonderhit;
|
bool UseTimeManagement, InfiniteSearch, PonderSearch, StopOnPonderhit;
|
||||||
bool FirstRootMove, AbortSearch, Quit, AspirationFailLow;
|
bool FirstRootMove, AbortSearch, Quit, AspirationFailLow;
|
||||||
|
|
||||||
// Show current line?
|
|
||||||
bool ShowCurrentLine;
|
|
||||||
|
|
||||||
// Log file
|
// Log file
|
||||||
bool UseLogFile;
|
bool UseLogFile;
|
||||||
std::ofstream LogFile;
|
std::ofstream LogFile;
|
||||||
|
@ -425,7 +422,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
|
||||||
|
|
||||||
MinimumSplitDepth = get_option_value_int("Minimum Split Depth") * OnePly;
|
MinimumSplitDepth = get_option_value_int("Minimum Split Depth") * OnePly;
|
||||||
MaxThreadsPerSplitPoint = get_option_value_int("Maximum Number of Threads per Split Point");
|
MaxThreadsPerSplitPoint = get_option_value_int("Maximum Number of Threads per Split Point");
|
||||||
ShowCurrentLine = get_option_value_bool("UCI_ShowCurrLine");
|
|
||||||
MultiPV = get_option_value_int("MultiPV");
|
MultiPV = get_option_value_int("MultiPV");
|
||||||
Chess960 = get_option_value_bool("UCI_Chess960");
|
Chess960 = get_option_value_bool("UCI_Chess960");
|
||||||
UseLogFile = get_option_value_bool("Use Search Log");
|
UseLogFile = get_option_value_bool("Use Search Log");
|
||||||
|
@ -2464,16 +2460,6 @@ namespace {
|
||||||
|
|
||||||
cout << "info nodes " << TM.nodes_searched() << " nps " << nps()
|
cout << "info nodes " << TM.nodes_searched() << " nps " << nps()
|
||||||
<< " time " << t << " hashfull " << TT.full() << endl;
|
<< " time " << t << " hashfull " << TT.full() << endl;
|
||||||
|
|
||||||
// We only support current line printing in single thread mode
|
|
||||||
if (ShowCurrentLine && TM.active_threads() == 1)
|
|
||||||
{
|
|
||||||
cout << "info currline";
|
|
||||||
for (int p = 0; p < ply; p++)
|
|
||||||
cout << " " << ss[p].currentMove;
|
|
||||||
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should we stop the search?
|
// Should we stop the search?
|
||||||
|
|
|
@ -88,22 +88,6 @@ namespace {
|
||||||
o["Space"] = Option(100, 0, 200);
|
o["Space"] = Option(100, 0, 200);
|
||||||
o["Aggressiveness"] = Option(100, 0, 200);
|
o["Aggressiveness"] = Option(100, 0, 200);
|
||||||
o["Cowardice"] = Option(100, 0, 200);
|
o["Cowardice"] = Option(100, 0, 200);
|
||||||
o["King Safety Curve"] = Option("Quadratic", COMBO);
|
|
||||||
|
|
||||||
o["King Safety Curve"].comboValues.push_back("Quadratic");
|
|
||||||
o["King Safety Curve"].comboValues.push_back("Linear"); /*, "From File"*/
|
|
||||||
|
|
||||||
o["King Safety Coefficient"] = Option(40, 1, 100);
|
|
||||||
o["King Safety X Intercept"] = Option(0, 0, 20);
|
|
||||||
o["King Safety Max Slope"] = Option(30, 10, 100);
|
|
||||||
o["King Safety Max Value"] = Option(500, 100, 1000);
|
|
||||||
o["Queen Contact Check Bonus"] = Option(3, 0, 8);
|
|
||||||
o["Queen Check Bonus"] = Option(2, 0, 4);
|
|
||||||
o["Rook Check Bonus"] = Option(1, 0, 4);
|
|
||||||
o["Bishop Check Bonus"] = Option(1, 0, 4);
|
|
||||||
o["Knight Check Bonus"] = Option(1, 0, 4);
|
|
||||||
o["Discovered Check Bonus"] = Option(3, 0, 8);
|
|
||||||
o["Mate Threat Bonus"] = Option(3, 0, 8);
|
|
||||||
o["Check Extension (PV nodes)"] = Option(2, 0, 2);
|
o["Check Extension (PV nodes)"] = Option(2, 0, 2);
|
||||||
o["Check Extension (non-PV nodes)"] = Option(1, 0, 2);
|
o["Check Extension (non-PV nodes)"] = Option(1, 0, 2);
|
||||||
o["Single Evasion Extension (PV nodes)"] = Option(2, 0, 2);
|
o["Single Evasion Extension (PV nodes)"] = Option(2, 0, 2);
|
||||||
|
@ -126,7 +110,6 @@ namespace {
|
||||||
o["Ponder"] = Option(true);
|
o["Ponder"] = Option(true);
|
||||||
o["OwnBook"] = Option(true);
|
o["OwnBook"] = Option(true);
|
||||||
o["MultiPV"] = Option(1, 1, 500);
|
o["MultiPV"] = Option(1, 1, 500);
|
||||||
o["UCI_ShowCurrLine"] = Option(false);
|
|
||||||
o["UCI_Chess960"] = Option(false);
|
o["UCI_Chess960"] = Option(false);
|
||||||
o["UCI_AnalyseMode"] = Option(false);
|
o["UCI_AnalyseMode"] = Option(false);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue