apt

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

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

Go to latest
Published: Jan 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Optimize

func Optimize(node Node)

func ReplaceNode

func ReplaceNode(old Node, new Node)

Types

type BaseNode

type BaseNode struct {
	Parent   Node
	Children []Node
}

func (*BaseNode) AddLeaf

func (node *BaseNode) AddLeaf(leaf Node) bool

func (*BaseNode) AddRandom

func (node *BaseNode) AddRandom(nodeToAdd Node)

func (*BaseNode) Eval

func (node *BaseNode) Eval(x, y float32) float32

func (*BaseNode) GetChildren

func (node *BaseNode) GetChildren() []Node

func (*BaseNode) GetParent

func (node *BaseNode) GetParent() Node

func (*BaseNode) NodeCount

func (node *BaseNode) NodeCount() int

func (*BaseNode) SetChildren

func (node *BaseNode) SetChildren(children []Node)

func (*BaseNode) SetParent

func (node *BaseNode) SetParent(parent Node)

func (*BaseNode) String

func (node *BaseNode) String() string

type Node

type Node interface {
	Eval(x, y float32) float32
	String() string
	SetParent(parent Node)
	GetParent() Node
	GetChildren() []Node
	SetChildren([]Node)
	AddRandom(node Node)
	AddLeaf(leaf Node) bool
	NodeCount() int
}

func BeginLexing

func BeginLexing(s string) Node

func CopyTree

func CopyTree(node Node, parent Node) Node

func GetNthNode

func GetNthNode(node Node, n, count int) (Node, int)

func GetRandomLeaf

func GetRandomLeaf() Node

func GetRandomNode

func GetRandomNode() Node

func Mutate

func Mutate(node Node) Node

type OpAbs

type OpAbs struct {
	BaseNode
}

func NewOpAbs

func NewOpAbs() *OpAbs

func (*OpAbs) Eval

func (op *OpAbs) Eval(x, y float32) float32

func (*OpAbs) String

func (op *OpAbs) String() string

type OpAtan

type OpAtan struct {
	BaseNode
}

func NewOpAtan

func NewOpAtan() *OpAtan

func (*OpAtan) Eval

func (op *OpAtan) Eval(x, y float32) float32

func (*OpAtan) String

func (op *OpAtan) String() string

type OpAtan2

type OpAtan2 struct {
	BaseNode
}

func NewOpAtan2

func NewOpAtan2() *OpAtan2

func (*OpAtan2) Eval

func (op *OpAtan2) Eval(x, y float32) float32

func (*OpAtan2) String

func (op *OpAtan2) String() string

type OpCeil

type OpCeil struct {
	BaseNode
}

func NewOpCeil

func NewOpCeil() *OpCeil

func (*OpCeil) Eval

func (op *OpCeil) Eval(x, y float32) float32

func (*OpCeil) String

func (op *OpCeil) String() string

type OpClip

type OpClip struct {
	BaseNode
}

func NewOpClip

func NewOpClip() *OpClip

func (*OpClip) Eval

func (op *OpClip) Eval(x, y float32) float32

func (*OpClip) String

func (op *OpClip) String() string

type OpConstant

type OpConstant struct {
	BaseNode
	// contains filtered or unexported fields
}

func NewOpConstant

func NewOpConstant() *OpConstant

func (*OpConstant) Eval

func (op *OpConstant) Eval(x, y float32) float32

func (*OpConstant) String

func (op *OpConstant) String() string

type OpCos

type OpCos struct {
	BaseNode
}

func NewOpCos

func NewOpCos() *OpCos

func (*OpCos) Eval

func (op *OpCos) Eval(x, y float32) float32

func (*OpCos) String

func (op *OpCos) String() string

type OpDiv

type OpDiv struct {
	BaseNode
}

func NewOpDiv

func NewOpDiv() *OpDiv

func (*OpDiv) Eval

func (op *OpDiv) Eval(x, y float32) float32

func (*OpDiv) String

func (op *OpDiv) String() string

type OpFBM

type OpFBM struct {
	BaseNode
}

func NewOpFBM

func NewOpFBM() *OpFBM

func (*OpFBM) Eval

func (op *OpFBM) Eval(x, y float32) float32

func (*OpFBM) String

func (op *OpFBM) String() string

type OpFloor

type OpFloor struct {
	BaseNode
}

func NewOpFloor

func NewOpFloor() *OpFloor

func (*OpFloor) Eval

func (op *OpFloor) Eval(x, y float32) float32

func (*OpFloor) String

func (op *OpFloor) String() string

type OpLerp

type OpLerp struct {
	BaseNode
}

func NewOpLerp

func NewOpLerp() *OpLerp

func (*OpLerp) Eval

func (op *OpLerp) Eval(x, y float32) float32

func (*OpLerp) String

func (op *OpLerp) String() string

type OpLog2

type OpLog2 struct {
	BaseNode
}

func NewOpLog2

func NewOpLog2() *OpLog2

func (*OpLog2) Eval

func (op *OpLog2) Eval(x, y float32) float32

func (*OpLog2) String

func (op *OpLog2) String() string

type OpMinus

type OpMinus struct {
	BaseNode
}

func NewOpMinus

func NewOpMinus() *OpMinus

func (*OpMinus) Eval

func (op *OpMinus) Eval(x, y float32) float32

func (*OpMinus) String

func (op *OpMinus) String() string

type OpMult

type OpMult struct {
	BaseNode
}

func NewOpMult

func NewOpMult() *OpMult

func (*OpMult) Eval

func (op *OpMult) Eval(x, y float32) float32

func (*OpMult) String

func (op *OpMult) String() string

type OpNegate

type OpNegate struct {
	BaseNode
}

func NewOpNegate

func NewOpNegate() *OpNegate

func (*OpNegate) Eval

func (op *OpNegate) Eval(x, y float32) float32

func (*OpNegate) String

func (op *OpNegate) String() string

type OpNoise

type OpNoise struct {
	BaseNode
}

func NewOpNoise

func NewOpNoise() *OpNoise

func (*OpNoise) Eval

func (op *OpNoise) Eval(x, y float32) float32

func (*OpNoise) String

func (op *OpNoise) String() string

type OpPicture

type OpPicture struct {
	BaseNode
}

func NewOpPicture

func NewOpPicture() *OpPicture

func (*OpPicture) Eval

func (op *OpPicture) Eval(x, y float32) float32

func (*OpPicture) String

func (op *OpPicture) String() string

type OpPlus

type OpPlus struct {
	BaseNode
}

func NewOpPlus

func NewOpPlus() *OpPlus

func (*OpPlus) Eval

func (op *OpPlus) Eval(x, y float32) float32

func (*OpPlus) String

func (op *OpPlus) String() string

type OpSin

type OpSin struct {
	BaseNode
}

func NewOpSin

func NewOpSin() *OpSin

func (*OpSin) Eval

func (op *OpSin) Eval(x, y float32) float32

func (*OpSin) String

func (op *OpSin) String() string

type OpSquare

type OpSquare struct {
	BaseNode
}

func NewOpSquare

func NewOpSquare() *OpSquare

func (*OpSquare) Eval

func (op *OpSquare) Eval(x, y float32) float32

func (*OpSquare) String

func (op *OpSquare) String() string

type OpTurbulence

type OpTurbulence struct {
	BaseNode
}

func NewOpTurbulence

func NewOpTurbulence() *OpTurbulence

func (*OpTurbulence) Eval

func (op *OpTurbulence) Eval(x, y float32) float32

func (*OpTurbulence) String

func (op *OpTurbulence) String() string

type OpWrap

type OpWrap struct {
	BaseNode
}

func NewOpWrap

func NewOpWrap() *OpWrap

func (*OpWrap) Eval

func (op *OpWrap) Eval(x, y float32) float32

func (*OpWrap) String

func (op *OpWrap) String() string

type OpX

type OpX struct {
	BaseNode
}

func NewOpX

func NewOpX() *OpX

func (*OpX) Eval

func (op *OpX) Eval(x, y float32) float32

func (*OpX) String

func (op *OpX) String() string

type OpY

type OpY struct {
	BaseNode
}

func NewOpY

func NewOpY() *OpY

func (*OpY) Eval

func (op *OpY) Eval(x, y float32) float32

func (*OpY) String

func (op *OpY) String() string

Jump to

Keyboard shortcuts

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