Documentation ¶
Index ¶
- func GetCenteredLine(length int, states int) []int
- func GetMaxRule(maxStatesCombi int) float64
- func GetMaxStatesCombinaisons(states int, order int) int
- func GetPixelsOnLeft(length int, states int) []int
- func GetPixelsOnRight(length int, states int) []int
- func GetRandomLine(length int, states int) []int
- func Reverse(number string) []int
- func RuleToArray(states int, order int, ruleNumber float64) []int
- type CellularAutomata
- type FirstLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMaxRule ¶
GetMaxRule the higher rule number possible
func GetMaxStatesCombinaisons ¶
GetMaxStatesCombinaisons the maximum number of combinaisons from the states & used number of cells
func Reverse ¶
Reverse invert the number as string, to render as an array of int 12110 -> [0, 1, 1, 2, 1]
func RuleToArray ¶
RuleToArray Generates an associative array, where N cells with S states generate a new cell Basic cellular automata (2 states, 1st order), based on the 3 cells above. For example, for the rule 30 (11110 in base 2), the array map these values : current pattern : 111 (7) 110 (6) 101 (5) 100 (4) 011 (3) 010 (2) 001 (1) 000 (0) new state for center cell: 0 0 0 1 1 1 1 0
Types ¶
type CellularAutomata ¶
type CellularAutomata struct { States int Order int Columns int Rows int RuleNumber float64 FirstLine FirstLine }
CellularAutomata The cellular automata structure
func (CellularAutomata) GetMatrix ¶
func (c CellularAutomata) GetMatrix() [][]int
GetMatrix Builds the matrix line after line
func (CellularAutomata) GetMetadata ¶
func (c CellularAutomata) GetMetadata() map[string]int
GetImageName Returns the properties of the automata (states, order, and rule number)