selfplay

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

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

func (*Command) Execute

func (c *Command) Execute(ctx context.Context, flag *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*Command) Name

func (*Command) Name() string

func (*Command) SetFlags

func (c *Command) SetFlags(flags *flag.FlagSet)

func (*Command) Synopsis

func (*Command) Synopsis() string

func (*Command) Usage

func (*Command) Usage() string

type Config

type Config struct {
	Games int

	Verbose bool

	Initial []*tak.Position

	P1, P2 []string

	Zero  bool
	Size  int
	Depth int
	Debug int

	Swap      bool
	Threads   int
	Seed      int64
	Cutoff    int
	Limit     time.Duration
	GameTime  time.Duration
	Increment time.Duration

	Perturb float64
}

type Result

type Result struct {
	Initial  *tak.Position
	Position *tak.Position
	Moves    []tak.Move
	Winner   tak.Color
	// contains filtered or unexported fields
}

type Stats

type Stats struct {
	Players [2]struct {
		Wins      int
		WhiteWins int
		BlackWins int
		FlatWins  int
		RoadWins  int
		TimeWins  int
	}
	White, Black int
	Ties         int
	Cutoff       int

	Games []Result `json:"-"`
}

func Simulate

func Simulate(c *Config) Stats

func (*Stats) Count

func (s *Stats) Count() int

func (*Stats) Merge

func (s *Stats) Merge(other *Stats) Stats

type Summary

type Summary struct {
	Cmdline   []string
	Player1   string
	Player2   string
	Limit     time.Duration
	GameTime  time.Duration
	Increment time.Duration
	Stats     *Stats
}

Jump to

Keyboard shortcuts

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