bishbosh-0.0.0.3: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.Model.MoveFrequency

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • The instances of various moves, categorised by logical colour & rank, are recorded from a large resource of games.
  • The frequency-distribution can then be used to sort the moves in the current game, to prioritise evaluation of likely candidates.

Synopsis

Types

Type-synonyms

type GetRankAndMove a move = a -> (Rank, move) Source #

The type of a function which can extract the rank & move from a datum.

Data-types

data MoveFrequency move Source #

The number of recorded instances of each move.

Instances

Eq move => Eq (MoveFrequency move) Source # 

Methods

(==) :: MoveFrequency move -> MoveFrequency move -> Bool #

(/=) :: MoveFrequency move -> MoveFrequency move -> Bool #

Empty (MoveFrequency move) Source # 

Methods

empty :: MoveFrequency move Source #

Null (MoveFrequency move) Source # 

Methods

isNull :: MoveFrequency move -> Bool Source #

Functions

countEntries :: MoveFrequency move -> NMoves Source #

Count the total number of entries.

insertMoves Source #

Arguments

:: Ord move 
=> LogicalColour

References the player who is required to make any one of the specified moves.

-> GetRankAndMove a move

How to extract the required rank & move from a datum.

-> MoveFrequency move 
-> [a]

The data from each of which, rank & move can be extracted.

-> MoveFrequency move 
  • Inserts a list of data from which rank & move can be extracted, each of which were made by pieces of the same logical colour, i.e. by the same player.
  • If the entry already exists, then the count for that rank & move, is increased.

sortByDescendingMoveFrequency Source #

Arguments

:: Ord move 
=> LogicalColour

References the player who is required to make any one of the specified moves.

-> GetRankAndMove a move

How to extract the required rank & move from a datum.

-> MoveFrequency move 
-> [a]

The data from each of which, rank & move can be extracted.

-> [a] 
  • Sorts an arbitrary list on the recorded frequency of the rank & move accessible from each list-item.
  • The rank & move extracted from each list-item, is assumed to have been made by the player of the specified logical colour.