Documentation
¶
Index ¶
- Variables
- func AddTotalisticToImage(ca *core.CellularAutomata[int], img *image.Gray, stepNum, scale, length int)
- func MainTotalistic(ruleNum, length, steps, scale int, initConfig []core.Coordinate)
- func SetCenterConfig(length int) []core.Coordinate
- func SetRandomConfig(length int) []core.Coordinate
- func TotalisticCellularAutomata(ruleNum, length, steps int) *core.CellularAutomata[int]
- func TotalisticRuleSet(ruleNumber int) core.RuleSet[int]
Constants ¶
This section is empty.
Variables ¶
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} }
Functions ¶
func AddTotalisticToImage ¶
func MainTotalistic ¶
func MainTotalistic(ruleNum, length, steps, scale int, initConfig []core.Coordinate)
func SetCenterConfig ¶
func SetCenterConfig(length int) []core.Coordinate
func SetRandomConfig ¶
func SetRandomConfig(length int) []core.Coordinate
func TotalisticCellularAutomata ¶
func TotalisticCellularAutomata(ruleNum, length, steps int) *core.CellularAutomata[int]
func TotalisticRuleSet ¶
totalistic rule numbers correspond to a sequence of base 3 digits
we consider the average of the 3 states in the neighborhood. there are 7 possible averages: 2, 5/3, 4/3, 1, 2/3, 1/3, 0
thus we have 3^7 = 2187 total possible rules
now we can encode a rule as a base 3 number where each average is mapped to a state for example: 2 -> 1 5/3 -> 2 4/3 -> 0 1 -> 2 2/3 -> 1 1/3 -> 0 0 -> 2
this rule, in base 3 is: 1202102, so the base 10 rule number is: 1280
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.