mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Remove some useless casts
No functional change.
This commit is contained in:
parent
c9e396b542
commit
86c20416c8
6 changed files with 10 additions and 10 deletions
|
@ -915,12 +915,12 @@ namespace Eval {
|
|||
Weights[KingDangerUs] = weight_option("Cowardice", "Cowardice", WeightsInternal[KingDangerUs]);
|
||||
Weights[KingDangerThem] = weight_option("Aggressiveness", "Aggressiveness", WeightsInternal[KingDangerThem]);
|
||||
|
||||
const int MaxSlope = 30;
|
||||
const int Peak = 1280;
|
||||
const double MaxSlope = 30;
|
||||
const double Peak = 1280;
|
||||
|
||||
for (int t = 0, i = 1; i < 100; ++i)
|
||||
{
|
||||
t = std::min(Peak, std::min(int(0.4 * i * i), t + MaxSlope));
|
||||
t = std::min(Peak, std::min(0.4 * i * i, t + MaxSlope));
|
||||
|
||||
KingDanger[1][i] = apply_weight(make_score(t, 0), Weights[KingDangerUs]);
|
||||
KingDanger[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]);
|
||||
|
|
|
@ -43,7 +43,7 @@ string score_to_uci(Value v, Value alpha, Value beta) {
|
|||
stringstream ss;
|
||||
|
||||
if (abs(v) < VALUE_MATE_IN_MAX_PLY)
|
||||
ss << "cp " << v * 100 / int(PawnValueEg);
|
||||
ss << "cp " << v * 100 / PawnValueEg;
|
||||
else
|
||||
ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ void Position::set(const string& fenStr, bool isChess960, Thread* th) {
|
|||
|
||||
// Convert from fullmove starting from 1 to ply starting from 0,
|
||||
// handle also common incorrect FEN with fullmove = 0.
|
||||
gamePly = std::max(2 * (gamePly - 1), 0) + int(sideToMove == BLACK);
|
||||
gamePly = std::max(2 * (gamePly - 1), 0) + (sideToMove == BLACK);
|
||||
|
||||
chess960 = isChess960;
|
||||
thisThread = th;
|
||||
|
@ -424,7 +424,7 @@ const string Position::fen() const {
|
|||
ss << '-';
|
||||
|
||||
ss << (ep_square() == SQ_NONE ? " - " : " " + to_string(ep_square()) + " ")
|
||||
<< st->rule50 << " " << 1 + (gamePly - int(sideToMove == BLACK)) / 2;
|
||||
<< st->rule50 << " " << 1 + (gamePly - (sideToMove == BLACK)) / 2;
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
|
|
@ -146,8 +146,8 @@ void Search::init() {
|
|||
// Init futility move count array
|
||||
for (d = 0; d < 32; ++d)
|
||||
{
|
||||
FutilityMoveCounts[0][d] = int(2.4 + 0.222 * pow(d + 0.00, 1.8));
|
||||
FutilityMoveCounts[1][d] = int(3.0 + 0.300 * pow(d + 0.98, 1.8));
|
||||
FutilityMoveCounts[0][d] = 2.4 + 0.222 * pow(d + 0.00, 1.8);
|
||||
FutilityMoveCounts[1][d] = 3.0 + 0.300 * pow(d + 0.98, 1.8);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace {
|
|||
double ratio1 = (TMaxRatio * thisMoveImportance) / (TMaxRatio * thisMoveImportance + otherMovesImportance);
|
||||
double ratio2 = (thisMoveImportance + TStealRatio * otherMovesImportance) / (thisMoveImportance + otherMovesImportance);
|
||||
|
||||
return int(floor(myTime * std::min(ratio1, ratio2)));
|
||||
return floor(myTime * std::min(ratio1, ratio2));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -27,7 +27,7 @@ class TimeManager {
|
|||
public:
|
||||
void init(const Search::LimitsType& limits, int currentPly, Color us);
|
||||
void pv_instability(double bestMoveChanges) { unstablePvFactor = 1 + bestMoveChanges; }
|
||||
int available_time() const { return int(optimumSearchTime * unstablePvFactor * 0.71); }
|
||||
int available_time() const { return optimumSearchTime * unstablePvFactor * 0.71; }
|
||||
int maximum_time() const { return maximumSearchTime; }
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue