globals [ depth total-black-patches ] patches-own [ temp ] to setup ca set total-black-patches 0 ask patches [ if pycor < screen-edge-y - 10 [ set pcolor brown ] ;; unsaturated soil if pycor > screen-edge-y - 10 [ set pcolor 88 ] if pycor = screen-edge-y - 10 and pxcor mod 2 = 0 [ set pcolor red ] if (pxcor = screen-edge-x) [ set pcolor yellow ] if (pycor = 0 - screen-edge-y) [ set pcolor yellow ] ] crt num ask turtles [ set ycor (screen-edge-y - 10) set xcor (random screen-edge-x - random screen-edge-x) set heading 180 set color lime ] end to go percolate if not any patches with [pcolor = red] [ stop ] end to degrade ask turtles [ ifelse pcolor = black [ stamp brown hatch R [ rt random 360 fd 2 ] ] [forward 3 right 1 left 1 forward 2 die] ] wait 0.05 end to percolate ask patches [ set temp 0 ] ask patches [ if (pcolor = red) [ ;; decide if oil will percolate to the left if (pcolor-of patch-at -1 -1 = brown) and (random 100 < porosity) [ set (temp-of patch-at -1 -1) 1 ] ;; decide if oil will percolate to the right if ((pcolor-of patch-at 1 -1) = brown) and (random 100 < porosity) [ set (temp-of patch-at 1 -1) 1 ] set pcolor black set total-black-patches total-black-patches + 1 ] ] ask patches [ if (temp = 1) [ set depth pycor set pcolor red ] ] end @#$#@#$#@ GRAPHICS-WINDOW 225 10 690 346 45 30 5.0 0 10 0 0 CC-WINDOW 230 353 682 572 Command Center BUTTON 11 41 108 74 setup setup NIL 1 T OBSERVER BUTTON 113 41 204 74 go go T 1 T OBSERVER SLIDER 13 125 206 158 porosity porosity 0.0 99.0 99.0 1.0 1 % BUTTON 13 84 205 117 NIL DEGRADE T 1 T OBSERVER SLIDER 12 170 207 203 num num 0 70000 15556 1 1 NIL SLIDER 10 219 207 252 R R 0 10 10 1 1 NIL @#$#@#$#@ WHAT IS IT? ----------- Bioremediation of Oil Spills using hydrocarbon degrading bacteria. The number of bacteria (shown with green turtles) can be adjusted using a slider, and the porosity of the soil can also be altered using the appropriate slider. The Bacteria degrade oil (black patches), which is their food source, and then multiply into a given number of turtles (which can be adjusted by the slider named R). Press the go button to let the oil percolate down the soil layers and press the Degrade button to start the oil degradation by the oil degrading bacteria (green turtles). @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 @#$#@#$#@ NetLogo 1.2 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@