Documentation ¶
Index ¶
- Constants
- Variables
- func EvaluateWinner(m *MinimaxAI, p *tak.Position) int64
- func ExplainScore(m *MinimaxAI, out io.Writer, p *tak.Position)
- type EvaluationFunc
- type FlatScores
- type MinimaxAI
- func (m *MinimaxAI) Analyze(ctx context.Context, p *tak.Position) ([]tak.Move, int64, Stats)
- func (m *MinimaxAI) GetMove(ctx context.Context, p *tak.Position) tak.Move
- func (m *MinimaxAI) GetMove1(ctx context.Context, p *tak.Position, spread float64) (tak.Move, float64)
- func (m *MinimaxAI) GetMovex(ctx context.Context, p *tak.Position, depth int, spread float64) (tak.Move, float64)
- type MinimaxConfig
- type RandomAI
- type Stats
- type TakPlayer
- type Weights
Constants ¶
View Source
const ( MaxEval int64 = 1 << 30 MinEval = -MaxEval WinThreshold = 1 << 29 Illegal = -1 << 31 )
Variables ¶
View Source
var DefaultWeights = []Weights{
defaultWeights,
defaultWeights,
defaultWeights,
defaultWeights,
defaultWeights,
defaultWeights,
defaultWeights6,
defaultWeights,
defaultWeights,
}
View Source
var WeightNohat = []float64{
0,
-20,
-40,
-80,
-160,
-320,
-720,
-100000,
0,
25,
50,
100,
200,
400,
10000,
20000,
600,
450,
300,
150,
0,
20,
100,
200,
600,
-10,
-30,
.003,
5,
60,
}
View Source
var WeightNohat6x6 = []float64{
-7.882857408056033,
-18.422073883974566,
-36.0493127331049,
-79.56604291873225,
-118.62470509229402,
-210.29295370964735,
-517.3034545361437,
-100000,
-10,
10,
35,
90,
160,
320,
10000,
20000,
758.9873559223424,
583.7652877392484,
418.738596952849,
181.21979073578143,
0,
23.88262609962125,
95.00995285905964,
226.4340785427944,
790.8549324342757,
-10,
-25,
0.0028395103346359513,
5.204139819874648,
73.41388857816798,
}
View Source
var WeightNohatAdjust = []float64{
-50,
-50,
-50,
-80,
-160,
-320,
-720,
0,
50,
50,
50,
100,
200,
400,
0,
0,
600,
450,
300,
150,
0,
20,
100,
200,
750,
-10,
-30,
.003,
5,
60,
}
var WeightNohat = []float64{0, -20.80992860246264, -39.53973239686991, -81.50246863507586, -155.93079444027765, -289.23796777428583, -614.5346962394407, -100000, 0, 32.30082505350642, 45.12214408862102, 65.61008053136833, 156.60239035239982, 413.263468400728, 10000, 20000, 589.4603825920285, 506.1123687112676, 344.8402195215042, 194.76452676703917, 0, 19.077561948722284, 98.2862020188589, 222.64556765567144, 612.5365342926455, -9.800679880630113, -36.74424919228099, 0.002582788992910993, 5.446911960287178, 72.91389999925025}
Functions ¶
Types ¶
type EvaluationFunc ¶
func MakeEvaluator ¶
func MakeEvaluator(size int, w *Weights) EvaluationFunc
func MakeNohat ¶
func MakeNohat(size int, w []float64) EvaluationFunc
type FlatScores ¶
type FlatScores struct {
Hard, Soft int
}
type MinimaxAI ¶
type MinimaxAI struct { Diversify int64 // contains filtered or unexported fields }
func NewMinimax ¶
func NewMinimax(cfg MinimaxConfig) *MinimaxAI
type MinimaxConfig ¶
type Weights ¶
type Weights struct { TopFlat int EndgameFlat int Standing int Capstone int FlatCaptives FlatScores StandingCaptives FlatScores CapstoneCaptives FlatScores Liberties int Groups [8]int }
Click to show internal directories.
Click to hide internal directories.