neural_network

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PopulationSize  = 100
	PopSizeChRandom = false
)
View Source
const (
	Name                = "neural_network"
	EntityNeuralNetwork = string("neural_network")
)
View Source
const (
	SettingParam1 = "param1"
	SettingParam2 = "param2"

	AttrPhase = "phase"

	StateEnabled  = "enabled"
	StateDisabled = "disabled"

	ActionEnabled = "enable"
	ActionDisable = "disable"

	Version = "0.0.1"
)

Variables

This section is empty.

Functions

func New

func New() supervisor.Pluggable

func NewActions

func NewActions() map[string]supervisor.ActorAction

entity action list

func NewAttr

func NewAttr() m.Attributes

store entity status in this struct

func NewSettings

func NewSettings() m.Attributes

entity settings

func NewStates

func NewStates() (states map[string]supervisor.ActorState)

state list entity

Types

type Actor

type Actor struct {
	*supervisor.BaseActor
	// contains filtered or unexported fields
}

func NewActor

func NewActor(entity *m.Entity,
	service supervisor.Service) *Actor

func (*Actor) Destroy added in v0.12.0

func (e *Actor) Destroy()

type Game

type Game struct {
	Board  [3][3]GameState
	Player GameState
}

func NewGame

func NewGame() *Game

func (*Game) MakeMove

func (g *Game) MakeMove(row, col int) error

func (*Game) NumToCell

func (g *Game) NumToCell(num int) (row, col int)

func (*Game) PrintBoard

func (g *Game) PrintBoard()

func (*Game) UpdateBoard

func (g *Game) UpdateBoard(board [3][3]GameState)

type GameState

type GameState int
const (
	Empty GameState = 0
	X     GameState = 1
	O     GameState = -1
)

type Move added in v0.12.0

type Move struct {
	Row int
	Col int
}

type Network1

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

func NewNetwork1

func NewNetwork1(eventBus bus.Bus) (net *Network1)

func (*Network1) Train1

func (e *Network1) Train1()

func (*Network1) Train2

func (e *Network1) Train2()

func (*Network1) Train222

func (e *Network1) Train222()

Train222 ...

type Network2

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

func NewNetwork2

func NewNetwork2(eventBus bus.Bus) (net *Network2)

func (*Network2) MakeMove

func (e *Network2) MakeMove()

func (*Network2) SelectPopulation

func (e *Network2) SelectPopulation()

func (*Network2) Start

func (e *Network2) Start()

func (*Network2) Stop

func (e *Network2) Stop()

func (*Network2) Train1

func (e *Network2) Train1()

func (*Network2) Train2

func (e *Network2) Train2()

type TrainingData

type TrainingData struct {
	Input  []float64
	Output []int
}

func GenerateTrainingData

func GenerateTrainingData() []TrainingData

Jump to

Keyboard shortcuts

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