Documentation ¶
Index ¶
- Variables
- func AddContinuousToImage(ca *core.CellularAutomata[float64], img *image.Gray, ...)
- func ContinuousCellularAutomata(length, steps int) *core.CellularAutomata[float64]
- func MainContinuous(length, steps, scale int, initConfig []core.Coordinate)
- func SetCenterConfig(length int) []core.Coordinate
- func SetRandomConfig(length int) []core.Coordinate
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 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.
Click to show internal directories.
Click to hide internal directories.