goneat

package module
v0.0.0-...-3ec271d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: LGPL-2.1 Imports: 7 Imported by: 0

README

goneat

NEAT neural network written in go http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf

Documentation

Index

Constants

View Source
const (
	INPUT  = 0
	HIDDEN = 1
	OUTPUT = 2
)

Variables

View Source
var GlobalFont *ttf.Font

TEST

Functions

func DisplayInfo

func DisplayInfo()

func DrawGraph

func DrawGraph(g *Genome)

func GetGeneration

func GetGeneration() int

func GetOutput

func GetOutput(genome *Genome) []float64

TODO: IMPROVE THIS!!! THIS IS HORRIBLE DON'T FORGET TO CHANGE THIS PLEASE

func GetRenderer

func GetRenderer() *sdl.Renderer

func InitGraph

func InitGraph()

Initilise the window and rederer

func NextGeneration

func NextGeneration(genomes []Genome)

func SetCustomInputCoord

func SetCustomInputCoord()

Types

type Connect

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

type Genome

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

func CreateGenome

func CreateGenome(input, output int) Genome

Create a Genome with the number of inputs and outputs

func CrossOver

func CrossOver(g1, g2 Genome) Genome

Standard corssover function with g1 being the most fit parent

func CrossOverRand

func CrossOverRand(g1, g2 Genome) Genome

This function is called when both parents have the same fitness

func InitNEAT

func InitNEAT(pop, input, output int) []Genome

Initialise the NEAT with the population size and number of input and output

func (*Genome) MutateGenomeConnect

func (g *Genome) MutateGenomeConnect()

Mutate Genome Connection

func (*Genome) MutateGenomeNode

func (g *Genome) MutateGenomeNode()

Mutate Genone Node

func (*Genome) SetFitness

func (g *Genome) SetFitness(fit int)

Sets the fitness of a given genome

func (*Genome) SetInputs

func (g *Genome) SetInputs(val []float64)

Sets the inputs of a given genome

type Node

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

type Species

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

func GetSpecies

func GetSpecies() []Species

Jump to

Keyboard shortcuts

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