Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- The instances of various moves, categorised by logical colour & rank, are recorded from recorded games.
- The frequency-distribution can then be used to sort the moves in the current game, to prioritise evaluation of likely candidates.
Synopsis
- type GetRankAndMove a move = a -> (Rank, move)
- data MoveFrequency move
- countEntries :: MoveFrequency move -> NPlies
- countDistinctEntries :: MoveFrequency move -> NPlies
- insertMoves :: Ord move => LogicalColour -> GetRankAndMove a move -> MoveFrequency move -> [a] -> MoveFrequency move
- sortByDescendingMoveFrequency :: Ord move => LogicalColour -> GetRankAndMove a move -> MoveFrequency move -> [a] -> [a]
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 # | |
Defined in BishBosh.Model.MoveFrequency (==) :: MoveFrequency move -> MoveFrequency move -> Bool # (/=) :: MoveFrequency move -> MoveFrequency move -> Bool # | |
Empty (MoveFrequency move) Source # | |
Defined in BishBosh.Model.MoveFrequency empty :: MoveFrequency move Source # | |
Null (MoveFrequency move) Source # | |
Defined in BishBosh.Model.MoveFrequency isNull :: MoveFrequency move -> Bool Source # |
Functions
countEntries :: MoveFrequency move -> NPlies Source #
Count the total number of entries.
countDistinctEntries :: MoveFrequency move -> NPlies Source #
- Count the total number of distinct entries.
- N.B.: in this context, a distinct move is one which wasn't made in any other branch of the tree. E.g.: many recorded games will start with the same move, which becomes just one node in the game-tree from which this structure is derived, & so will only have a count of one in this structure. If this same move is also made subsequently (i.e. after a different opening), then it exists on a different branch of the tree, & increases the move's count to 2 but doesn't increase the number of distinct moves.
:: 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 #
:: 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.