automata

package
v0.0.0-...-2489ded Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinSize = 12
	Steps   = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Automata

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

func New

func New(gridRowCount int, walls []*Wall, particles []*Particle) *Automata

func (*Automata) Advance

func (a *Automata) Advance()

func (*Automata) GetCurrentStep

func (a *Automata) GetCurrentStep() int

func (*Automata) GetGridCount

func (a *Automata) GetGridCount() int

func (*Automata) GetParticlesAtStep

func (a *Automata) GetParticlesAtStep() []*Particle

func (*Automata) Rewind

func (a *Automata) Rewind()

type Particle

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

func NewParticle

func NewParticle(value complex128, position [2]int) *Particle

func (*Particle) Calculate

func (p *Particle) Calculate()

func (*Particle) Clone

func (p *Particle) Clone() *Particle

func (*Particle) GetDirection

func (p *Particle) GetDirection() [2]int

func (*Particle) GetPosition

func (p *Particle) GetPosition() [2]int

func (*Particle) GetValue

func (p *Particle) GetValue() float64

func (*Particle) SetDirectionModifier

func (p *Particle) SetDirectionModifier(modifier int)

type Wall

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

func NewWall

func NewWall(position WallPosition, reaction WallEffect) *Wall

type WallEffect

type WallEffect byte
const (
	WallEffectNone WallEffect = iota
	WallEffectReverseDirection
	WallEffectTeleportOpposite
)

type WallPosition

type WallPosition byte
const (
	WallPositionTop WallPosition = iota
	WallPositionBottom
	WallPositionLeft
	WallPositionRight
)

func (WallPosition) GetOpposite

func (wp WallPosition) GetOpposite() WallPosition

Jump to

Keyboard shortcuts

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