change BoardValueMap type to i8
This commit is contained in:
parent
886eddf484
commit
5796032693
@ -1,6 +1,6 @@
|
|||||||
use crate::repr::{Board, Piece, PosMap};
|
use crate::repr::{Board, Piece, PosMap};
|
||||||
|
|
||||||
pub struct BoardValueMap(PosMap<i16>);
|
pub struct BoardValueMap(PosMap<i8>);
|
||||||
|
|
||||||
impl BoardValueMap {
|
impl BoardValueMap {
|
||||||
pub fn board_value(&self, board: &Board, color: Piece) -> i16 {
|
pub fn board_value(&self, board: &Board, color: Piece) -> i16 {
|
||||||
@ -15,12 +15,13 @@ impl BoardValueMap {
|
|||||||
// target has position
|
// target has position
|
||||||
value
|
value
|
||||||
})
|
})
|
||||||
|
.map(|x| x as i16)
|
||||||
.sum()
|
.sum()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Weights from: https://repub.eur.nl/pub/7142/ei2005-47.pdf
|
/// Weights from: https://repub.eur.nl/pub/7142/ei2005-47.pdf
|
||||||
pub const fn weighted() -> Self {
|
pub const fn weighted() -> Self {
|
||||||
const POSITION_VALUES: [[i16; 8]; 8] = [
|
const POSITION_VALUES: [[i8; 8]; 8] = [
|
||||||
[100, -20, 10, 5, 5, 10, -20, 100],
|
[100, -20, 10, 5, 5, 10, -20, 100],
|
||||||
[-20, -50, -2, -2, -2, -2, -50, -20],
|
[-20, -50, -2, -2, -2, -2, -50, -20],
|
||||||
[10, -2, -1, -1, -1, -1, -2, 10],
|
[10, -2, -1, -1, -1, -1, -2, 10],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user