evaluator

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package evaluator contains structures and functions to calculate the value of a chess position to be used in a chess engine search

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

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

Evaluator represents a data structure and functionality fo evaluating chess positions by using various evaluation heuristics like material, positional values, pawn structure, etc.

Create a new instance with NewEvaluator()

func NewEvaluator

func NewEvaluator() *Evaluator

NewEvaluator creates a new instance of an Evaluator.

func (*Evaluator) Evaluate

func (e *Evaluator) Evaluate(position *position.Position) Value

Evaluate calculates a value for a chess positions by using various evaluation heuristics like material, positional values, pawn structure, etc. It calls InitEval and then the internal evaluation function which calculates the value for the position of the given position for the current game phase and from the view of the next player.

func (*Evaluator) InitEval

func (e *Evaluator) InitEval(p *position.Position)

InitEval initializes data structures and values which are used several times Is called at the beginning of Evaluate() but can be called separately to be able to run single evaluations in unit tests.

func (*Evaluator) Report

func (e *Evaluator) Report() string

Report prints a report about the evaluations done. Used in debugging.

Jump to

Keyboard shortcuts

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