ab

package
v0.0.0-...-db2e5f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2019 License: BSD-2-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlphaBeta

func AlphaBeta(state *hex.State, timeToRun time.Duration, createTree bool,
	gridChan chan []uint32, patChan chan []int, resultChan chan [2][]int,
	getEstimatedValue func(s *Sample) float64, subtype string) (*hex.Action, *tree.Tree)

AlphaBeta runs search with AB pruning to select the next action to be taken. In addition to the selected action it returns the tree that was constructed during the last AB search (if wanted).

func GetEstimateFunction

func GetEstimateFunction(subtype string) func(s *Sample) float64

GetEstimateFunction returns a function that will be used for evaluating states

Types

type NodeValue

type NodeValue struct {
	// contains filtered or unexported fields
}

NodeValue stores a hex state and its estimated value, obtained by negamax algorithm with AB pruning. comment is used for debugging purposes

func CreateAbNodeValue

func CreateAbNodeValue(state *hex.State, value float64, comment string) *NodeValue

CreateAbNodeValue creates a new NodeValue with given state and its estimated value

func (NodeValue) MarshalJSON

func (anv NodeValue) MarshalJSON() ([]byte, error)

MarshalJSON implements Marshaler interface It returns NodeValue in JSON format

func (NodeValue) String

func (anv NodeValue) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL