bishbosh-0.1.1.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Evaluation.PositionHashQuantifiedGameTree

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Constructs a tree in which each node contains; a Zobrist-hash; a quantifiedGame with one of the moves available to its parent node applied; & an evaluation of the fitness of the resulting position.
  • Each forest in the tree is sorted, before evaluation of its fitness is performed.
  • CAVEAT: promotions are insufficiently frequent to be treated specially when sorting.
Synopsis

Types

Type-synonyms

type Forest x y positionHash = [BarePositionHashQuantifiedGameTree x y positionHash] Source #

Self-documentation.

Data-types

data NodeLabel x y positionHash Source #

Define a node in the tree to contain the hash of a game & an evaluation of the fitness of that game.

Instances

Instances details
(Enum x, Enum y, Ord x, Ord y, Eq positionHash) => Eq (NodeLabel x y positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

(==) :: NodeLabel x y positionHash -> NodeLabel x y positionHash -> Bool #

(/=) :: NodeLabel x y positionHash -> NodeLabel x y positionHash -> Bool #

(Enum x, Enum y, Ord x, Ord y, Show positionHash, Show x, Show y) => Show (NodeLabel x y positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

showsPrec :: Int -> NodeLabel x y positionHash -> ShowS #

show :: NodeLabel x y positionHash -> String #

showList :: [NodeLabel x y positionHash] -> ShowS #

Null (NodeLabel x y positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

isNull :: NodeLabel x y positionHash -> Bool Source #

(Enum x, Enum y) => ShowNotationFloat (NodeLabel x y positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

showsNotationFloat :: MoveNotation -> (Double -> ShowS) -> NodeLabel x y positionHash -> ShowS Source #

newtype PositionHashQuantifiedGameTree x y positionHash Source #

Wrap the bare tree.

Constructors

MkPositionHashQuantifiedGameTree 

Fields

  • deconstruct :: BarePositionHashQuantifiedGameTree x y positionHash
     

Instances

Instances details
(Enum x, Enum y, Ord x, Ord y, Eq positionHash) => Eq (PositionHashQuantifiedGameTree x y positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

(==) :: PositionHashQuantifiedGameTree x y positionHash -> PositionHashQuantifiedGameTree x y positionHash -> Bool #

(/=) :: PositionHashQuantifiedGameTree x y positionHash -> PositionHashQuantifiedGameTree x y positionHash -> Bool #

Prunable (PositionHashQuantifiedGameTree x y positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

prune :: Depth -> PositionHashQuantifiedGameTree x y positionHash -> PositionHashQuantifiedGameTree x y positionHash Source #

(Enum x, Enum y) => ShowNotationFloat (PositionHashQuantifiedGameTree x y positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Functions

reduce :: IsMatch (NodeLabel x y positionHash) -> PositionHashQuantifiedGameTree x y positionHash -> Maybe (PositionHashQuantifiedGameTree x y positionHash) Source #

Forward request.

traceRoute :: (Turn x y -> IsMatch (NodeLabel x y positionHash)) -> PositionHashQuantifiedGameTree x y positionHash -> [Turn x y] -> Maybe [NodeLabel x y positionHash] Source #

Forward request.

resign :: PositionHashQuantifiedGameTree x y positionHash -> PositionHashQuantifiedGameTree x y positionHash Source #

Amend the apex-game to reflect the resignation of the next player.

traceMatchingMoves Source #

Arguments

:: (Eq x, Eq y) 
=> PositionHashQuantifiedGameTree x y positionHash 
-> [QualifiedMove x y] 
-> Maybe [NodeLabel x y positionHash]

Returns Nothing, on failure to match a move.

Follow the specified move-sequence down the positionHashQuantifiedGameTree.

promoteMatchingMoves Source #

Arguments

:: (Eq x, Eq y) 
=> [QualifiedMove x y]

The list of qualifiedMoves, which should be promoted at successively deeper levels in the tree.

-> Forest x y positionHash 
-> Maybe (Forest x y positionHash)

Returns Nothing on failure to match a move.

  • Promotes the first matching move to the head of the forest, then descends & recursively promotes the next matching move in the sub-forest.
  • N.B.: this can be used to dynamically re-order the forest when a transposition is detected.

sortNonCaptureMoves :: (Forest x y positionHash -> Forest x y positionHash) -> Forest x y positionHash -> Forest x y positionHash Source #

  • Sorts the forest, starting just after any initial capture-moves.
  • N.B.: this can be used to dynamically re-order the forest using the killer heuristic.

Accessors

getRootQuantifiedGame' :: BarePositionHashQuantifiedGameTree x y positionHash -> QuantifiedGame x y Source #

Accessor.

getRootPositionHash :: PositionHashQuantifiedGameTree x y positionHash -> positionHash Source #

Accessor.

Constructor

fromBarePositionHashQuantifiedGameTree :: BarePositionHashQuantifiedGameTree x y positionHash -> PositionHashQuantifiedGameTree x y positionHash Source #

Constructor.

mkPositionHashQuantifiedGameTree Source #

Arguments

:: (Ix x, Bits positionHash, Fractional pieceSquareValue, Integral x, Integral y, Real pieceSquareValue, Show x, Show y) 
=> EvaluationOptions pieceSquareValue x y 
-> SearchOptions 
-> Zobrist x y positionHash 
-> MoveFrequency x y 
-> Game x y

The current state of the game.

-> PositionHashQuantifiedGameTree x y positionHash 

Constructor.

Predicates