bishbosh-0.0.0.2: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.Input.CriteriaWeights

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Defines the weight associated with each criterion.

Synopsis

Types

Type-synonyms

Data-types

data CriteriaWeights criterionWeight Source #

  • The weight of various criteria used to select a move from alternatives, at specific point in the game.
  • CAVEAT: these weights determine the effective value of isolated or doubled Pawns, & this value shouldn't be less than their weighted normalised rank-value, otherwise sacrifice would be beneficial.

Instances

Num criterionWeight => Bounded (CriteriaWeights criterionWeight) Source # 

Methods

minBound :: CriteriaWeights criterionWeight #

maxBound :: CriteriaWeights criterionWeight #

Eq criterionWeight => Eq (CriteriaWeights criterionWeight) Source # 

Methods

(==) :: CriteriaWeights criterionWeight -> CriteriaWeights criterionWeight -> Bool #

(/=) :: CriteriaWeights criterionWeight -> CriteriaWeights criterionWeight -> Bool #

Show criterionWeight => Show (CriteriaWeights criterionWeight) Source # 

Methods

showsPrec :: Int -> CriteriaWeights criterionWeight -> ShowS #

show :: CriteriaWeights criterionWeight -> String #

showList :: [CriteriaWeights criterionWeight] -> ShowS #

NFData criterionWeight => NFData (CriteriaWeights criterionWeight) Source # 

Methods

rnf :: CriteriaWeights criterionWeight -> () #

Num criterionWeight => Default (CriteriaWeights criterionWeight) Source # 

Methods

def :: CriteriaWeights criterionWeight #

(XmlPickler criterionWeight, Num criterionWeight, Ord criterionWeight, Show criterionWeight) => XmlPickler (CriteriaWeights criterionWeight) Source # 

Methods

xpickle :: PU (CriteriaWeights criterionWeight) #

Real criterionWeight => ShowFloat (CriteriaWeights criterionWeight) Source # 

Methods

showsFloat :: (Double -> ShowS) -> CriteriaWeights criterionWeight -> ShowS Source #

Constants

tag :: String Source #

Used to qualify the XML.

weightOfMaterialTag :: String Source #

Used to qualify the XML.

weightOfPieceSquareValueTag :: String Source #

Used to qualify the XML.

onymousOperators :: [(String, CriteriaWeights criterionWeight -> CriterionWeight criterionWeight, CriterionWeight criterionWeight -> Transformation criterionWeight)] Source #

A list of named accessors & mutators.

Functions

calculateWeightedMean Source #

Arguments

:: (Fractional weightedMean, Real criterionValue, Real criterionWeight) 
=> CriteriaWeights criterionWeight 
-> CriterionValue criterionValue

material: maximum if a player's move equals the maximum total piece value (including queened Pawns), while their opponent has just a King.

-> CriterionValue criterionValue

mobility: maximum when the opponent is check-mated.

-> CriterionValue criterionValue

pieceSquareValue: maximum when this player occupies all the strategically important squares & the opponent none.

-> CriterionValue criterionValue

castlingPotential: maximum when this player either has castled or can, but the opponent has been permanently prevented.

-> CriterionValue criterionValue

defence: maximum when this player's pieces are fully utilised in defence, but none of the opponent's are.

-> CriterionValue criterionValue

doubledPawns: maximum when this player hasn't any doubled Pawns & the opponent has two files of four Pawns.

-> CriterionValue criterionValue

isolatedPawns: maximum when this player hasn't any isolated Pawns & all the opponent's Pawns are isolated.

-> CriterionValue criterionValue

passedPawns: maximum when this player has 8 passed Pawns & the opponent has none.

-> WeightedMeanAndCriterionValues weightedMean criterionValue

The individual criteria values, & their weighted mean.

  • Returns the weighted sum of the specified criteria, divided by the sum of the weights; https://chessprogramming.wikispaces.com/evaluation
  • Each criterion increases in proportion to some desirable attribute of the proposed game.
  • Each criterion should be in the same range of magnitudes, so that none dominates the total, thus making the total a clear measure of the value attributed to each.
  • Also writes individual unweighted criterion-values, to facilitate post-analysis; if the corresponding weight is zero, for efficiency evaluation of the criterion is avoided.

normalise :: (Fractional criterionWeight, Ord criterionWeight, Show criterionWeight) => Transformation criterionWeight Source #

Adjust the mean weight, so that the maximum weight is 1.

perturbWeights Source #

Arguments

:: (Fractional criterionWeight, Real criterionWeight, Show criterionWeight, RandomGen randomGen) 
=> randomGen 
-> criterionWeight

Change-magnitude.

-> Transformation criterionWeight 
  • Independently perturbs each criterion-weight by a random value, of configurable magnitude.
  • Under this transformation, criterion-weights of 0, will remain unchanged, thus irrelevant criteria remain irrelevant.

Constructor

mkCriteriaWeights Source #

Arguments

:: (Eq criterionWeight, Num criterionWeight) 
=> CriterionWeight criterionWeight

material.

-> CriterionWeight criterionWeight

mobility.

-> CriterionWeight criterionWeight

pieceSquareValue.

-> CriterionWeight criterionWeight

castlingPotential.

-> CriterionWeight criterionWeight

defence.

-> CriterionWeight criterionWeight

doubledPawns.

-> CriterionWeight criterionWeight

isolatedPawns.

-> CriterionWeight criterionWeight

passedPawns.

-> CriteriaWeights criterionWeight 

Smart-constructor.