contact Francis at fa@fadarch.com
download the cellular automata library
This library allows you to quickly and easily implement cellular automata
calculations in your processing applets.
The results from the library are accurate and have been validated against
results from mathematica.
For more information on cellular automata click this link.
currently available operations:
public cellularAutomata()
this operation will make a new celularAutomata matrix.
int[] numbers = {0,0,0,1,0,0,0,0};
cellularAutomata a = new cellularAutomata(numbers);
public cellularAutomata copy()
makes a copy of a cellularAutomata matrix
public static cellularAutomata calcCA( cellularAutomata x, number
of evolutions)
performs a cellular automta calculation. input the cellularAutomata
matrix and the number of
times you want it to evolve.
public void setValue(int place in matrix, int value you want to
set it to 1 or 0)
allows you to manually set values in the matrix.
public float getNumber(int place in matrix)
retrieve values from the cellularAutomata
int good = int(a.getNumber(i));
public int sizeCA()
returns the size of a cellularAutomata.
s = a.sizeCA();
public void setRule(int a, int b,int c,int d,int e,int f,int g,int
h)
set the CA rule.
| current pattern |
111 | 110 | 101 | 100 | 011 | 010 | 001 | 000 |
| new state for center cell | int a | int b | int c | int d | ind e | int f | int g | int h |
Examples
a.setRule(1,1,0,0,0,0,1,0);
This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.
a.setRule(1,1,0,1,0,1,1,1);
This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.
a.setRule(0,1,1,0,1,1,1,0); //RULE 110
Source code: CAsample2
built by Francis A. Bitonti fadarch.com
contact Francis at fa@fadarch.com
The behavior of this simulation will change each
time you refresh your browser.
| import CellularAutomata.*;
int[]
numbers; void setup(){
for (int i=0; i<(height); i++) { check = int(b.getNumber(j)); }
|
This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.
Source code: CAsample
built by Francis A. Bitonti fadarch.com
contact Francis at fa@fadarch.com
CAsample (code): size(200, 200); int s = 0;
fill(255); print(good); } |