EntwurfsforschungKI Lab ← Frühe SimulationenEarly Simulations

03 reakt diffuse03 Reaction Diffusion

/

Start: leak, bis die Fläche geteilt ist · Fassung 04: turtles sammeln sich und stoßen sich ab, stamp-agents prägt sie ein (von Hand oder nach Schritt)Start: leak until the area is divided · version 04: turtles gather and repel each other, stamp-agents imprints them (by hand or after a step)

Zu Beginn prägen seed turtles an zufälligen Orten ihre Farbe in das Raster ein – jede eine eigene NetLogo-Farbnummer (green + who) – und verschwinden. Danach breiten sich die Farben aus: In jedem Schritt (leak) prüft jeder schwarze Patch seine acht Nachbarn, summiert ihre Farbnummern (s1) und zählt die farbigen (s2).

Ist s1 durch s2 teilbar – int(s1 / s2) · s2 = s1 –, haben in aller Regel alle farbigen Nachbarn dieselbe Farbe, und der Patch übernimmt den Mittelwert s1 / s2. Sonst grenzen hier verschiedene Farben aneinander, und der Patch wird zur Grenze (boundary, weiß). Erst rechnen alle Patches, dann färben alle. So wächst jede Region gleichmäßig, bis sie auf ihre Nachbarn trifft; zurück bleibt eine Flächenteilung aus farbigen Zellen und dünnen Grenzlinien, ähnlich einem Voronoi-Diagramm. Weil der Test nur rechnet, entsteht gelegentlich eine Mischfarbe, wenn zwei Farbnummern zufällig einen ganzzahligen Mittelwert haben.

In der Fassung „04 repel and reakt diffuse“ setzen bewegliche turtles die Keime: attract zieht sie zur Mitte, bis auf einen Kreis mit radius, repel lässt jede turtle vor ihrer nächsten Nachbarin um repel-strength zurückweichen. Erst stamp-agents prägt ihre Positionen ein; die Flächenteilung folgt dann ihrer Verteilung – kleine Zellen im Kreis, große, nach außen gerichtete davor.

Die App ist eine Neuumsetzung von reaktDiffuse02.nlogo („03_reakt diffuse“) und reaktDiffuse03.nlogo („04_repel and reakt diffuse“) von Reinhard König (2005); der Code des leak-Verfahrens stammt nach Angabe der alten Seite aus einem Skript von Paul Coates (CECA, University of East London). Was geändert wurde, steht in QUELLE.md.

At the start, seed turtles at random places imprint their colour into the grid – each its own NetLogo colour number (green + who) – and vanish. Then the colours spread: in every step (leak) each black patch checks its eight neighbours, sums their colour numbers (s1) and counts the coloured ones (s2).

If s1 is divisible by s2 – int(s1 / s2) · s2 = s1 – all coloured neighbours almost always share the same colour, and the patch takes the mean s1 / s2. Otherwise different colours meet here and the patch becomes a boundary (white). First all patches compute, then all are coloured. Each region thus grows evenly until it meets its neighbours, leaving a division of the area into coloured cells and thin boundary lines, similar to a Voronoi diagram. Because the test is purely arithmetic, a mixed colour occasionally appears when two colour numbers happen to have an integer mean.

In the version “04 repel and reakt diffuse” moving turtles place the seeds: attract pulls them towards the centre onto a circle of radius, repel makes each turtle back away from its nearest neighbour by repel-strength. Only stamp-agents imprints their positions; the division of the area then follows their distribution – small cells inside the circle, large ones pointing outwards beyond it.

The app re-implements reaktDiffuse02.nlogo (“03_reakt diffuse”) and reaktDiffuse03.nlogo (“04_repel and reakt diffuse”) by Reinhard König (2005); according to the old page, the code of the leak procedure is taken from a script by Paul Coates (CECA, University of East London). Changes are listed in QUELLE.md.