mcts

package
v0.0.0-...-7c4a433 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalWeightedPolicy

func EvalWeightedPolicy(ctx context.Context,
	mc *MonteCarloAI,
	p *tak.Position, alloc *tak.Position) *tak.Position

func GetRand

func GetRand(ctx context.Context) *rand.Rand

func UniformRandomPolicy

func UniformRandomPolicy(ctx context.Context,
	m *MonteCarloAI,
	p *tak.Position, alloc *tak.Position) *tak.Position

func WithRand

func WithRand(ctx context.Context, r *rand.Rand) context.Context

Types

type MCTSConfig

type MCTSConfig struct {
	Debug int
	Limit time.Duration
	C     float64
	Seed  int64

	Size int

	Policy PolicyFunc
}

type MonteCarloAI

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

func NewMonteCarlo

func NewMonteCarlo(cfg MCTSConfig) *MonteCarloAI

func (*MonteCarloAI) GetMove

func (ai *MonteCarloAI) GetMove(ctx context.Context, p *tak.Position) tak.Move

type PolicyFunc

type PolicyFunc func(ctx context.Context,
	m *MonteCarloAI,
	p *tak.Position,
	next *tak.Position) *tak.Position

func NewMinimaxPolicy

func NewMinimaxPolicy(cfg *MCTSConfig, depth int) PolicyFunc

Jump to

Keyboard shortcuts

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