bishbosh-0.1.3.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 positionHash = [BarePositionHashQuantifiedGameTree positionHash] Source #

Self-documentation.

Data-types

data NodeLabel 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
Eq positionHash => Eq (NodeLabel positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

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

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

Show positionHash => Show (NodeLabel positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

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

show :: NodeLabel positionHash -> String #

showList :: [NodeLabel positionHash] -> ShowS #

Null (NodeLabel positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

isNull :: NodeLabel positionHash -> Bool Source #

ShowNotationFloat (NodeLabel positionHash) Source # 
Instance details

Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree

Methods

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

newtype PositionHashQuantifiedGameTree positionHash Source #

Wrap the bare tree.

Constructors

MkPositionHashQuantifiedGameTree 

Fields

  • deconstruct :: BarePositionHashQuantifiedGameTree positionHash
     

Functions

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

Forward request.

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

Forward request.

resign :: PositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash Source #

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

traceMatchingMoveSequence Source #

Arguments

:: PositionHashQuantifiedGameTree positionHash 
-> QualifiedMoveSequence 
-> Maybe [NodeLabel positionHash]

Returns Nothing, on failure to match a move.

Follow the specified move-sequence down the positionHashQuantifiedGameTree.

promoteMatchingMoveSequence Source #

Arguments

:: QualifiedMoveSequence

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

-> Forest positionHash 
-> Maybe (Forest 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 positionHash -> Forest positionHash) -> Forest positionHash -> Forest 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 positionHash -> QuantifiedGame Source #

Accessor.

getRootPositionHash :: PositionHashQuantifiedGameTree positionHash -> positionHash Source #

Accessor.

Constructor

fromBarePositionHashQuantifiedGameTree :: BarePositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash Source #

Constructor.

mkPositionHashQuantifiedGameTree Source #

Arguments

:: Bits positionHash 
=> EvaluationOptions 
-> SearchOptions 
-> Zobrist positionHash 
-> MoveFrequency 
-> Game

The current state of the game.

-> PositionHashQuantifiedGameTree positionHash 

Constructor.

Predicates