bishbosh-0.1.1.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Input.PieceSquareTable

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Defines the value for each type of piece, of occupying different squares.
  • This module is used to parse the user's configuration, which may involve reflecting their configuration to generate values for the RHS of the board.
  • This metric includes aspects of both control of the centre, & material advantage, in that a side's score can increase either by occupying squares of greater value, 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. CAVEAT: any normalisation is performed on each of these instances independently, using their respective minimum & maximum values, rather than using the global minimum & maximum.
Synopsis

Types

Type-synonyms

type Assocs rank pieceSquareValue = [(rank, [pieceSquareValue])] Source #

Type-synonym.

Data-types

data PieceSquareTable x y pieceSquareValue Source #

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

Instances

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

Defined in BishBosh.Input.PieceSquareTable

Methods

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

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

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

Defined in BishBosh.Input.PieceSquareTable

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 # 
Instance details

Defined in BishBosh.Input.PieceSquareTable

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 # 
Instance details

Defined in BishBosh.Input.PieceSquareTable

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 # 
Instance details

Defined in BishBosh.Input.PieceSquareTable

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

normaliseToUnitInterval :: (Fractional pieceSquareValue, Ord pieceSquareValue) => Assocs rank pieceSquareValue -> Assocs rank pieceSquareValue Source #

Map the range of values onto the Closed Unit Interval.

mirror :: Show pieceSquareValue => [pieceSquareValue] -> [pieceSquareValue] Source #

Generates a mirror-symmetric RHS, to build a complete description.

unmirror :: Show pieceSquareValue => [pieceSquareValue] -> [pieceSquareValue] Source #

Removes the mirror-symmetric RHS, for a concise description.

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

Identify any rank lacking a definition.

dereference :: Rank -> PieceSquareTable x y pieceSquareValue -> Maybe (ArrayByCoordinates x y pieceSquareValue) Source #

Lookup the values for all coordinates, corresponding to the specified rank.

Constructors

mkPieceSquareTable Source #

Arguments

:: (Enum x, Enum y, Fractional pieceSquareValue, Ord pieceSquareValue, Ord x, Ord y, Show pieceSquareValue) 
=> Normalise

Whether to normalise the specified values into the closed unit interval.

-> ReflectOnY

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

-> Assocs Rank pieceSquareValue 
-> PieceSquareTable x y pieceSquareValue 

Smart constructor.

Predicates

inClosedUnitInterval :: (Num pieceSquareValue, Ord pieceSquareValue) => Assocs rank pieceSquareValue -> Bool Source #

Check that the range of values is in the Closed Unit Interval.