{"spaces":[{"id":0,"spaceId":"ntb-defs-0","name":"Code for the \"➤➤GO\" button","width":920,"height":640,"defs":{"blocks":[{"action":"➤➤ At GO","format":"to define-particle-behavior","required":false,"limit":1,"blockColor":"#ffd479","textColor":"#5e5e5e","borderColor":"#d4fb79","fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif","type":"nlogo:procedure","start":true,"control":false,"clauses":null,"params":[],"properties":[],"id":0},{"action":"⚪️ the particle","format":"ask particle (min [who] of particles + {0})","required":false,"blockColor":"#9437ff","textColor":"#ffffff","borderColor":"#d783ff","fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif","type":"nlogo:if","start":false,"control":true,"clauses":[],"params":[{"name":"number","unit":"","type":"num","default":"1","id":0}],"properties":[],"id":1},{"action":"⚪️・・⚪️ each particle","format":"ask particles","required":false,"limit":2,"blockColor":"#9437ff","textColor":"#ffffff","borderColor":"#d783ff","fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif","type":"nlogo:if","start":false,"control":true,"clauses":[],"params":[],"properties":[],"id":2},{"action":"⎮⇠ if touches a wall","format":"if particle-is \"touching a wall\" ","required":false,"blockColor":"#797979","textColor":"#ffffff","borderColor":"#212121","fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif","type":"nlogo:if","start":false,"control":true,"clauses":[],"params":[],"properties":[],"id":3},{"action":"⇢💥⇠ if touches another particle","format":"if particle-is \"touching another particle\" ","required":false,"blockColor":"#797979","textColor":"#ffffff","borderColor":"#212121","fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif","type":"nlogo:if","start":false,"control":true,"clauses":[],"params":[],"properties":[],"id":4},{"action":"⇠🏃🏽‍♀️🏃‍♂️⇠ moves ","format":"set move-behavior {0}","required":false,"blockColor":"#0096ff","textColor":"#ffffff","borderColor":"#005493","fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif","type":"nlogo:command","start":false,"control":false,"clauses":null,"params":[{"name":"amount","unit":"","type":"select","default":"1","values":[{"actual":"\"straight\""},{"actual":"\"spinning\""},{"actual":"\"zig-zag\""},{"actual":"\"erratic\""}],"id":1}],"properties":[],"id":5},{"action":"⇠⚪️⚪️⇢ bounces back ","format":"set-particle-behavior {0}","required":false,"limit":4,"blockColor":"#ff7e79","textColor":"#ffffff","borderColor":"#ff2600","fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif","type":"nlogo:command","start":false,"control":false,"clauses":null,"params":[{"name":"angle","unit":"","type":"select","default":"10","values":[{"actual":"\"🎈 like a balloon\""},{"actual":"\"🏈 like a football\""},{"actual":"\"🎱 like a billiard ball\""},{"actual":"\"🏀 like a basketball\""}],"id":2}],"properties":[],"id":6}],"expressions":[{"name":"true","type":"bool"},{"name":"false","type":"bool"},{"name":"AND","type":"bool","arguments":["bool","bool"],"format":"({0} and {1})"},{"name":"OR","type":"bool","arguments":["bool","bool"],"format":"({0} or {1})"},{"name":"NOT","type":"bool","arguments":["bool"],"format":"(not {0})"},{"name":">","type":"bool","arguments":["num","num"]},{"name":">=","type":"bool","arguments":["num","num"]},{"name":"<","type":"bool","arguments":["num","num"]},{"name":"<=","type":"bool","arguments":["num","num"]},{"name":"!=","type":"bool","arguments":["num","num"]},{"name":"=","type":"bool","arguments":["num","num"]},{"name":"+","type":"num","arguments":["num","num"]},{"name":"-","type":"num","arguments":["num","num"]},{"name":"×","type":"num","arguments":["num","num"],"format":"({0} * {1})"},{"name":"/","type":"num","arguments":["num","num"]},{"name":"random","type":"num","arguments":["num"],"format":"random-float {0}"}],"program":{"chains":[[{"id":0,"instanceId":7,"action":"➤➤ At GO","type":"nlogo:procedure","format":"to define-particle-behavior","note":null,"required":false,"x":20.514114379882812,"y":22.5},{"id":2,"instanceId":8,"action":"⚪️・・⚪️ each particle","type":"nlogo:if","format":"ask particles","note":null,"required":false,"x":20.514114379882812,"y":56.5,"children":[{"id":5,"instanceId":16,"action":"⇠🏃🏽‍♀️🏃‍♂️⇠ moves ","type":"nlogo:command","format":"set move-behavior {0}","note":null,"required":false,"x":0,"y":0,"params":[{"id":1,"type":"select","name":"amount","unit":"","value":"\"zig-zag\"","default":"1","values":[{"actual":"\"straight\""},{"actual":"\"spinning\""},{"actual":"\"zig-zag\""},{"actual":"\"erratic\""}]}]},{"id":3,"instanceId":17,"action":"⎮⇠ if touches a wall","type":"nlogo:if","format":"if particle-is \"touching a wall\" ","note":null,"required":false,"x":0,"y":0,"children":[{"id":6,"instanceId":18,"action":"⇠⚪️⚪️⇢ bounces back ","type":"nlogo:command","format":"set-particle-behavior {0}","note":null,"required":false,"x":0,"y":0,"params":[{"id":2,"type":"select","name":"angle","unit":"","value":"\"🏈 like a football\"","default":"10","values":[{"actual":"\"🎈 like a balloon\""},{"actual":"\"🏈 like a football\""},{"actual":"\"🎱 like a billiard ball\""},{"actual":"\"🏀 like a basketball\""}]}]}]}],"clauses":[]}]]},"height":640,"width":920,"blockStyles":{"starterBlockStyle":{"blockColor":"#bb5555","textColor":"#ffffff","borderColor":"#ffffff","fontWeight":"","fontSize":"","fontFace":""},"containerBlockStyle":{"blockColor":"#8899aa","textColor":"#ffffff","borderColor":"#ffffff","fontWeight":"","fontSize":"","fontFace":""},"commandBlockStyle":{"blockColor":"#9977aa","textColor":"#ffffff","borderColor":"#ffffff","fontWeight":"","fontSize":"","fontFace":""}},"version":3},"defsJsonChanged":false,"netLogoCode":"to define-particle-behavior\n ask particles\n [\n set move-behavior (nt:get \"__ntb-defs-0-canvas_5_16_1\")\n if particle-is \"touching a wall\" \n [\n set-particle-behavior (nt:get \"__ntb-defs-0-canvas_6_18_2\")\n ]\n ]\nend","netLogoDisplay":"to define-particle-behavior\n ask particles\n [\n set move-behavior (\"zig-zag\")\n if particle-is \"touching a wall\" \n [\n set-particle-behavior (\"🏈 like a football\")\n ]\n ]\nend"}],"netTangoToggles":{"workspaceBelow":true,"showCode":true},"tabOptions":{"commandCenterTab":true,"codeTab":true,"infoTab":true,"speedBar":false,"fileButtons":true,"authoring":true,"tabsPosition":true,"poweredBy":false},"blockStyles":{"starterBlockStyle":{"blockColor":"#bb5555","textColor":"#ffffff","borderColor":"#ffffff","fontWeight":"","fontSize":"","fontFace":""},"containerBlockStyle":{"blockColor":"#8899aa","textColor":"#ffffff","borderColor":"#ffffff","fontWeight":"","fontSize":"","fontFace":""},"commandBlockStyle":{"blockColor":"#9977aa","textColor":"#ffffff","borderColor":"#ffffff","fontWeight":"","fontSize":"","fontFace":""}},"title":"CC2019-Micro-ParticleSandbox-NetTango","extraCss":"","code":";;; Extended model from the PNoM curricular materials\n;;; Designed for the ChemTango blocks-based environment\n;;; by Umit Aslan, May 2019\n\nglobals [\n tick-delta ; how much we advance the tick counter this time through\n max-tick-delta ; the largest tick-delta is allowed to be\n init-avg-speed init-avg-energy ; initial averages\n avg-speed avg-energy ; current average\n avg-energy-green ; average energy of green particles (used to calculate the temperature)\n avg-energy-orange ; average energy of orange particles (used to calculate the temperature)\n toggle-red-state ; keeps track of whether the toggle red wall button was pressed (and whether these walls are open or closed)\n toggle-blue-state ; keeps track of whether the toggle blue wall button was pressed (and whether these walls are open or closed)\n particles-to-add ; number of particles to add when using the mouse / cursor to add particles\n min-particle-energy\n max-particle-energy\n particle-size\n sensor-colors ; colors for each of the numbered sensor types\n sensor-placed? ; flag to avoid placing > 1 sensors per click\n root-url-for-export\n last-saved-filename\n sensor-blue-reading\n sensor-red-reading\n sensor-blue-total\n sensor-red-total\n]\n\nbreed [coordinators coordinator] ;;; a non-acting coordinator to overcome NetTango's context related issues\n\nbreed [ particles particle ]\nbreed [ walls wall ]\nbreed [ flashes flash ]\nbreed [ erasers eraser ]\nbreed [ sensors sensor ]\n\nerasers-own [ pressure? ]\nflashes-own [ birthday ]\n\n; variables for sensors\nsensors-own [\n my-call\n number\n reading\n my-history\n light-up-threshold\n index\n number\n]\n\n; variables for particles\nparticles-own [\n speed mass energy ; particles info\n last-collision ; record the previous collision\n color-type ; type of particle (green, orange)\n\n ;;;; PARTICLE BEHAVIOR MARKERS FOR CHEMTANGO\n behavior-to-set ;; can be none, bounce or collide \n move-behavior\n bounce-behavior\n collide-behavior\n placed-touching-a-wall-block?\n placed-touching-another-particle-block?\n zig-zag-counter\n zig-zag-direction\n]\n\n; variables for walls\nwalls-own [\n energy\n valve-1?\n valve-2?\n pressure?\n surface-energy\n]\n\nto startup\n setup\nend\n\n;;; CHEMTANGO PROCEDURES (Translates to NetLogo behavior)\n\n;; Block types:\n;; each particle (ask particles)\n;; when touching a wall (if)\n;; when touching another particle (if)\n;; move \n;; bounce \n;; collide \n\n\n;; Move behavior types: none, straight, spinning, zig-zag, erratic\n;; Bounce behavior types: none, balloon, football, billiard ball, basketball\n;; Collide behavior types: none, balloon, football, billiard ball, basketball\n\nto-report particle-is [condition]\n\n if condition = \"touching a wall\" [\n set placed-touching-a-wall-block? true\n set behavior-to-set \"bounce\"\n ]\n\n if condition = \"touching another particle\" [\n set placed-touching-another-particle-block? true\n set behavior-to-set \"collide\"\n ]\n\n report true\nend\n\nto reset-chemtango-behaviors\n ask particles [\n set behavior-to-set \"none\"\n set move-behavior \"none\"\n set bounce-behavior \"none\"\n set collide-behavior \"none\"\n set placed-touching-a-wall-block? false\n set placed-touching-another-particle-block? false\n ]\nend\n\nto chemtango-go\n\n ;; make sure particle behavior is updated each tick\n reset-chemtango-behaviors\n\n ;; wrapped around the coordinator to overcome the context issues\n ask coordinators [ define-particle-behavior ]\n\n ;; then translate the defined behavior to actual Particle Sandbox behavior\n ask particles [\n if placed-touching-a-wall-block? and bounce-behavior != \"none\" [\n bounce\n ]\n ]\n\n ask particles [\n if move-behavior != \"none\" [\n move\n ]\n ]\n\n ask particles [\n if placed-touching-another-particle-block? and collide-behavior != \"none\" [\n check-for-collision\n ]\n ]\n\n ;; then translate the defined behavior to actual Particle Sandbox behavior\n ask particles with [any? walls-here] [\n if placed-touching-a-wall-block? and bounce-behavior != \"none\" [\n rewind-to-bounce\n ]\n ]\n ask particles with [any? walls-here] [\n if placed-touching-a-wall-block? and bounce-behavior != \"none\" [\n remove-from-walls\n ]\n ]\n\nend\n\n;;; this is unfortunately needed to\n;;; overcome the issue of using just\n;;; one block for both bounce and collide\nto set-particle-behavior [behavior]\n \n if behavior-to-set = \"bounce\" [\n set bounce-behavior behavior\n ]\n \n if behavior-to-set = \"collide\" [\n set collide-behavior behavior\n ]\n \nend\n\n\nto setup\n clear-all\n ;; CHEMTANGO ADDITIONS\n reset-chemtango-behaviors\n\n ;; this is a dummy turtle that wraps other turtles' behavior\n ;; it makes sure that the students do not get runtime errors in NetTango\n create-coordinators 1 [\n set size 0\n set color black\n setxy max-pxcor max-pycor\n ]\n\n\n ;; ORIGINAL PNOM CODE\n set last-saved-filename \"\"\n set particle-size 1.0\n set max-tick-delta 0.02\n set particles-to-add 2\n set-default-shape flashes \"square\"\n set-default-shape walls \"wall\"\n set-default-shape erasers \"eraser\"\n set-default-shape sensors \"sensor\"\n set min-particle-energy 0\n set max-particle-energy 10000\n set sensor-blue-total []\n set sensor-red-total []\n\n create-erasers 1 [ set hidden? true set pressure? true set size 3 set color white ]\n set sensor-colors [ black orange magenta sky brown ]\n set sensor-placed? false\n\n make-box\n make-particles\n\n ask particles [ update-particle-speed-visualization ]\n\n set init-avg-speed avg-speed\n set init-avg-energy avg-energy\n\n update-variables\n\n setup-plots\n reset-ticks\nend\n\nto init-time\n ask flashes [ die ]\n ask sensors [\n set reading 0\n set my-history []\n ]\n clear-all-plots\n reset-ticks\nend\n\n\nto go\n chemtango-go\n\n sensor-action\n\n tick-advance tick-delta\n calculate-tick-delta\n\n ask flashes [ update-flash-visualization ]\n ask particles [ update-particle-speed-visualization ]\n\n update-variables\n update-plots\n display\nend\n\nto sensor-action\n ask sensors [\n ; Counts all particles within the specified radius around the sensor\n let near-particle-count count turtles-on (patch-set (patches in-radius 3))\n let count-particles-in-radius [ -> set reading near-particle-count ]\n\n ; Counts all particles\n let net-particle-count [ -> set reading count particles ]\n\n ; Shows average energy of all particles\n let show-temperature [ -> set reading precision avg-energy-green 3 ]\n\n ; Shows the average energy of particles within the specified radius around the sensor\n let near-particle-energy 0\n let near-particle-energy-list [energy] of (particles in-radius 3)\n if length near-particle-energy-list > 0 [\n set near-particle-energy mean near-particle-energy-list\n ]\n let show-near-particle-energy [ -> set reading precision near-particle-energy 3 ]\n\n ; Shows the average speed of all particles\n let show-avg-speed [ -> set reading precision avg-speed 3 ]\n\n let command count-particles-in-radius\n\n if number = 2 [\n set command net-particle-count\n ]\n if number = 3 [\n set command show-near-particle-energy\n ]\n if number = 4 [\n set command show-avg-speed\n ]\n carefully [\n run command\n ][\n user-message (word \"oops: \" error-message \" in running \" command)\n ]\n set label (word reading \" \")\n ]\nend\n\nto report-readings\n ask sensors [\n if (substring (word self) 8 9 = \"0\") [\n set sensor-blue-reading reading\n set sensor-blue-total lput reading sensor-blue-total\n ]\n if (substring (word self) 8 9 = \"1\") [\n set sensor-red-reading reading\n set sensor-red-total lput reading sensor-red-total\n ]\n ]\nend\n\n; sensor procedure - add this to my-history\nto record [ avalue ]\n set my-history lput avalue my-history\nend\n\nto update-variables\n if any? particles [\n set avg-speed mean [speed] of particles\n set avg-energy mean [energy] of particles\n ]\n if any? particles with [color-type = green]\n [ set avg-energy-green mean [energy] of particles with [color-type = green] ]\n if any? particles with [color-type = orange]\n [ set avg-energy-orange mean [energy] of particles with [color-type = orange] ]\nend\n\n\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;GAS MOLECULES MOVEMENT;;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\nto bounce\n let this-patch patch-here\n let new-px 0\n let new-py 0\n let hit-angle 0\n let visible-wall nobody\n ; get the coordinates of the patch we'll be on if we go forward 1\n let bounce-patch min-one-of walls in-cone ((sqrt (2)) / 2) 180 with [myself != this-patch] [ distance myself ]\n\n if bounce-patch != nobody [\n set new-px [pxcor] of bounce-patch\n set new-py [pycor] of bounce-patch\n set visible-wall walls-on bounce-patch\n\n if any? visible-wall with [not hidden?] [\n set hit-angle towards bounce-patch\n ifelse (hit-angle <= 135 and hit-angle >= 45) or (hit-angle <= 315 and hit-angle >= 225)\n [ set heading (- heading) ]\n [ set heading (180 - heading) ]\n if show-wall-hits? [\n ask patch new-px new-py [ make-a-flash ]\n ]\n\n ;; CHEMTANGO >> Loose energy if bouncing like something but a billiard ball\n if bounce-behavior = \"🎈 like a balloon\" [\n ;; loose energy a lot + bounce slightly random\n rt 15 - random 30\n set speed (speed / 1.5)\n ]\n\n if bounce-behavior = \"🏈 like a football\" [\n ;; loose energy a bit + bounce quite random\n rt 45 - random 90\n set speed (speed / 1.1)\n ]\n\n if bounce-behavior = \"🎱 like a billiard ball\" [\n ;; don't loose energy + bounce straight\n ;; in other ways, don't do nothing extra\n ]\n\n if bounce-behavior = \"🏀 like a basketball\" [\n ;; loose energy a bit + bounce straight\n set speed (speed / 1.05)\n ]\n\n ;; ----\n ]\n ]\nend\n\nto rewind-to-bounce ; particles procedure\n ; attempts to deal with particle penetration by rewinding the particle path back to a point\n ; where it is about to hit a wall\n ; the particle path is reversed 49% of the previous tick-delta it made,\n ; then particle collision with the wall is detected again.\n ; and the particle bounces off the wall using the remaining 51% of the tick-delta.\n ; this use of slightly more of the tick-delta for forward motion off the wall, helps\n ; insure the particle doesn't get stuck inside the wall on the bounce.\n\n let bounce-patch nobody\n let bounce-patches nobody\n let hit-angle 0\n let this-patch nobody\n let new-px 0\n let new-py 0\n let visible-wall nobody\n\n bk (speed) * tick-delta * .49\n set this-patch patch-here\n\n set bounce-patch min-one-of walls in-cone ((sqrt (2)) / 2) 180 with [self != this-patch] [distance myself ]\n\n if bounce-patch != nobody [\n set new-px [pxcor] of bounce-patch\n set new-py [pycor] of bounce-patch\n set visible-wall walls-on bounce-patch\n\n if any? visible-wall with [not hidden?] [\n set hit-angle towards bounce-patch\n\n ifelse (hit-angle <= 135 and hit-angle >= 45) or (hit-angle <= 315 and hit-angle >= 225)\n [ set heading (- heading) ]\n [ set heading (180 - heading) ]\n\n if show-wall-hits? [\n ask patch new-px new-py [\n sprout-flashes 1 [\n set color gray - 2\n set birthday ticks\n ]\n ]\n ]\n ]\n ]\n fd (speed) * tick-delta * .51\nend\n\nto move ; particles procedure\n\n if patch-ahead (speed * tick-delta) != patch-here\n [ set last-collision nobody ]\n jump (speed * tick-delta)\n\n\n ;; CHEMTANGO >> If not moving like a billiard ball, be erratic\n ;; Move behavior types: none, straight, spinning, zig-zag, erratic\n if move-behavior = \"spinning\" [\n ;; loose energy a lot + bounce slightly random\n rt 5\n ]\n\n if move-behavior = \"zig-zag\"[\n ;; loose energy a lot + bounce slightly random\n set zig-zag-counter zig-zag-counter - 1\n if zig-zag-counter < 1 [\n set zig-zag-direction zig-zag-direction * -1\n rt zig-zag-direction * 30\n set zig-zag-counter 15\n ]\n ]\n\n if move-behavior = \"erratic\" [\n ;; loose energy a lot + bounce slightly random\n rt 30 - random 60\n ]\n ;; -----\n\nend\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;GAS MOLECULES COLLISIONS;;;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n;from GasLab\n\nto calculate-tick-delta\n ; tick-delta is calculated in such way that even the fastest\n ; particles will jump at most 1 patch delta in a ticks tick. As\n ; particles jump (speed * tick-delta) at every ticks tick, making\n ; tick delta the inverse of the speed of the fastest particles\n ; (1/max speed) assures that. Having each particles advance at most\n ; one patch-delta is necessary for it not to \"jump over\" a wall\n ; or another particles.\n ifelse any? particles with [speed > 0]\n [ set tick-delta min list (1 / (ceiling max [speed] of particles )) max-tick-delta ]\n [ set tick-delta max-tick-delta ]\nend\n\n\nto check-for-collision ; particles procedure\n ; Here we impose a rule that collisions only take place when there\n ; are exactly two particles per patch. We do this because when the\n ; student introduces new particles from the side, we want them to\n ; form a uniform wavefront.\n ;\n ; Why do we want a uniform wavefront? Because it is actually more\n ; realistic. (And also because the curriculum uses the uniform\n ; wavefront to help teach the relationship between particles collisions,\n ; wall hits, and pressure.)\n ;\n ; Why is it realistic to assume a uniform wavefront? Because in reality,\n ; whether a collision takes place would depend on the actual headings\n ; of the particles, not merely on their proximity. Since the particles\n ; in the wavefront have identical speeds and near-identical headings,\n ; in reality they would not collide. So even though the two-particles\n ; rule is not itself realistic, it produces a realistic result. Also,\n ; unless the number of particles is extremely large, it is very rare\n ; for three or particles to land on the same patch (for example,\n ; with 400 particles it happens less than 1% of the time). So imposing\n ; this additional rule should have only a negligible effect on the\n ; aggregate behavior of the system.\n ;\n ; Why does this rule produce a uniform wavefront? The particles all\n ; start out on the same patch, which means that without the only-two\n ; rule, they would all start colliding with each other immediately,\n ; resulting in much random variation of speeds and headings. With\n ; the only-two rule, they are prevented from colliding with each other\n ; until they have spread out a lot. (And in fact, if you observe\n ; the wavefront closely, you will see that it is not completely smooth,\n ; because collisions eventually do start occurring when it thins out while fanning.)\n\n if count other particles-here in-radius 1 = 1 [\n ; the following conditions are imposed on collision candidates:\n ; 1. they must have a lower who number than my own, because collision\n ; code is asymmetrical: it must always happen from the point of view\n ; of just one particles.\n ; 2. they must not be the same particles that we last collided with on\n ; this patch, so that we have a chance to leave the patch after we've\n ; collided with someone.\n let candidate one-of other particles-here with\n [who < [who] of myself and myself != last-collision]\n ; we also only collide if one of us has non-zero speed. It's useless\n ; (and incorrect, actually) for two particles with zero speed to collide.\n if (candidate != nobody) and (speed > 0 or [speed] of candidate > 0) [\n collide-with candidate\n set last-collision candidate\n ask candidate [ set last-collision myself ]\n\n ;; CHEMTANGO >> Loose energy if colliding like something but a billiard ball\n if collide-behavior = \"🎈 like a balloon\" [\n ;; loose energy a lot + bounce slightly random\n rt 15 - random 30\n set speed (speed / 1.5)\n ]\n\n if collide-behavior = \"🏈 like a football\" [\n ;; loose energy a bit + bounce quite random\n rt 45 - random 90\n set speed (speed / 1.1)\n ]\n\n if collide-behavior = \"🎱 like a billiard ball\" [\n ;; don't loose energy + bounce straight\n ;; in other ways, don't do nothing extra\n ]\n\n if collide-behavior = \"🏀 like a basketball\" [\n ;; loose energy a bit + bounce straight\n set speed (speed / 1.05)\n ]\n\n ;; ----\n\n ]\n ]\n\nend\n\n; implements a collision with another particles.\n;\n; THIS IS THE HEART OF THE particles SIMULATION, AND YOU ARE STRONGLY ADVISED\n; NOT TO CHANGE IT UNLESS YOU REALLY UNDERSTAND WHAT YOU'RE DOING!\n;\n; The two particles colliding are self and other-particles, and while the\n; collision is performed from the point of view of self, both particles are\n; modified to reflect its effects. This is somewhat complicated, so I'll\n; give a general outline here:\n; 1. Do initial setup, and determine the heading between particles centers\n; (call it theta).\n; 2. Convert the representation of the velocity of each particles from\n; speed/heading to a theta-based vector whose first component is the\n; particle's speed along theta, and whose second component is the speed\n; perpendicular to theta.\n; 3. Modify the velocity vectors to reflect the effects of the collision.\n; This involves:\n; a. computing the velocity of the center of mass of the whole system\n; along direction theta\n; b. updating the along-theta components of the two velocity vectors.\n; 4. Convert from the theta-based vector representation of velocity back to\n; the usual speed/heading representation for each particles.\n; 5. Perform final cleanup and update derived quantities.\nto collide-with [ other-particles ] ; particles procedure\n ;; PHASE 1: initial setup\n\n ; for convenience, grab quantities from other-particles\n let mass2 [mass] of other-particles\n let speed2 [speed] of other-particles\n let heading2 [heading] of other-particles\n\n ; since particles are modeled as zero-size points, theta isn't meaningfully\n ; defined. we can assign it randomly without affecting the model's outcome.\n let theta (random-float 360)\n\n ;; PHASE 2: convert velocities to theta-based vector representation\n\n ; now convert my velocity from speed/heading representation to components\n ; along theta and perpendicular to theta\n let v1t (speed * cos (theta - heading))\n let v1l (speed * sin (theta - heading))\n\n ; do the same for other-particles\n let v2t (speed2 * cos (theta - heading2))\n let v2l (speed2 * sin (theta - heading2))\n\n ;; PHASE 3: manipulate vectors to implement collision\n\n ; compute the velocity of the system's center of mass along theta\n let vcm (((mass * v1t) + (mass2 * v2t)) / (mass + mass2) )\n\n ; now compute the new velocity for each particles along direction theta.\n ; velocity perpendicular to theta is unaffected by a collision along theta,\n ; so the next two lines actually implement the collision itself, in the\n ; sense that the effects of the collision are exactly the following changes\n ; in particles velocity.\n set v1t (2 * vcm - v1t)\n set v2t (2 * vcm - v2t)\n\n ;; PHASE 4: convert back to normal speed/heading\n\n ; now convert my velocity vector into my new speed and heading\n set speed sqrt ((v1t ^ 2) + (v1l ^ 2))\n set energy (0.5 * mass * speed ^ 2)\n ; if the magnitude of the velocity vector is 0, atan is undefined. but\n ; speed will be 0, so heading is irrelevant anyway. therefore, in that\n ; case we'll just leave it unmodified.\n if v1l != 0 or v1t != 0 [ set heading (theta - (atan v1l v1t)) ]\n\n ; and do the same for other-particle\n ask other-particles [\n set speed sqrt ((v2t ^ 2) + (v2l ^ 2))\n set energy (0.5 * mass * (speed ^ 2))\n if v2l != 0 or v2t != 0 [ set heading (theta - (atan v2l v2t)) ]\n ]\nend\n\n\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;;; particle speed and flash visualization procedures ;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\nto make-a-flash\n sprout-flashes 1 [\n set color gray - 2\n set birthday ticks\n ]\nend\n\nto update-flash-visualization\n set size (size * .95)\n if (ticks - birthday > 0.4) [ die ]\nend\n\nto update-particle-speed-visualization\n if visualize-particle-speed = \"no\" [ recolornone ]\n if visualize-particle-speed = \"different shades\" [ recolorshade ]\nend\n\nto recolorshade\n ifelse speed < 27\n [ set color color-type - 3 + speed / 3 ]\n [ set color color-type + 4.999 ]\nend\n\nto recolornone\n set color color-type\nend\n\nto scale-arrowheads\n let this-xcor xcor\n let this-ycor ycor\n let this-speed speed\n let this-heading heading\nend\n\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;;;;; initialization procedures ;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\nto make-box\n ask patches with [(pycor = min-pycor) or (pycor = max-pycor) or (pxcor = min-pxcor) or (pxcor = max-pxcor)]\n [ sprout-walls 1 [ set color yellow initialize-this-wall set pressure? true ] ]\nend\n\nto initialize-this-wall\n set valve-1? false\n set valve-2? false\n set pressure? false\nend\n\nto make-particles\n create-particles number-of-particles [\n setup-particles\n random-position\n ]\nend\n\nto setup-particles ; particles procedure\n set breed particles\n set shape \"circle\"\n set size particle-size\n set energy initial-gas-temperature\n set color-type green\n set color color-type\n set mass 10\n set speed speed-from-energy\n set last-collision nobody\n set zig-zag-direction one-of [-1 1]\nend\n\n; Place particles at random, but they must not be placed on top of wall atoms..\nto random-position\n let open-patches nobody\n let open-patch nobody\n set open-patches patches with [not any? turtles-here and pxcor != max-pxcor and pxcor != min-pxcor and pycor != min-pycor and pycor != max-pycor]\n set open-patch one-of open-patches\n if open-patch = nobody [\n user-message \"No open patches found. Exiting.\"\n stop\n ]\n setxy ([pxcor] of open-patch) ([pycor] of open-patch)\nend\n\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;;;;;; wall penetration error handling procedure ;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n; if particles actually end up within the wall\nto remove-from-walls\n let this-wall walls-here with [not hidden?]\n if count this-wall != 0 [\n let available-patches patches with [not any? walls-here]\n let closest-patch nobody\n if (any? available-patches) [\n set closest-patch min-one-of available-patches [distance myself]\n set heading towards closest-patch\n setxy ([pxcor] of closest-patch) ([pycor] of closest-patch)\n ]\n ]\nend\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;REPORTERS;;;;;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\nto-report speed-from-energy\n report sqrt (2 * energy / mass)\nend\n\nto-report energy-from-speed\n report (mass * speed * speed / 2)\nend\n\nto-report limited-particle-energy\n let limited-energy energy\n if limited-energy > max-particle-energy [ set limited-energy max-particle-energy ]\n if limited-energy < min-particle-energy [ set limited-energy min-particle-energy ]\n report limited-energy\nend\n@#$#@#$#@\nGRAPHICS-WINDOW\n315\n10\n675\n370\n-1\n-1\n72\n1\n11\n1\n1\n1\n0\n0\n0\n1\n-2\n2\n-2\n2\n1\n1\n1\nticks\n30\n\nBUTTON\n15\n105\n125\n166\n↻ setup\nsetup\nNIL\n1\nT\nOBSERVER\nNIL\nNIL\nNIL\nNIL\n1\n\nSLIDER\n20\n10\n280\n43\nnumber-of-particles\nnumber-of-particles\n0\n4\n2\n1\n1\nNIL\nHORIZONTAL\n\nSLIDER\n20\n55\n280\n88\ninitial-gas-temperature\ninitial-gas-temperature\n1\n500\n273\n1\n1\nNIL\nHORIZONTAL\n\nCHOOSER\n15\n235\n215\n280\nvisualize-particle-speed\nvisualize-particle-speed\n\"no\" \"different shades\"\n0\n\nSWITCH\n15\n190\n215\n223\nshow-wall-hits?\nshow-wall-hits?\n0\n1\n-1000\n\nBUTTON\n145\n105\n275\n166\n➤➤ go\ngo\nT\n1\nT\nOBSERVER\nNIL\nNIL\nNIL\nNIL\n1\n\nBUTTON\n15\n305\n175\n361\n☄️ trace a particle\nask one-of particles [pen-down]\nNIL\n1\nT\nOBSERVER\nNIL\nNIL\nNIL\nNIL\n1\n\nTEXTBOX\n0\n405\n180\n451\n...\n6\n7.2\n1\n\nTEXTBOX\n505\n385\n685\n445\n...\n6\n7.2\n1\n@#$#@#$#@\n## WHAT IS IT?\n\nThis model enables students to draw a model to \"sketch\" up representations of new systems to explore concepts related to gas behavior and gas particles. A wide range of real world systems can be modeled with this simple interface (e.g. diffusion of perfume from an uncapped container, hot gas mixed with a cold gas, mixtures of gases).\n\nThis model is part of the Particulate Nature of Matter (PNoM) Curricular Unit. Most of the models in PNoM use the same basic rules for simulating the behavior of gases. Each model highlights different features of how gas behavior is related to gas particle behavior and adds to new features to the model.\n\nIn all of the models, gas particles are assumed to move and to collide, both with each other and with objects such as walls.\n\nIn this model, particles can be added, color coded, and sped up or slowed down, by drawing with the mouse cursor in the WORLD & VIEW. Also, additional types of removable and replaceable walls can be added to the WORLD.\n\n## HOW IT WORKS\n\nThe particles are modeled as hard balls with no internal energy except that which is due to their motion. Collisions between particles are elastic. The total kinetic energy of the two particles after the encounter is equal to their total kinetic energy before the encounter. Collisions with the wall are not. When a particle hits the wall, it bounces off the wall but does not loose any energy to the wall. It does not gain any energy from the wall, either.\n\nThe exact way two particles collide is as follows: \n1. A particle moves in a straight line without changing its speed, unless it collides with another particle or bounces off the wall. \n2. Two particles \"collide\" if they find themselves on the same patch. In this model, two turtles are aimed so that they will collide at the origin. \n3. An angle of collision for the particles is chosen, as if they were two solid balls that hit, and this angle describes the direction of the line connecting their centers. \n4. The particles exchange momentum and energy only along this line, conforming to the conservation of momentum and energy for elastic collisions. \n5. Each particle is assigned its new speed, heading and energy.\n\n\n## HOW TO USE IT\n\n### Buttons \nSETUP - sets up the initial conditions set on the sliders. \nGO/STOP/ADD ELEMENTS - runs and stops the model. This button must be pressed in order to interact with the model. \nREMOVE/REPLACE RED WALL - Toggles the red walls on and off.\nREMOVE/REPLACE BLUE WALL - Toggles the blue walls on and off.\nSAVE - Saves the current state of the model to an external file. You will need to provide a model name after clicking this button.\nLOAD - Loads a previously saved model state file from the computer. You will need to choose a file after clicking this button.\n\n### Sliders \nINITIAL-#-PARTICLES - sets the number of gas particles in the box when the simulation starts. \nINITIAL-GAS-TEMPERATURE sets the initial temperature of the gas.\n\n### Switches \n \nSHOW-WALL-HITS? turn visualization of when particles hits the walls (as flashes) on or off\n\n### Choosers \nVISUALIZE-PARTICLE-SPEED? allows you to visualize particle speeds. For example, selecting \"arrows\", creates a representation of each particle velocity using a scalar arrow. Selecting \"shades\" creates representation of each particle speed using a brighter (faster) or darker (slower) shade of the particle's color.\n\nMOUSE-INTERACTION sets the type interaction the user can do with the mouse in the WORLD & VIEW\n \nPossible settings include: \n\n\"none - let particles move\" - allows the particles to move in the container.\n\"draw basic wall\" - adds a gray wall under the mouse cursor.\n\"draw red removable wall\" - adds a red wall under the mouse cursor which can be alternatively removed and replaced (like a valve) using the REMOVE/REPLACE RED WALL button. \n\"draw blue removable wall\" - adds a green wall under the mouse cursor which can be. alternatively removed and replaced (like a valve) using the REMOVE/REPLACE BLUE WALL button. \n\"big eraser\" - erases all objects (except the yellow box boundary walls) under the mouse cursor. \n\"slow down particles\" - increase the current speed of the particles by 10%. \n\"speed up particles\" - reduces the current speed of the particles by 10%. \n\"paint particles green\" - recolors the particles under the mouse cursor green (other settings include orange and purple) \n\"add green particles\" - adds a couple of new particles under the mouse cursor (other settings include orange and purple)\n\"add/move (nearby particle) sensor 1\" - adds a sensor cable of sensing whether or not a particle is nearby (other sensors include net particle, temperature, and average particle speed.\n\n## THINGS TO NOTICE\n\nNotice how the the particles interact with the wall and how they interact with other particles.\n\n## THINGS TO TRY\n\nCreate a model of how odors move throughout a room. Why do some people smell the odor before others? Does the layout of furniture, large objects, and walls in the room effect the movement of the odor? How about the temperature of the air in the room?\n\nCreate a model of diffusion of a perfume from a closed container. How would you represent the different gases (the perfume and the surrounding air)? What shape will the container be? How will you model a removable cap or lid?\n\nCreate a model of room filled with cold air and a different room filled with warm air. How will represent these different rooms of air? What could you add to show what happens when they mix?\n\nCreate a model of heat transfer that shows what happens to the energy of one very fast moving gas particle when it hits a bunch of very slow moving gas particles. What does this show happening to the energy of the initial gas particles?\n\n\n## RELATED MODELS\n\n* GasLab Models \n* Connected Chemistry models.\n\n## HOW TO CITE\n\nIf you mention this model or the NetLogo software in a publication, we ask that you include the citations below.\n\nFor the model itself:\n\n* Novak, M., Brady, C., Holbert, N., Soylu, F. and Wilensky, U. (2010). Particulate Nature of Matter - Diffusion Sandbox Model. http://ccl.northwestern.edu/netlogo/models/PNoMDiffusionSandbox. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.\n\nPlease cite the NetLogo software as:\n\n* Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.\n\nTo cite the Particulate Nature of Matter (PNoM) curriculum as a whole, please use:\n\n* Novak, M., Brady, C., Holbert, N., Soylu, F. and Wilensky, U. (2010). Particulate Nature of Matter curriculum. http://ccl.northwestern.edu/curriculum/pnom/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.\n\nThanks to Umit Aslan and Mitchell Estberg for updating these models for inclusion the in Models Library\n\n## COPYRIGHT AND LICENSE\n\nCopyright 2018 Uri Wilensky.\n\n![CC BY-NC-SA 3.0](http://ccl.northwestern.edu/images/creativecommons/byncsa.png)\n\nThis work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\n\nCommercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.\n@#$#@#$#@\ndefault\ntrue\n0\nPolygon -7500403 true true 150 5 40 250 150 205 260 250\n\nadd particles\nfalse\n1\nCircle -2674135 false true 60 60 180\nCircle -2674135 false true 36 36 228\n\nadd wall\nfalse\n0\nRectangle -7500403 false true 90 90 210 210\n\nairplane\ntrue\n0\nPolygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15\n\narrow\ntrue\n0\nPolygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150\n\nbox\nfalse\n0\nPolygon -7500403 true true 150 285 285 225 285 75 150 135\nPolygon -7500403 true true 150 135 15 75 150 15 285 75\nPolygon -7500403 true true 15 75 15 225 150 285 150 135\nLine -16777216 false 150 285 150 135\nLine -16777216 false 150 135 15 75\nLine -16777216 false 150 135 285 75\n\nbug\ntrue\n0\nCircle -7500403 true true 96 182 108\nCircle -7500403 true true 110 127 80\nCircle -7500403 true true 110 75 80\nLine -7500403 true 150 100 80 30\nLine -7500403 true 150 100 220 30\n\nbutterfly\ntrue\n0\nPolygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240\nPolygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240\nPolygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163\nPolygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165\nPolygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225\nCircle -16777216 true false 135 90 30\nLine -16777216 false 150 105 195 60\nLine -16777216 false 150 105 105 60\n\ncar\nfalse\n0\nPolygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180\nCircle -16777216 true false 180 180 90\nCircle -16777216 true false 30 180 90\nPolygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89\nCircle -7500403 true true 47 195 58\nCircle -7500403 true true 195 195 58\n\ncarbon\ntrue\n0\nCircle -1184463 true false 68 83 134\n\ncarbon-activated\ntrue\n0\nCircle -1184463 true false 68 83 134\nLine -2674135 false 135 90 135 210\n\ncarbon2\ntrue\n0\nCircle -955883 true false 30 45 210\n\ncircle\nfalse\n1\nCircle -2674135 true true 30 30 240\n\ncircle 2\nfalse\n0\nCircle -7500403 true true 16 16 270\nCircle -16777216 true false 46 46 210\n\nclock\ntrue\n0\nCircle -7500403 true true 30 30 240\nPolygon -16777216 true false 150 31 128 75 143 75 143 150 158 150 158 75 173 75\nCircle -16777216 true false 135 135 30\n\nco2\ntrue\n0\nCircle -13791810 true false 83 165 134\nCircle -13791810 true false 83 0 134\nCircle -1184463 true false 83 83 134\n\ncow\nfalse\n0\nPolygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167\nPolygon -7500403 true true 73 210 86 251 62 249 48 208\nPolygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123\n\neraser\nfalse\n0\nRectangle -7500403 true true 0 0 300 300\nRectangle -1 false false 0 0 300 300\n\nface happy\nfalse\n0\nCircle -7500403 true true 8 8 285\nCircle -16777216 true false 60 75 60\nCircle -16777216 true false 180 75 60\nPolygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240\n\nface neutral\nfalse\n0\nCircle -7500403 true true 8 7 285\nCircle -16777216 true false 60 75 60\nCircle -16777216 true false 180 75 60\nRectangle -16777216 true false 60 195 240 225\n\nface sad\nfalse\n0\nCircle -7500403 true true 8 8 285\nCircle -16777216 true false 60 75 60\nCircle -16777216 true false 180 75 60\nPolygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183\n\nfish\nfalse\n0\nPolygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166\nPolygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165\nPolygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60\nPolygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166\nCircle -16777216 true false 215 106 30\n\nflag\nfalse\n0\nRectangle -7500403 true true 60 15 75 300\nPolygon -7500403 true true 90 150 270 90 90 30\nLine -7500403 true 75 135 90 135\nLine -7500403 true 75 45 90 45\n\nflower\nfalse\n0\nPolygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135\nCircle -7500403 true true 85 132 38\nCircle -7500403 true true 130 147 38\nCircle -7500403 true true 192 85 38\nCircle -7500403 true true 85 40 38\nCircle -7500403 true true 177 40 38\nCircle -7500403 true true 177 132 38\nCircle -7500403 true true 70 85 38\nCircle -7500403 true true 130 25 38\nCircle -7500403 true true 96 51 108\nCircle -16777216 true false 113 68 74\nPolygon -10899396 true false 189 233 219 188 249 173 279 188 234 218\nPolygon -10899396 true false 180 255 150 210 105 210 75 240 135 240\n\nheater-a\nfalse\n0\nRectangle -7500403 true true 0 0 300 300\nRectangle -16777216 true false 90 90 210 210\n\nheater-b\nfalse\n0\nRectangle -7500403 true true 0 0 300 300\nRectangle -16777216 true false 30 30 135 135\nRectangle -16777216 true false 165 165 270 270\n\nhex\nfalse\n0\nPolygon -7500403 true true 0 150 75 30 225 30 300 150 225 270 75 270\n\nhex-valve\nfalse\n0\nRectangle -7500403 false true 0 0 300 300\nPolygon -7500403 false true 105 60 45 150 105 240 195 240 255 150 195 60\n\nhouse\nfalse\n0\nRectangle -7500403 true true 45 120 255 285\nRectangle -16777216 true false 120 210 180 285\nPolygon -7500403 true true 15 120 150 15 285 120\nLine -16777216 false 30 120 270 120\n\nleaf\nfalse\n0\nPolygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195\nPolygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195\n\nline\ntrue\n0\nLine -7500403 true 150 0 150 300\n\nnitrogen\ntrue\n0\nCircle -10899396 true false 83 135 134\nCircle -10899396 true false 83 45 134\n\nnone\ntrue\n0\n\noxygen\ntrue\n0\nCircle -13791810 true false 83 135 134\nCircle -13791810 true false 83 45 134\n\npentagon\nfalse\n0\nPolygon -7500403 true true 150 15 15 120 60 285 240 285 285 120\n\nperson\nfalse\n0\nCircle -7500403 true true 110 5 80\nPolygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90\nRectangle -7500403 true true 127 79 172 94\nPolygon -7500403 true true 195 90 240 150 225 180 165 105\nPolygon -7500403 true true 105 90 60 150 75 180 135 105\n\nplant\nfalse\n0\nRectangle -7500403 true true 135 90 165 300\nPolygon -7500403 true true 135 255 90 210 45 195 75 255 135 285\nPolygon -7500403 true true 165 255 210 210 255 195 225 255 165 285\nPolygon -7500403 true true 135 180 90 135 45 120 75 180 135 210\nPolygon -7500403 true true 165 180 165 210 225 180 255 120 210 135\nPolygon -7500403 true true 135 105 90 60 45 45 75 105 135 135\nPolygon -7500403 true true 165 105 165 135 225 105 255 45 210 60\nPolygon -7500403 true true 135 90 120 45 150 15 180 45 165 90\n\nsensor\nfalse\n0\nCircle -7500403 true true 16 16 270\nCircle -16777216 true false 46 46 210\nRectangle -7500403 true true 15 15 60 60\nRectangle -7500403 true true 240 15 285 60\nRectangle -7500403 true true 15 240 60 285\nRectangle -7500403 true true 240 240 285 285\n\nspray paint\nfalse\n0\nCircle -7500403 true true 164 67 16\nCircle -7500403 true true 82 37 16\nCircle -7500403 true true 127 37 16\nCircle -7500403 true true 96 59 16\nCircle -7500403 true true 52 82 16\nCircle -7500403 true true 22 112 16\nCircle -7500403 true true 52 142 16\nCircle -7500403 true true 29 204 16\nCircle -7500403 true true 127 112 16\nCircle -7500403 true true 112 142 16\nCircle -7500403 true true 81 204 16\nCircle -7500403 true true 149 168 16\nCircle -7500403 true true 200 40 16\nCircle -7500403 true true 257 91 16\nCircle -7500403 true true 207 93 16\nCircle -7500403 true true 190 132 16\nCircle -7500403 true true 233 161 16\nCircle -7500403 true true 247 189 16\nCircle -7500403 true true 135 193 16\nCircle -7500403 true true 187 219 16\nCircle -7500403 true true 234 232 16\nCircle -7500403 true true 176 261 16\nCircle -7500403 true true 144 249 16\nCircle -7500403 true true 146 279 16\nCircle -7500403 true true 87 249 16\n\nspray particles\ntrue\n0\nCircle -7500403 true true 54 84 42\nCircle -7500403 true true 189 114 42\nCircle -7500403 true true 99 174 42\nCircle -7500403 true true 189 234 42\nCircle -7500403 true true 159 9 42\n\nsquare\nfalse\n0\nRectangle -7500403 true true 30 30 270 270\n\nsquare 2\nfalse\n0\nRectangle -7500403 true true 30 30 270 270\nRectangle -16777216 true false 60 60 240 240\n\nstar\nfalse\n0\nPolygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108\n\ntarget\nfalse\n0\nCircle -7500403 true true 0 0 300\nCircle -16777216 true false 30 30 240\nCircle -7500403 true true 60 60 180\nCircle -16777216 true false 90 90 120\nCircle -7500403 true true 120 120 60\n\ntree\nfalse\n0\nCircle -7500403 true true 118 3 94\nRectangle -6459832 true false 120 195 180 300\nCircle -7500403 true true 65 21 108\nCircle -7500403 true true 116 41 127\nCircle -7500403 true true 45 90 120\nCircle -7500403 true true 104 74 152\n\ntriangle\nfalse\n0\nPolygon -7500403 true true 150 30 15 255 285 255\n\ntriangle 2\nfalse\n0\nPolygon -7500403 true true 150 30 15 255 285 255\nPolygon -16777216 true false 151 99 225 223 75 224\n\ntruck\nfalse\n0\nRectangle -7500403 true true 4 45 195 187\nPolygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194\nRectangle -1 true false 195 60 195 105\nPolygon -16777216 true false 238 112 252 141 219 141 218 112\nCircle -16777216 true false 234 174 42\nRectangle -7500403 true true 181 185 214 194\nCircle -16777216 true false 144 174 42\nCircle -16777216 true false 24 174 42\nCircle -7500403 false true 24 174 42\nCircle -7500403 false true 144 174 42\nCircle -7500403 false true 234 174 42\n\nturtle\ntrue\n0\nPolygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210\nPolygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105\nPolygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105\nPolygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87\nPolygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210\nPolygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99\n\nvalve-1\nfalse\n0\nRectangle -7500403 false true 0 0 300 300\nRectangle -7500403 false true 120 120 180 180\n\nvalve-2\nfalse\n0\nRectangle -7500403 false true 0 0 300 300\nRectangle -7500403 false true 60 120 120 180\nRectangle -7500403 false true 165 120 225 180\n\nvalve-hex\nfalse\n0\nRectangle -7500403 false true 0 0 300 300\nPolygon -7500403 false true 105 60 45 150 105 240 195 240 255 150 195 60\n\nvalve-triangle\nfalse\n0\nRectangle -7500403 true true 0 0 300 300\nPolygon -16777216 true false 150 45 30 240 270 240\n\nvalves\nfalse\n0\nRectangle -7500403 false true 0 0 300 300\n\nwall\nfalse\n0\nRectangle -7500403 true true 0 0 300 300\n\nwheel\nfalse\n0\nCircle -7500403 true true 3 3 294\nCircle -16777216 true false 30 30 240\nLine -7500403 true 150 285 150 15\nLine -7500403 true 15 150 285 150\nCircle -7500403 true true 120 120 60\nLine -7500403 true 216 40 79 269\nLine -7500403 true 40 84 269 221\nLine -7500403 true 40 216 269 79\nLine -7500403 true 84 40 221 269\n\nx\nfalse\n0\nPolygon -7500403 true true 270 75 225 30 30 225 75 270\nPolygon -7500403 true true 30 75 75 30 270 225 225 270\n@#$#@#$#@\nNetLogo 6.1.0\n@#$#@#$#@\n@#$#@#$#@\n@#$#@#$#@\n@#$#@#$#@\n@#$#@#$#@\ndefault\n0\n-0.2 0 0 1\n0 1 1 0\n0.2 0 0 1\nlink direction\ntrue\n0\nLine -7500403 true 150 150 90 180\nLine -7500403 true 150 150 210 180\n@#$#@#$#@\n\n@#$#@#$#@\n","netLogoSettings":{"isVertical":true}}