continuous

package
v0.0.0-...-32cbd93 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeepFractionalPartRuleSet = func(cell *core.Cell[float64], neighbors []*core.Cell[float64]) *core.Cell[float64] {
	left := neighbors[0].State
	center := cell.State
	right := neighbors[1].State

	avg := (left + center + right) / 3
	scaler := (float64(3) / float64(2)) * avg
	fracPart := scaler - math.Floor(scaler)

	return &core.Cell[float64]{
		State:      fracPart,
		Coordinate: cell.Coordinate,
	}
}
View Source
var Neighbors = func(coord core.Coordinate) []core.Coordinate {
	left := core.Coordinate{(coord[0] - 1)}
	right := core.Coordinate{(coord[0] + 1)}
	return []core.Coordinate{left, right}
}
View Source
var SimpleAverageRuleSet = func(cell *core.Cell[float64], neighbors []*core.Cell[float64]) *core.Cell[float64] {
	left := neighbors[0].State
	center := cell.State
	right := neighbors[1].State

	avg := (left + center + right) / 3

	return &core.Cell[float64]{
		State:      avg,
		Coordinate: cell.Coordinate,
	}
}

Functions

func AddContinuousToImage

func AddContinuousToImage(ca *core.CellularAutomata[float64], img *image.Gray, stepNum, scale, length int)

func ContinuousCellularAutomata

func ContinuousCellularAutomata(length, steps int) *core.CellularAutomata[float64]

func MainContinuous

func MainContinuous(length, steps, scale int, initConfig []core.Coordinate)

func SetCenterConfig

func SetCenterConfig(length int) []core.Coordinate

func SetRandomConfig

func SetRandomConfig(length int) []core.Coordinate

Types

This section is empty.

Jump to

Keyboard shortcuts

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