Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 aPawn
, but under these circumstances a non-zero material value for aKing
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
- type IOFormat = Double
- type Assocs rank pieceSquareValue = [(rank, [pieceSquareValue])]
- data PieceSquareTable pieceSquareValue
- tag :: String
- reflectOnYTag :: String
- normaliseToUnitInterval :: (Fractional pieceSquareValue, Ord pieceSquareValue) => Assocs rank pieceSquareValue -> Assocs rank pieceSquareValue
- mirror :: Show pieceSquareValue => [pieceSquareValue] -> [pieceSquareValue]
- unmirror :: Show pieceSquareValue => [pieceSquareValue] -> [pieceSquareValue]
- findUndefinedRanks :: PieceSquareTable pieceSquareValue -> Set Rank
- dereference :: Rank -> PieceSquareTable pieceSquareValue -> Maybe (ArrayByCoordinates pieceSquareValue)
- mkPieceSquareTable :: (Fractional pieceSquareValue, Ord pieceSquareValue, Show pieceSquareValue) => Normalise -> ReflectOnY -> Assocs Rank pieceSquareValue -> PieceSquareTable pieceSquareValue
- inClosedUnitInterval :: (Num pieceSquareValue, Ord pieceSquareValue) => Assocs rank pieceSquareValue -> Bool
Types
Type-synonyms
Data-types
data PieceSquareTable pieceSquareValue Source #
Defines the value for each type of piece, of occupying each square.
Instances
Eq pieceSquareValue => Eq (PieceSquareTable pieceSquareValue) Source # | |
Defined in BishBosh.Input.PieceSquareTable (==) :: PieceSquareTable pieceSquareValue -> PieceSquareTable pieceSquareValue -> Bool # (/=) :: PieceSquareTable pieceSquareValue -> PieceSquareTable pieceSquareValue -> Bool # | |
Show pieceSquareValue => Show (PieceSquareTable pieceSquareValue) Source # | |
Defined in BishBosh.Input.PieceSquareTable showsPrec :: Int -> PieceSquareTable pieceSquareValue -> ShowS # show :: PieceSquareTable pieceSquareValue -> String # showList :: [PieceSquareTable pieceSquareValue] -> ShowS # | |
Default (PieceSquareTable pieceSquareValue) Source # | |
Defined in BishBosh.Input.PieceSquareTable def :: PieceSquareTable pieceSquareValue # | |
(Fractional pieceSquareValue, Ord pieceSquareValue, Real pieceSquareValue, Show pieceSquareValue) => XmlPickler (PieceSquareTable pieceSquareValue) Source # | |
Defined in BishBosh.Input.PieceSquareTable xpickle :: PU (PieceSquareTable pieceSquareValue) # | |
(Real pieceSquareValue, Show pieceSquareValue) => ShowFloat (PieceSquareTable pieceSquareValue) Source # | |
Defined in BishBosh.Input.PieceSquareTable showsFloat :: (Double -> ShowS) -> PieceSquareTable pieceSquareValue -> ShowS Source # |
Constants
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 pieceSquareValue -> Set Rank Source #
Identify any rank lacking a definition.
dereference :: Rank -> PieceSquareTable pieceSquareValue -> Maybe (ArrayByCoordinates pieceSquareValue) Source #
Lookup the values for all coordinates, corresponding to the specified rank.
Constructors
:: (Fractional pieceSquareValue, Ord pieceSquareValue, 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 pieceSquareValue |
Smart constructor.