|
@@ -161,7 +161,7 @@ MoveValue chessy::negamaxImplementation(ChessGame& cg, int depth,
|
|
|
|
|
|
|
|
|
|
template<Side side>
|
|
template<Side side>
|
|
-MoveValue chessy::evaluate(const ChessGame& game)
|
|
|
|
|
|
+MoveValue chessy::evaluatePositives(const ChessGame& game)
|
|
{
|
|
{
|
|
MoveValue piecePoints = 0;
|
|
MoveValue piecePoints = 0;
|
|
const Board& bd = game.getBoard();
|
|
const Board& bd = game.getBoard();
|
|
@@ -177,11 +177,17 @@ MoveValue chessy::evaluate(const ChessGame& game)
|
|
piecePoints += 5 * r.popcount();
|
|
piecePoints += 5 * r.popcount();
|
|
piecePoints += 9 * q.popcount();
|
|
piecePoints += 9 * q.popcount();
|
|
|
|
|
|
- //for (auto knight : PositionSet{ n })
|
|
|
|
- // piecePoints += KnightMoveGenerator{ knight, bd.get<side>() }.getBitboard().popcount() * 0.15;
|
|
|
|
|
|
+ for (auto knight : PositionSet{ n })
|
|
|
|
+ piecePoints += KnightMoveGenerator{ knight, bd.get<side>() }.getBitboard().popcount() * 0.05;
|
|
for (auto bishop : PositionSet{ b })
|
|
for (auto bishop : PositionSet{ b })
|
|
- piecePoints += PrimitiveBishopMoveGenerator{ bishop, bd.get<otherSide(side)>(), bd.get<side>() }.getBitboard().popcount() * 0.2;
|
|
|
|
|
|
+ piecePoints += PrimitiveBishopMoveGenerator{ bishop, bd.get<otherSide(side)>(), bd.get<side>() }.getBitboard().popcount() * 0.03;
|
|
|
|
+ for (auto rook : PositionSet{ r })
|
|
|
|
+ piecePoints += PrimitiveRookMoveGenerator{ rook, bd.get<otherSide(side)>(), bd.get<side>() }.getBitboard().popcount() * 0.03;
|
|
|
|
+ for (auto queen : PositionSet{ q })
|
|
|
|
+ piecePoints += PrimitiveQueenMoveGenerator{ queen, bd.get<otherSide(side)>(), bd.get<side>() }.getBitboard().popcount() * 0.02;
|
|
|
|
|
|
|
|
+ return piecePoints;
|
|
|
|
+ /*
|
|
constexpr Side other = otherSide(side);
|
|
constexpr Side other = otherSide(side);
|
|
p = bd.getPawns<other>();
|
|
p = bd.getPawns<other>();
|
|
n = bd.getKnights<other>();
|
|
n = bd.getKnights<other>();
|
|
@@ -199,17 +205,18 @@ MoveValue chessy::evaluate(const ChessGame& game)
|
|
// piecePoints -= KnightMoveGenerator{ knight, bd.get<otherSide(side)>() }.getBitboard().popcount() * 0.2;
|
|
// piecePoints -= KnightMoveGenerator{ knight, bd.get<otherSide(side)>() }.getBitboard().popcount() * 0.2;
|
|
for (auto bishop : PositionSet{ b })
|
|
for (auto bishop : PositionSet{ b })
|
|
piecePoints -= PrimitiveBishopMoveGenerator{ bishop, bd.get<side>(), bd.get<otherSide(side)>() }.getBitboard().popcount() * 0.2;
|
|
piecePoints -= PrimitiveBishopMoveGenerator{ bishop, bd.get<side>(), bd.get<otherSide(side)>() }.getBitboard().popcount() * 0.2;
|
|
-
|
|
|
|
- return piecePoints;
|
|
|
|
|
|
+ */
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
MoveValue chessy::evaluate(Side side, const ChessGame& game)
|
|
MoveValue chessy::evaluate(Side side, const ChessGame& game)
|
|
{
|
|
{
|
|
if (side == WHITE_SIDE)
|
|
if (side == WHITE_SIDE)
|
|
- return evaluate<WHITE_SIDE>(game);
|
|
|
|
|
|
+ return evaluatePositives<WHITE_SIDE>(game) -
|
|
|
|
+ evaluatePositives<BLACK_SIDE>(game);
|
|
else
|
|
else
|
|
- return evaluate<BLACK_SIDE>(game);
|
|
|
|
|
|
+ return evaluatePositives<BLACK_SIDE>(game) -
|
|
|
|
+ evaluatePositives<WHITE_SIDE>(game);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|