Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- type Forest positionHash = [BarePositionHashQuantifiedGameTree positionHash]
- data NodeLabel positionHash
- newtype PositionHashQuantifiedGameTree positionHash = MkPositionHashQuantifiedGameTree {
- deconstruct :: BarePositionHashQuantifiedGameTree positionHash
- reduce :: IsMatch (NodeLabel positionHash) -> PositionHashQuantifiedGameTree positionHash -> Maybe (PositionHashQuantifiedGameTree positionHash)
- traceRoute :: (Turn -> IsMatch (NodeLabel positionHash)) -> PositionHashQuantifiedGameTree positionHash -> [Turn] -> Maybe [NodeLabel positionHash]
- resign :: PositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash
- traceMatchingMoveSequence :: PositionHashQuantifiedGameTree positionHash -> QualifiedMoveSequence -> Maybe [NodeLabel positionHash]
- promoteMatchingMoveSequence :: QualifiedMoveSequence -> Forest positionHash -> Maybe (Forest positionHash)
- sortNonCaptureMoves :: (Forest positionHash -> Forest positionHash) -> Forest positionHash -> Forest positionHash
- getRootQuantifiedGame' :: BarePositionHashQuantifiedGameTree positionHash -> QuantifiedGame
- getRootPositionHash :: PositionHashQuantifiedGameTree positionHash -> positionHash
- getRootQuantifiedGame :: PositionHashQuantifiedGameTree positionHash -> QuantifiedGame
- fromBarePositionHashQuantifiedGameTree :: BarePositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash
- mkPositionHashQuantifiedGameTree :: Bits positionHash => EvaluationOptions -> SearchOptions -> Zobrist positionHash -> MoveFrequency -> Game -> PositionHashQuantifiedGameTree positionHash
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
Eq positionHash => Eq (NodeLabel positionHash) Source # | |
Show positionHash => Show (NodeLabel positionHash) Source # | |
Null (NodeLabel positionHash) Source # | |
ShowNotationFloat (NodeLabel positionHash) Source # | |
Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree showsNotationFloat :: MoveNotation -> (Double -> ShowS) -> NodeLabel positionHash -> ShowS Source # |
newtype PositionHashQuantifiedGameTree positionHash Source #
Wrap the bare tree.
MkPositionHashQuantifiedGameTree | |
|
Instances
Eq positionHash => Eq (PositionHashQuantifiedGameTree positionHash) Source # | |
Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree (==) :: PositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash -> Bool # (/=) :: PositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash -> Bool # | |
Prunable (PositionHashQuantifiedGameTree positionHash) Source # | |
Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree prune :: Depth -> PositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash Source # | |
ShowNotationFloat (PositionHashQuantifiedGameTree positionHash) Source # | |
Defined in BishBosh.Evaluation.PositionHashQuantifiedGameTree showsNotationFloat :: MoveNotation -> (Double -> ShowS) -> PositionHashQuantifiedGameTree positionHash -> ShowS Source # |
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 #
:: PositionHashQuantifiedGameTree positionHash | |
-> QualifiedMoveSequence | |
-> Maybe [NodeLabel positionHash] | Returns |
Follow the specified move-sequence down the positionHashQuantifiedGameTree.
promoteMatchingMoveSequence Source #
:: QualifiedMoveSequence | The list of qualifiedMoves, which should be promoted at successively deeper levels in the tree. |
-> Forest positionHash | |
-> Maybe (Forest positionHash) | Returns |
- 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.
getRootQuantifiedGame :: PositionHashQuantifiedGameTree positionHash -> QuantifiedGame Source #
Accessor.
Constructor
fromBarePositionHashQuantifiedGameTree :: BarePositionHashQuantifiedGameTree positionHash -> PositionHashQuantifiedGameTree positionHash Source #
Constructor.
mkPositionHashQuantifiedGameTree Source #
:: Bits positionHash | |
=> EvaluationOptions | |
-> SearchOptions | |
-> Zobrist positionHash | |
-> MoveFrequency | |
-> Game | The current state of the game. |
-> PositionHashQuantifiedGameTree positionHash |
Constructor.