24
May
07

Activator-Inhibitor

This periodic cellular automaton can be used to simulate patterns that resemble leopard spots.
(* runtime: 7 minutes *)
n = 80; w = 0.35; SeedRandom[0]; image = Table[Random[Integer, {0, 1}], {n}, {n}];
Do[image = Table[ID = AD = 0; Do[If[image[[Mod[i + di - 1, n] + 1, Mod[j + dj - 1, n] + 1]] == 1, r = Sqrt[di^2 + dj^2]; If[3 <= r <= 6, ID++]; If[r <= 3, AD++]], {di, -6, 6}, {dj, -6, 6}]; a = AD - w ID; Which[a > 0, 1, a < 0, 0, True, image[[i, j]]], {i, 1, n}, {j, 1, n}]; ListDensityPlot[image, Mesh -> False, Frame -> False], {10}];

Links

Advertisements

1 Response to “Activator-Inhibitor”


  1. April 20, 2010 at 2:59 pm

    Can these programs write into the Mathematica version 7?thanks…


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Welcome !

You will find here some of my favorite hobbies and interests, especially science and art.

I hope you enjoy it!

Subscribe to the RSS feed to stay informed when I publish something new here.

I would love to hear from you! Please feel free to send me an email : bugman123-at-gmail-dot-com

Archives

Blog Stats

  • 548,971 hits

%d bloggers like this: