- Art
- Astronomy
- Biology
- Selection and Mutation Series
- Ant Patterns
- Bacterial Growth
- Bark Beetles
- Biological Buffer
- Birds Competing For Worms
- Color Bunnies
- Ecosystem - Predator, Prey, and Grass
- Ecosystem - Rabbits and Grass
- Ecosystem - Two Species
- Ecosystem With Predator, Prey, And Grass
- Forest Fire
- Honeycomb Formation
- Termites Perimeter
- Yeast Growth
- Chemistry
- Earth Science
- Mathematics
- Physics
- Social Science
Bacterial Growth
Submitted by librarian on Mon, 2006-08-07 15:35. :: Category
WHAT IS IT?
This program is a simplified cellular automata model of bacterial growth on an agar surface. The resulting pattern bears some similarity to that produced in the diffusion limited aggregation model; however, the particles in this program expand from the middle instead of attaching from the outside.
The program starts with a single bacteria in the middle of the screen. Then, with each time step, if a bacteria is younger than max_age, it samples the eight patches surrounding it. If a patch is empty, a random number exceeds "spread", and the patch has less neighbors than max_neighbors, then the bacteria splits and extends a new bacteria into that patch.
Neighbors is taken to be the number of bacteria on the edge of a 5 x 5 box that is centered on the patch in question. This allows bacteria to be close to immediate neighbors, thereby making it appear like the bacteria are several patches wide. This increases the resolution of the pattern, as the bacteria's motion appears small relative to their own size.
The condition that a patch's neighbors not exceed max_neighbors is a simplified way of accounting for food consumption by the bacteria; a cell would only survive in regions where surrounding bacteria had not depleted the food supply.
HOW TO USE IT
The SETUP button clears the display, creates a turtle in the center of the screen, and displays a color key.
The GO button executes the behavioral rules described above; the forever button runs continously while the other goes one step at a time.
The MAX_AGE slider specifies the maximum age of a bacteria (before it loses its ability to reproduce); the age is incremented one each time step.
The SPREAD slider controls the percent probability that a bacteria will spread into a neighboring patch that is fit to be filled by a new bacteria. This number applies to each patch; that is, if spread were 100, a bacteria would fill each of its neighboring patches, not just one.
The MAX_NEIGHBORS slider controls the maximum number of neighbors that a patch can have while still being suitable to hold a new bacteria.
THINGS TO NOTICE
Experimentation with the slider variables yields a variety of shapes and densities in the resulting pattern of bacteria. However, unlike the diffusion limited aggregation simulation, the pattern is generally uniform, as bacteria act based on the states of only local neighbors. This is a result of the simplified algorithm; more sophisticated models show decreasing densities towards the periphery of the cluster with more radially dendritic bacteria.
Turtle procedures
turtles-own [age] ; age of bacteria
to grow
ifelse (age < max_age) ; if a bacterium is younger than "max_age", it
[ setc red ; is colored red, its age is incremented,
setage age + 1 ; and it samples the 8 neighboring patches;
repeat 8 ; if a patch is empty and has lass neighbors
[ if ((random 100) < spread) and ; than max_neighbors, and if "spread"
((count-turtles-at dx dy) = 0) and ; exceeds a random number, then the
((neighbors-at dx dy) <= max_neighbors) ; bacterium divides into the patch.
[hatch [setage 0 fd 1]]
rt 45]]
[ setc white ] ; if a bacterium is as old as "max_age", it
end
; turns white and does nothing
to count-neighbors ; each turtle increments the neighbor count
set neighbors-at -2 -2 1 + neighbors-at -2 -2 ; at the edge of a 5 x 5 box centered at the
set neighbors-at -2 2 1 + neighbors-at -2 2 ; turtle
set neighbors-at -2 -1 1 + neighbors-at -2 -1
set neighbors-at -2 1 1 + neighbors-at -2 1
set neighbors-at -2 0 1 + neighbors-at -2 0
set neighbors-at -1 -2 1 + neighbors-at -1 -2
set neighbors-at -1 2 1 + neighbors-at -1 2
set neighbors-at 0 -2 1 + neighbors-at 0 -2
set neighbors-at 0 2 1 + neighbors-at 0 2
set neighbors-at 1 -2 1 + neighbors-at 1 -2
set neighbors-at 1 2 1 + neighbors-at 1 2
set neighbors-at 2 -2 1 + neighbors-at 2 -2
set neighbors-at 2 2 1 + neighbors-at 2 2
set neighbors-at 2 -1 1 + neighbors-at 2 -1
set neighbors-at 2 1 1 + neighbors-at 2 1
set neighbors-at 2 0 1 + neighbors-at 2 0
end
Observer procedures
patches-own [neighbors] ; number of bacteria on 5 x 5 box, centered at patch
to setup
ca ; clears display
crt 1 ; creates a turtle, and for that turtle:
ask-turtles [
setc white ; sets its color white
setage 0 ; sets its age to zero
setxy 0 0 ; puts it in the middle of the screen
seth 0] ; sets its heading to zero degrees
end
to go
ask-patches [set neighbors 0] ; clears the neighbor count
ask-turtles [count-neighbors] ; builds neighbor count
ask-turtles [grow] ; asks bacteria to grow
end
3924 reads
