mctsv3

package
v0.0.0-...-4fb7718 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseNewRoot

func ChooseNewRoot(root *node, state api.GameState) *node

func CreateTree

func CreateTree(b *bitboard.BitBoard, me string) *node

func GetNextMove

func GetNextMove(board *bitboard.BitBoard, config MCTSConfig, me string) bitboard.Dir

creates new workers each request, easier for now

func MCTS

func MCTS(root *node, minSims, simLimit, depthLim int) bitboard.Dir

func MCTSWorker

func MCTSWorker(ctx context.Context, rand *rand.Rand, root *node, config MCTSConfig) rewards

Types

type Game

type Game struct {
	Id     string
	Snakes []*SnakeMeta
	Me     *SnakeMeta
	Root   *node
}

type GameController

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

func CreateGameController

func CreateGameController() *GameController

func (*GameController) EndGame

func (gc *GameController) EndGame(state api.GameState)

func (*GameController) GetNextMove

func (gc *GameController) GetNextMove(state api.GameState, config MCTSConfig) bitboard.Dir

func (*GameController) StartGame

func (gc *GameController) StartGame(state api.GameState)

type Hydra

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

controller

type HydraHead

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

worker

type MCTSConfig

type MCTSConfig struct {
	MinimumSims    int
	SimLimit       int
	TreeDepthLimit int
}

type SnakeMeta

type SnakeMeta struct {
	Id   string
	Name string
}

Jump to

Keyboard shortcuts

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