refactor: Rename get_mobility_diff to calculate_mobility_diff
Because original get_mobility_diff() is used to re-calculate value.
This commit is contained in:
parent
f30496c237
commit
a18f96e1d5
|
@ -59,10 +59,10 @@ Value Evaluation::value()
|
||||||
case Phase::placing:
|
case Phase::placing:
|
||||||
#ifdef EVALUATE_MOBILITY
|
#ifdef EVALUATE_MOBILITY
|
||||||
if (gameOptions.getConsiderMobility()) {
|
if (gameOptions.getConsiderMobility()) {
|
||||||
value += (Value)pos.get_mobility_diff();
|
value += (Value)pos.calculate_mobility_diff();
|
||||||
} else if (gameOptions.getDrawOnHumanExperience()) {
|
} else if (gameOptions.getDrawOnHumanExperience()) {
|
||||||
if (pos.piece_on_board_count(WHITE) + pos.piece_on_board_count(BLACK) <= 5) {
|
if (pos.piece_on_board_count(WHITE) + pos.piece_on_board_count(BLACK) <= 5) {
|
||||||
value += (Value)pos.get_mobility_diff();
|
value += (Value)pos.calculate_mobility_diff();
|
||||||
}
|
}
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ Value Evaluation::value()
|
||||||
|
|
||||||
case Phase::moving:
|
case Phase::moving:
|
||||||
#ifdef EVALUATE_MOBILITY
|
#ifdef EVALUATE_MOBILITY
|
||||||
//value += (Value)pos.get_mobility_diff();
|
//value += (Value)pos.calculate_mobility_diff();
|
||||||
//break;
|
//break;
|
||||||
#endif /* EVALUATE_MOBILITY */
|
#endif /* EVALUATE_MOBILITY */
|
||||||
|
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ bool Position::check_if_game_is_over()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Position::get_mobility_diff()
|
int Position::calculate_mobility_diff()
|
||||||
{
|
{
|
||||||
// TODO: Deal with rule is no ban location
|
// TODO: Deal with rule is no ban location
|
||||||
int mobilityWhite = 0;
|
int mobilityWhite = 0;
|
||||||
|
|
|
@ -105,8 +105,6 @@ public:
|
||||||
enum Action get_action() const;
|
enum Action get_action() const;
|
||||||
const char *get_record() const;
|
const char *get_record() const;
|
||||||
|
|
||||||
int get_mobility_diff();
|
|
||||||
|
|
||||||
bool reset();
|
bool reset();
|
||||||
bool start();
|
bool start();
|
||||||
bool resign(Color loser);
|
bool resign(Color loser);
|
||||||
|
@ -147,6 +145,8 @@ public:
|
||||||
|
|
||||||
int piece_to_remove_count() const;
|
int piece_to_remove_count() const;
|
||||||
|
|
||||||
|
int calculate_mobility_diff();
|
||||||
|
|
||||||
static bool is_star_square(Square s);
|
static bool is_star_square(Square s);
|
||||||
|
|
||||||
bool bitboard_is_ok();
|
bool bitboard_is_ok();
|
||||||
|
|
Loading…
Reference in New Issue