queen

package
v0.0.0-...-8e0f694 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x int) int

func CanAttack

func CanAttack(a, b Point) bool

func CanPlace

func CanPlace(target Point, board []Point) bool

func ClassicMain

func ClassicMain()

func CrossoverEachGene

func CrossoverEachGene(p genetic.Population, ai int, bi int) (genetic.Single, genetic.Single)

func CrossoverLR

func CrossoverLR(p genetic.Population, ai int, bi int) (genetic.Single, genetic.Single)

func CrossoverRing

func CrossoverRing(p genetic.Population, ai int, bi int) (genetic.Single, genetic.Single)

func GeneticMain

func GeneticMain()

func Random

func Random(p genetic.Population) genetic.Single

func Recurse

func Recurse(point Point, current []Point, n int)

func ScoreNormalizeLossReciprocal

func ScoreNormalizeLossReciprocal(factor float64) func(genetic.ScoreFunc) genetic.ScoreFunc

func ScorePower

func ScorePower(n float64) genetic.ScoreFunc

func Solve

func Solve(n int)

func ToImage

func ToImage(p genetic.Population, index int) image.Image

Types

type Point

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

type Queen

type Queen []int

func (Queen) Copy

func (q Queen) Copy() genetic.Single

func (Queen) Equal

func (q Queen) Equal(o genetic.Single) bool

func (Queen) FindRings

func (q Queen) FindRings(o Queen) [][]int

func (Queen) IndexOf

func (q Queen) IndexOf(pos int) int

func (Queen) RandomSwap

func (q Queen) RandomSwap()

Jump to

Keyboard shortcuts

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