CellularAutomaton: Constructor for Class CellularAutomaton

Description Usage Arguments Value Author(s) References Examples

Description

This method instantiates class CellularAutomaton.

Usage

1
2
CellularAutomaton(n = 30, fun = NULL, k = 2, r = 1, t = 1,
                  totalistic = 0, seed = 1, bg = 0)

Arguments

n

This is the elementary rule number for the automaton.

fun

This is a user-defined rule.

k

This is the number of colors.

r

This is the radius of a neighborhood.

t

This is the number of steps.

totalistic

0 = general; 1 = totalistic

seed

This is a seed for the automaton.

bg

This is the background upon which to place the seed.

Value

This method returns an instance of class CellularAutomaton, provided the arguments make sense.

Author(s)

John Hughes

References

http://reference.wolfram.com/mathematica/tutorial/CellularAutomata.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ca = CellularAutomaton(t = 100)  # Evolve Rule 30 for 100 steps. k = 2, r = 1, and the seed
                                 # is a single black cell on a white background. Each row will
				 # have length 2rt + 1 = 201.
ca$plot()                        # Have a look.

# Evolve Rule 110 for 100 steps. k = 2, r = 1, and the seed is 001000. Each row will have the
# same length as the seed because -1 was given as the background.

ca = CellularAutomaton(n = 110, t = 100, seed = c(0, 0, 1, 0, 0, 0), bg = -1)

ca$plot(col = c("white", "darkblue"))  # Plot it using Penn State colors. :-)

Example output

Loading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.7.1 (2016-02-15) successfully loaded. See ?R.methodsS3 for help.
R.oo v1.21.0 (2016-10-30) successfully loaded. See ?R.oo for help.

Attaching package: 'R.oo'

The following objects are masked from 'package:methods':

    getClasses, getMethods

The following objects are masked from 'package:base':

    attach, detach, gc, load, save

CellularAutomaton documentation built on May 29, 2017, 3:03 p.m.