Questions tagged [cellular-automata]

A cellular automaton is a discrete model studied in computability theory.

By wikipedia,

A cellular automaton is a discrete model studied in computability theory, mathematics, physics, complexity science, theoretical biology and microstructure modeling.

A cellular automaton consists of a regular grid of cells, each in one of a finite number of states, such as on and off (in contrast to a coupled map lattice)

225 questions
1
vote
3 answers

How to count a cell's neighbors in a cellular automaton with wraparound

So I'm making a program that simulates Life-like cellular automata, but I'm having some trouble with the method used to count a cell's live neighbors. The problem is that I want to be able to change how the grid wraps around -- that is, whether it…
Jeffery Huang
  • 173
  • 1
  • 1
  • 8
1
vote
1 answer

Matplotlib : How to save an animation after clicking on the button that launches the animation?

I made a little forest fire animation. My codes are at the end of the question. The code forestfire.py contains the functions that will spread the fire to all the forest. Then forestfire_test.py import forestfire.py as ff and from there I can set…
Loïc Poncin
  • 511
  • 1
  • 11
  • 30
1
vote
0 answers

Matplotlib : Live animation works fine but displays a blank plot when being saved

I made a little forest fire animation. My code is at the end of the question. Here is some information before I ask my question : No tree : forest[i,j] = 0 A tree : forest[i,j] = 1 A tree on fire : forest[i,j] = 2 Basically what happens is that…
Loïc Poncin
  • 511
  • 1
  • 11
  • 30
1
vote
1 answer

bathtub model sprout using decision rules

newbie in netlogo here. I'm simulating a flood model using cellular-automata. It's just a simple one - cell should be filled (change color) or sprout if water > elevation. For a dummy code, I'm trying to do it this way: to go ask patches with…
1
vote
1 answer

NetLogo BehaviorSpace does not recognize initial settings on patches by mouse-down

I have a patch lattice with an arbitrary configuration of states whose initial setting is done manually using mouse-down primitive. While running BehaviorSpace, it moves the arbitrary setting starting with a random configuration of states. How can I…
Victor
  • 11
  • 1
1
vote
1 answer

How are 3-state cellular automata rules generated?

Let's limit the neighborhood to n=1 (which means we always need 3 cells to evaluate the next-gen cell). Here's an example of a 2 state rule. Note that the upper row of the rules are generated in a particular order, whereas the lower row is the bit…
P. Lance
  • 179
  • 2
  • 13
1
vote
1 answer

C++ - Performance of static arrays, with variable size at launch

I wrote a cellular automaton program that stores data in a matrix (an array of arrays). For a 300*200 matrix I can achieve 60 or more iterations per second using static memory allocation (e.g. std::array). I would like to produce matrices of…
1
vote
1 answer

Plotting the fundamental diagram of traffic flow

I have a traffic simulation and I don't understand how I can plot the fundamental diagram (flow rate vs density). I simulate the traffic as follows: I have a matrix that has as many columns as the the road length, and rows as time steps. Every car…
Lebowski
  • 145
  • 1
  • 12
1
vote
1 answer

Wrapping around a grid with modulo

I am trying to write a program that implements Conway's Game of Life on a grid of 20x60 cells. The grid should wrap around so that the left side is connected to the right side and the top is connected to the bottom. Thus, any cell with position (0,…
user4584619
1
vote
0 answers

Z-order curve and inverse Z-order for a cellular automaton

I've written a program in Processing which simulates a cellular automaton in any number of dimensions (totalistic, nearest-neighbor, Moore neighborhood). To simplify things and make the program as general as possible, I store the states of the cells…
1
vote
2 answers

simple Sand Pile code in JAVA

does anyone know where I could find the source code for the SandPile (cellular Automata)? thanks in advance!
fang_dejavu
  • 625
  • 2
  • 15
  • 22
1
vote
3 answers

Finding Neighbourhood in Matrices

I am working on project containing cellular automat methods. What I am trying to figure is how to write function helping to find all the neighbours in a 2d array. for example i ve got size x size 2d array [size = 4 here] [x][n][ ][n] [n][n][ ][n] […
user2803017
  • 19
  • 1
  • 4
1
vote
1 answer

Fuzzy Cellular Automata in matlab

I need to know how to create a fuzzy Cellular Automata in matlab for image Processing and I am beginner.Should i write the code or i could use fuzzy logic toolbar in matlab ?Could anyone introduce some source for fuzzy Cellular Automata to me? I…
sa Zas
  • 49
  • 7
1
vote
1 answer

Called function clears changes of previous one

I'm working on a cellular automaton where changes happen in every rounds. Obviously, I made a loop for it - basically it works, fortunately, but if I want to add another type of cells to the map, one type of cells works, but the other doesn't do…
Zoltán Schmidt
  • 1,286
  • 2
  • 28
  • 48
1
vote
1 answer

Called function clears changes of previous one

I'm working on a cellular automaton where changes happen in every rounds. Obviously, I made a loop for it - basically it works, fortunately, but if I want to add another type of cells to the map, the whole thing doesn't work! I mean, one type of…
Zoltán Schmidt
  • 1,286
  • 2
  • 28
  • 48