bishbosh-0.0.0.2: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.Input.PieceSquareTable

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Defines the value for each type of piece, of occupying different squares.
  • This metric includes aspects of both control of the centre, & material advantage, in that a side's score can increase either by occupying more valuable squares or simply by having more pieces.
  • N.B.: the evaluation of fitness by "material" COULD be entirely built into these tables, so that the average value for a Queen is ~9 times that for a Pawn, but under these circumstances a non-zero material value for a King must be arbitrarily chosen.
  • N.B. The normal & end-game phases are typically represented by independent instances.

Synopsis

Types

Data-types

data PieceSquareTable x y pieceSquareValue Source #

Defines the value for each type of piece, of occupying each square.

Instances

(Eq pieceSquareValue, Ord y, Ord x, Enum y, Enum x) => Eq (PieceSquareTable x y pieceSquareValue) Source # 

Methods

(==) :: PieceSquareTable x y pieceSquareValue -> PieceSquareTable x y pieceSquareValue -> Bool #

(/=) :: PieceSquareTable x y pieceSquareValue -> PieceSquareTable x y pieceSquareValue -> Bool #

(Show pieceSquareValue, Show y, Show x, Ord y, Ord x, Enum y, Enum x) => Show (PieceSquareTable x y pieceSquareValue) Source # 

Methods

showsPrec :: Int -> PieceSquareTable x y pieceSquareValue -> ShowS #

show :: PieceSquareTable x y pieceSquareValue -> String #

showList :: [PieceSquareTable x y pieceSquareValue] -> ShowS #

Default (PieceSquareTable x y pieceSquareValue) Source # 

Methods

def :: PieceSquareTable x y pieceSquareValue #

(Enum x, Enum y, Fractional pieceSquareValue, Ord pieceSquareValue, Ord x, Ord y, Real pieceSquareValue, Show pieceSquareValue) => XmlPickler (PieceSquareTable x y pieceSquareValue) Source # 

Methods

xpickle :: PU (PieceSquareTable x y pieceSquareValue) #

(Enum x, Enum y, Ord x, Ord y, Real pieceSquareValue, Show pieceSquareValue) => ShowFloat (PieceSquareTable x y pieceSquareValue) Source # 

Methods

showsFloat :: (Double -> ShowS) -> PieceSquareTable x y pieceSquareValue -> ShowS Source #

Constants

tag :: String Source #

Used to qualify XML.

reflectOnYTag :: String Source #

Used to qualify XML.

Functions

findUndefinedRanks :: PieceSquareTable x y pieceSquareValue -> Set Rank Source #

Identify any rank lacking a definition.

dereference :: (Enum x, Enum y, Ord x, Ord y) => Rank -> PieceSquareTable x y pieceSquareValue -> Maybe [pieceSquareValue] Source #

Lookup the value for the specified rank.

Constructors

mkPieceSquareTable Source #

Arguments

:: (Enum x, Enum y, Num pieceSquareValue, Ord pieceSquareValue, Ord x, Ord y, Show pieceSquareValue) 
=> Bool

Whether values for the RHS of the board are inferred by reflection about the y-axis.

-> [(Rank, [pieceSquareValue])] 
-> PieceSquareTable x y pieceSquareValue 

Smart constructor.