{"spaces":[{"id":0,"spaceId":"ntb-defs-0","name":"Block-code for the [ āž¤āž¤ GO ] button","width":800,"height":600,"defs":{"version":6,"height":600,"width":800,"blocks":[{"id":0,"action":"āž¤āž¤ At GO","isRequired":true,"placement":"starter","type":null,"format":"to define-tango","isTerminal":false,"closeClauses":null,"closeStarter":null,"limit":1,"note":"starts the model","blockColor":"#ffd479","textColor":"#212121","borderColor":"#fffc79","font":null,"allowedTags":{"type":"any-of","tags":["loop"]},"tags":[],"clauses":[],"params":[],"properties":[],"fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif"},{"id":10,"action":"šŸ” repeat","isRequired":false,"placement":"child","type":null,"format":"set num-loops {0}","isTerminal":true,"closeClauses":null,"closeStarter":null,"limit":1,"note":null,"blockColor":null,"textColor":null,"borderColor":null,"font":null,"allowedTags":{"type":"unrestricted"},"tags":["loop"],"clauses":[{"action":null,"open":" ","close":" ","allowedTags":{"type":"unrestricted"}}],"params":[{"name":"number-repeats","unit":null,"step":1,"random":false,"default":10,"type":"int"}],"properties":[]},{"id":9,"action":"āˆž repeat forever","isRequired":false,"placement":"child","type":null,"format":"set num-loops -1","isTerminal":true,"closeClauses":null,"closeStarter":null,"limit":1,"note":null,"blockColor":null,"textColor":null,"borderColor":null,"font":null,"allowedTags":{"type":"unrestricted"},"tags":["loop"],"clauses":[{"action":null,"open":" ","close":" ","allowedTags":{"type":"unrestricted"}}],"params":[],"properties":[]},{"id":1,"action":"āšŖļø the particle","isRequired":false,"placement":"child","type":null,"format":"ask particle (min [who] of particles + {0})","isTerminal":false,"closeClauses":null,"closeStarter":null,"limit":0,"note":"repeatedly asks the specified particle(s) to perform the contained commands","blockColor":"#9437ff","textColor":"#ffffff","borderColor":"#d783ff","font":null,"allowedTags":{"type":"unrestricted"},"tags":["loop"],"clauses":[{"action":null,"open":null,"close":null,"allowedTags":{"type":"any-of","tags":["detection","motion"]}}],"params":[{"name":"number","unit":null,"type":"num","default":"1","def":"1"}],"properties":[],"fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif"},{"id":2,"action":"āšŖļøćƒ»ćƒ»āšŖļø each particle","isRequired":false,"placement":"child","type":null,"format":"ask particles","isTerminal":false,"closeClauses":null,"closeStarter":null,"limit":0,"note":"repeatedly asks all particles to perform the contained commands","blockColor":"#9437ff","textColor":"#ffffff","borderColor":"#d783ff","font":null,"allowedTags":{"type":"unrestricted"},"tags":["loop"],"clauses":[{"action":null,"open":null,"close":null,"allowedTags":{"type":"any-of","tags":["detection","motion"]}}],"params":[],"properties":[],"fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif"},{"id":3,"action":"āŽ®āŽ®ā‡  ā‡  if touches a wall","isRequired":false,"placement":"child","type":null,"format":"if particle-is \"touching a wall\" ","isTerminal":false,"closeClauses":null,"closeStarter":null,"limit":0,"note":"detects if a particle has touched the wall, then executes the contained blocks ","blockColor":"#797979","textColor":"#ffffff","borderColor":"#212121","font":null,"allowedTags":{"type":"unrestricted"},"tags":["detection"],"clauses":[{"action":null,"open":null,"close":null,"allowedTags":{"type":"any-of","tags":["motion"]}}],"params":[],"properties":[],"fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif"},{"id":4,"action":"ā‡¢šŸ’„ā‡  if touches another particle","isRequired":false,"placement":"child","type":null,"format":"if particle-is \"touching another particle\" ","isTerminal":false,"closeClauses":null,"closeStarter":null,"limit":0,"note":"detects if a particle has collided with another particle, then executes any contained blocks","blockColor":"#797979","textColor":"#ffffff","borderColor":"#212121","font":null,"allowedTags":{"type":"unrestricted"},"tags":["detection"],"clauses":[{"action":null,"open":null,"close":null,"allowedTags":{"type":"any-of","tags":["motion"]}}],"params":[],"properties":[],"fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif"},{"id":6,"action":"ā‡ šŸƒšŸ½ā€ā™€ļøšŸƒā€ā™‚ļøā‡  moves ","isRequired":false,"placement":"child","type":null,"format":"set move-behavior {0}","isTerminal":false,"closeClauses":null,"closeStarter":null,"limit":0,"note":"directs particles to move in the selected mode","blockColor":"#0096ff","textColor":"#ffffff","borderColor":"#005493","font":null,"allowedTags":{"type":"unrestricted"},"tags":["motion"],"clauses":[],"params":[{"name":"amount","unit":null,"type":"select","default":"1","quoteValues":"smart-quote","values":[{"actual":"erratic","display":""},{"actual":"straight","display":""},{"actual":"spinning","display":""},{"actual":"zig-zag","display":""}],"def":"1"}],"properties":[],"fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif"},{"id":7,"action":"ā‡ āšŖļøāšŖļøā‡¢ bounces back ","isRequired":false,"placement":"child","type":null,"format":"set-particle-behavior {0}","isTerminal":false,"closeClauses":null,"closeStarter":null,"limit":4,"note":"directs particles to change direction in the selected manner","blockColor":"#ff7e79","textColor":"#ffffff","borderColor":"#ff2600","font":null,"allowedTags":{"type":"unrestricted"},"tags":["motion"],"clauses":[],"params":[{"name":"pattern","unit":null,"type":"select","default":"šŸ€ like a basketball","quoteValues":"smart-quote","values":[{"actual":"basketball","display":"šŸ€ like a basketball"},{"actual":"billiard ball","display":"šŸŽ± like a billiard ball"},{"actual":"football","display":"šŸˆ like a football"},{"actual":"balloon","display":"šŸŽˆ like a balloon"},{"actual":"bowling","display":"šŸŽ³ like a bowling ball"}]}],"properties":[],"fontWeight":400,"fontSize":12,"fontFace":"'Poppins', sans-serif"}],"menuConfig":{"mainGroup":{"isCollapsed":false,"order":[0,10,9,1,2,3,4,6,7]},"tagGroups":[]},"program":{"chains":[{"x":23,"y":31,"blocks":[{"definitionId":0,"instanceId":0,"clauses":[],"params":[],"properties":[],"propertiesDisplay":"shown"},{"definitionId":9,"instanceId":0,"clauses":[{"blocks":[{"definitionId":2,"instanceId":0,"clauses":[{"blocks":[{"definitionId":6,"instanceId":0,"clauses":[],"params":[{"type":"select","value":"zig-zag"}],"properties":[],"propertiesDisplay":"shown"},{"definitionId":3,"instanceId":0,"clauses":[{"blocks":[{"definitionId":7,"instanceId":0,"clauses":[],"params":[{"type":"select","value":"basketball"}],"properties":[],"propertiesDisplay":"shown"}]}],"params":[],"properties":[],"propertiesDisplay":"shown"},{"definitionId":4,"instanceId":0,"clauses":[{"blocks":[{"definitionId":7,"instanceId":1,"clauses":[],"params":[{"type":"select","value":"bowling"}],"properties":[],"propertiesDisplay":"shown"}]}],"params":[],"properties":[],"propertiesDisplay":"shown"}]}],"params":[],"properties":[],"propertiesDisplay":"shown"}]}],"params":[],"properties":[],"propertiesDisplay":"shown"}]}]},"chainOpen":null,"chainClose":null,"variables":[],"expressions":[{"name":"true","type":"bool","arguments":[],"format":null},{"name":"false","type":"bool","arguments":[],"format":null},{"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"],"format":null},{"name":">=","type":"bool","arguments":["num","num"],"format":null},{"name":"<","type":"bool","arguments":["num","num"],"format":null},{"name":"<=","type":"bool","arguments":["num","num"],"format":null},{"name":"!=","type":"bool","arguments":["num","num"],"format":null},{"name":"=","type":"bool","arguments":["num","num"],"format":null},{"name":"+","type":"num","arguments":["num","num"],"format":null},{"name":"-","type":"num","arguments":["num","num"],"format":null},{"name":"Ɨ","type":"num","arguments":["num","num"],"format":"({0} * {1})"},{"name":"/","type":"num","arguments":["num","num"],"format":null},{"name":"random","type":"num","arguments":["num"],"format":"random-float {0}"}]},"netLogoCode":"to define-tango\n set num-loops -1\n ask particles\n [\n set move-behavior \"zig-zag\"\n if particle-is \"touching a wall\" \n [\n set-particle-behavior \"basketball\"\n ]\n if particle-is \"touching another particle\" \n [\n set-particle-behavior \"bowling\"\n ]\n ]\nend","netLogoDisplay":"to define-tango\n set num-loops -1\n ask particles\n [\n set move-behavior \"zig-zag\"\n if particle-is \"touching a wall\" \n [\n set-particle-behavior \"basketball\"\n ]\n if particle-is \"touching another particle\" \n [\n set-particle-behavior \"bowling\"\n ]\n ]\nend"}],"netTangoOptions":{"workspaceBelow":true,"showCode":true,"enablePlayModeDefinitionChanges":false,"enableCodeTips":true},"netLogoOptions":{"commandCenterTab":true,"codeTab":true,"infoTab":true,"speedBar":false,"fileButtons":true,"authoring":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":"ParticleSandboxNetTango_v2","extraCss":"","code":";;; Extended model from the NetLogo Connected Chemistry Curricular Model\n;;; Designed for the ChemTango blocks-based environment version 2\n;;; by Umit Aslan, September 2019\n\nglobals\n[\n tick-advance-amount ;; how much we advance the tick counter this time through\n max-tick-advance-amount ;; the largest tick-advance-amount is allowed to be\n box-edge ;; distance of box edge from axes\n colliding-particles\n sorted-colliding-particles\n colliding-particle-1\n colliding-particle-2\n colliding-pair\n original-tick-advance-amount\n last-view-update\n manage-view-updates?\n view-update-rate ;; specifies the minimum amount of simulation time that must\n ;; pass before the view is updated\n winners\n smallest-particle-size\n largest-particle-size\n kinetic-energy-of-one\n kinetic-energy-of-two\n pressure\n total-particle-number\n total-energy\n\n basketball-slowdown\n balloon-slowdown\n football-slowdown\n \n num-loops ;; jamie - for repeat block\n ticks-at-go\n \n]\n\nbreed [ particles particle ]\n\nbreed [coordinators coordinator] ;;; (umit says) a non-acting coordinator to overcome NetTango's context related issues\n\nparticles-own\n[\n speed\n mass\n\n ;;;; PARTICLE BEHAVIOR MARKERS FOR CHEMTANGO (umit)\n behavior-to-set\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\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, beach ball, football, billiard ball, basketball, balloon, bowling\n;; Collide behavior types: none, beach ball, football, billiard ball, basketball, balloon, bowling\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 set-particle-behavior [b]\n if behavior-to-set = \"bounce\" [set bounce-behavior b]\n if behavior-to-set = \"collide\" [set collide-behavior b]\nend\n\nto-report will-bounce?\n report (placed-touching-a-wall-block? and bounce-behavior != \"none\")\nend\n\nto-report will-collide?\n report (placed-touching-another-particle-block? and collide-behavior != \"none\")\nend\n\nto slow-down [by]\n ifelse speed > 0 [\n set speed (speed - by)\n ][\n set speed 0 \n ]\nend\n\n;; tango correction procedure\n;; tries to make sure that particles don't go through the walls\n;; because some of the tango blocks introduce artificial turns that mess with\n;; the collision algorithm\nto prevent-ghosting\n if not will-bounce? [ stop ]\n let did-bounce? false\n repeat 2 [ ;; we repeat it to account for the corners\n ;; if hitting the top wall, the heading cannot be between -90 to 90, and so on\n if ycor > 12.4 [\n if heading > 270 [ set heading 265 set did-bounce? true set ycor 12.5]\n if heading < 90 [ set heading 95 set did-bounce? true set ycor 12.5]\n ]\n\n if ycor < -12.4 [\n if heading > 90 and heading < 180 [ set heading 85 set did-bounce? true set ycor -12.5]\n if heading > 180 and heading < 270 [ set heading 275 set did-bounce? true set ycor -12.5]\n ]\n\n ;; same goes for the side hits\n\n if xcor > 12.4 [\n if heading > 0 and heading < 90 [ set heading -5 set did-bounce? true set xcor 12.5]\n if heading > 90 and heading < 180 [ set heading 185 set did-bounce? true set xcor 12.5]\n ]\n\n if xcor < -12.4 [\n if heading > 180 and heading < 270 [ set heading 175 set did-bounce? true set xcor -12.5]\n if heading > 270 and heading < 360 [ set heading 5 set did-bounce? true set xcor -12.5]\n ]\n ]\n\n\n ;; because this hacky procedure results in direction change\n ;; prior to actual bounce happening, I need to reduce\n ;; their energy here, as well\n\n if did-bounce? [\n if bounce-behavior = \"football\" [\n ;; loose energy a bit + bounce quite random\n slow-down football-slowdown\n ]\n\n if bounce-behavior = \"basketball\" [\n ;; loose energy a bit + bounce straight\n slow-down basketball-slowdown\n ]\n \n if bounce-behavior = \"balloon\" [\n ;; loose a lot of energy + bounce straight\n slow-down balloon-slowdown\n ]\n \n if bounce-behavior = \"bowling\" [\n ;; completely stop\n set speed 0\n ]\n ]\n\nend\n\nto perform-tango-move\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 prevent-ghosting\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 * 45\n set zig-zag-counter (2 / speed) ;; (not perfect) this tries to make our zig-zags similar regardless of speed\n ]\n prevent-ghosting\n ]\n\n if move-behavior = \"erratic\" [\n ;; loose energy a lot + bounce slightly random\n rt 45 - random 90\n prevent-ghosting\n ]\nend\n\n\nto perform-tango-bounce\n ;; CHEMTANGO >> Loose energy if bouncing like something but a billiard ball\n if bounce-behavior = \"football\" [\n ;; loose energy a bit + bounce quite random\n rt 90 - random 180\n prevent-ghosting\n if move-behavior = \"straight\" [ slow-down football-slowdown ]\n ]\n\n if bounce-behavior = \"billiard ball\" [\n ;; don't loose energy + bounce straight\n ;; in other ways, don't do nothing extra\n ]\n\n if bounce-behavior = \"basketball\" [\n ;; loose energy a bit + bounce straight\n\n ;; i put the conditional below because\n ;; in other conditions, slow-down is already performed by\n ;; the \"prevent ghosting\" procedire\n if move-behavior = \"straight\" [ slow-down basketball-slowdown ]\n ]\n \n if bounce-behavior = \"balloon\" [\n prevent-ghosting\n if move-behavior = \"straight\" [ slow-down balloon-slowdown ]\n ]\n \n if bounce-behavior = \"bowling\" [\n prevent-ghosting\n if move-behavior = \"straight\" [ set speed 0 ]\n ]\nend\n\nto perform-tango-collide\n ;; CHEMTANGO >> Loose energy if colliding like something but a billiard ball\n\n if collide-behavior = \"football\" [\n ;; loose energy a bit + bounce randomly\n prevent-ghosting\n rt 90 - random 180\n slow-down football-slowdown\n ]\n\n if collide-behavior = \"billiard ball\" [\n ;; don't loose energy + bounce straight\n ;; in other ways, don't do nothing extra\n ]\n\n if collide-behavior = \"basketball\" [\n ;; loose energy a bit + bounce straight\n slow-down basketball-slowdown\n ]\n \n if collide-behavior = \"balloon\" [\n prevent-ghosting\n ;; loose energy a bit + bounce straight\n slow-down balloon-slowdown\n ]\n \n if collide-behavior = \"bowling\" [\n prevent-ghosting\n ;; completely stop\n set speed 0\n ]\nend\n\nto chemtango-refresh\n ;; make sure particle behavior is updated each tick\n if num-loops = 1 [ set ticks-at-go ticks ] ;; jamie\n ask particles [\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 ]\n ;; wrapped around the coordinator to overcome the context issues\n ask coordinators [ define-tango ]\nend\n\n\n;;;;;;;;;;;;;;;;\n\nto setup\n clear-all reset-ticks\n\n ;; just to make sure things are coordinated (umit)\n set basketball-slowdown 0.025\n set football-slowdown 0.1\n set balloon-slowdown 0.25\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 set total-particle-number number-of-particles\n set-default-shape particles \"circle\"\n set manage-view-updates? true\n set view-update-rate 0.2\n set box-edge (max-pxcor - 1)\n set smallest-particle-size 4\n set largest-particle-size 4\n set kinetic-energy-of-one 0\n set kinetic-energy-of-two 0\n set num-loops 1 ;; jamie\n set ticks-at-go 0\n make-box\n make-particles\n\n ;; CHEMTANGO ADDITIONS\n chemtango-refresh\n\n ;; set variable tick delta based on fastest particle. If the fastest particle has a speed of 1,\n ;; then tick-advance-amount is 1. If the fastest particles has a speed of 10, then tick-advance-amount is 1/10.\n set tick-advance-amount (1 / (ceiling max [speed] of particles))\n set original-tick-advance-amount tick-advance-amount\n set colliding-particles []\n\n\n ask particles with [will-bounce?] [check-for-wall-collision]\n\n ask particles with [will-collide?] [check-for-particle-collision ]\n\n set colliding-particle-1 nobody\n set colliding-particle-2 nobody\n ifelse labels?\n [ask turtles [ set label who set label-color orange + 3 ]]\n [ask turtles [ set label \"\"]]\nend\n\n\nto go\n chemtango-refresh ;; umit\n \n if num-loops != -1 and ticks >= ticks-at-go + num-loops [ stop ]\n\n ifelse is-turtle? colliding-particle-2\n [\n set colliding-particles filter [ pair ->\n item 1 pair != colliding-particle-1 and\n item 2 pair != colliding-particle-1 and\n item 1 pair != colliding-particle-2 and\n item 2 pair != colliding-particle-2]\n colliding-particles\n ask colliding-particle-2 [check-for-wall-collision]\n ask colliding-particle-2 [check-for-particle-collision]\n ]\n [\n set colliding-particles filter [ pair ->\n item 1 pair != colliding-particle-1 and\n item 2 pair != colliding-particle-1]\n colliding-particles\n ]\n if colliding-particle-1 != nobody [ask colliding-particle-1 [check-for-wall-collision]]\n if colliding-particle-1 != nobody [ask colliding-particle-1 [check-for-particle-collision]]\n\n \n \n sort-collisions \n calculate-energies\n \n\t\n\task particles [ if move-behavior != \"none\" [ jump speed * tick-advance-amount perform-tango-move] ] ;; umit\n \n \n\n ifelse trace? [ ; umit\n ask particle 1 [ pd ] ;; it's particle 1 because turtle 0 is the \"tango coordinator\"\n ][\n ask particle 1 [ pu ] clear-drawing\n ]\n\n if winners != []\n [collide-winners]\n tick-advance tick-advance-amount\n\n\n ask particles [\n if show-speed-as-color? = \"red-green-blue\" [ recolor-banded ]\n if show-speed-as-color? = \"violet shades\" [ recolor-shaded ]\n if show-speed-as-color? = \"one color\" [ recolor-none ]\n if show-speed-as-color? = \"custom color\" [ ]\n ]\n ifelse labels?\n [ask turtles [ set label who set label-color orange + 3 ]]\n [ask turtles [ set label \"\"]]\n\n ;; flag that updates display only after enough simulation time has passed.\n ;; the display-update-rate sets the minimum simulation time that must pass\n ;; before updating the display. This avoids many redisplays of the view for\n ;; a series of small time steps in the simulation (which would make the view show\n ;; what looks like particles slowing down as they get near multiple collision points)\n if manage-view-updates? [\n if (ticks - last-view-update) > view-update-rate\n [ display\n set last-view-update ticks ]\n ]\nend\n\n\n\nto calculate-energies\n ask particles [\n set kinetic-energy-of-one ( 0.5 * mass * (speed * speed))\n\n ]\nend\n\nto-report convert-heading-x [heading-angle]\n report sin heading-angle\nend\n\nto-report convert-heading-y [heading-angle]\n report cos heading-angle\nend\n\nto-report future-time? [time]\n ;;This reporter is necessary because of slight discrepancies in the floating point math.\n ;;Sometimes particles that are colliding at that instant are reported as colliding again\n ;;imperceptibly in the future; this causes the model to hang.\n ;;This function ensures that all expected collisions are legitimate collisions, and not just\n ;;ghosts of floating point errors.\n report time > .0000000001\nend\n\n\nto check-for-particle-collision\n\n if not will-collide? [stop] ;; umit\n\n;; check-for-particle-collision is a particle procedure that determines the time it takes to the collision between\n;; two particles (if one exists). It solves for the time by representing the equations of motion for\n;; distance, velocity, and time in a quadratic equation of the vector components of the relative velocities\n;; and changes in position between the two particles and solves for the time until the next collision\n\n let my-x xcor\n let my-y ycor\n let my-particle-size size\n let my-x-speed (speed * convert-heading-x heading)\n let my-y-speed (speed * convert-heading-y heading)\n\n ask particles with [self != myself]\n [\n let dpx (xcor - my-x) ;; relative distance between particles in the x direction\n let dpy (ycor - my-y) ;; relative distance between particles in the y direction\n let x-speed (speed * convert-heading-x heading) ;; speed of other particle in the x direction\n let y-speed (speed * convert-heading-y heading) ;; speed of other particle in the x direction\n let dvx (x-speed - my-x-speed) ;; relative speed difference between particles in the x direction\n let dvy (y-speed - my-y-speed) ;; relative speed difference between particles in the y direction\n let sum-r (((my-particle-size) / 2 ) + (([size] of self) / 2 )) ;; sum of both particle radii\n\n\n\n ;; To figure out what the difference in position (P1) between two particles at a future time (t) would be,\n ;; one would need to know the current difference in position (P0) between the two particles\n ;; and the current difference in the velocity (V0) between of the two particles.\n\n ;; The equation that represents the relationship would be: P1 = P0 + t * V0\n\n ;; we want find when in time (t), P1 would be equal to the sum of both the particle's radii (sum-r).\n ;; When P1 is equal to is equal to sum-r, the particles will just be touching each other at\n ;; their edges (a single point of contact).\n\n ;; Therefore we are looking for when: sum-r = P0 + t * V0\n\n ;; This equation is not a simple linear equation, since P0 and V0 should both have x and y components\n ;; in their two dimensional vector representation (calculated as dpx, dpy, and dvx, dvy).\n\n\n ;; By squaring both sides of the equation, we get: (sum-r) * (sum-r) = (P0 + t * V0) * (P0 + t * V0)\n\n ;; When expanded gives: (sum-r ^ 2) = (P0 ^ 2) + (t * PO * V0) + (t * PO * V0) + (t ^ 2 * VO ^ 2)\n\n ;; Which can be simplified to: 0 = (P0 ^ 2) - (sum-r ^ 2) + (2 * PO * V0) * t + (VO ^ 2) * t ^ 2\n\n ;; Below, we will let p-squared represent: (P0 ^ 2) - (sum-r ^ 2)\n ;; and pv represent: (2 * PO * V0)\n ;; and v-squared represent: (VO ^ 2)\n\n ;; then the equation will simplify to: 0 = p-squared + pv * t + v-squared * t^2\n\n\n let p-squared ((dpx * dpx) + (dpy * dpy)) - (sum-r ^ 2) ;; p-squared represents difference of the\n ;; square of the radii and the square\n ;; of the initial positions\n\n let pv (2 * ((dpx * dvx) + (dpy * dvy))) ;;the vector product of the position times the velocity\n let v-squared ((dvx * dvx) + (dvy * dvy)) ;; the square of the difference in speeds\n ;; represented as the sum of the squares of the x-component\n ;; and y-component of relative speeds between the two particles\n\n\n ;; p-squared, pv, and v-squared are coefficients in the quadratic equation shown above that\n ;; represents how distance between the particles and relative velocity are related to the time,\n ;; t, at which they will next collide (or when their edges will just be touching)\n\n ;; Any quadratic equation that is the function of time (t), can represented in a general form as:\n ;; a*t*t + b*t + c = 0,\n ;; where a, b, and c are the coefficients of the three different terms, and has solutions for t\n ;; that can be found by using the quadratic formula. The quadratic formula states that if a is not 0,\n ;; then there are two solutions for t, either real or complex.\n\n ;; t is equal to (b +/- sqrt (b^2 - 4*a*c)) / 2*a\n\n ;; the portion of this equation that is under a square root is referred to here\n ;; as the determinant, d1. d1 is equal to (b^2 - 4*a*c)\n ;; and: a = v-squared, b = pv, and c = p-squared.\n\n\n let d1 pv ^ 2 - (4 * v-squared * p-squared)\n\n\n ;; the next line next line tells us that a collision will happen in the future if\n ;; the determinant, d1 is >= 0, since a positive determinant tells us that there is a\n ;; real solution for the quadratic equation. Quadratic equations can have solutions\n ;; that are not real (they are square roots of negative numbers). These are referred\n ;; to as imaginary numbers and for many real world systems that the equations represent\n ;; are not real world states the system can actually end up in.\n\n ;; Once we determine that a real solution exists, we want to take only one of the two\n ;; possible solutions to the quadratic equation, namely the smaller of the two the solutions:\n\n ;; (b - sqrt (b^2 - 4*a*c)) / 2*a\n ;; which is a solution that represents when the particles first touching on their edges.\n\n ;; instead of (b + sqrt (b^2 - 4*a*c)) / 2*a\n ;; which is a solution that represents a time after the particles have penetrated\n ;; and are coming back out of each other and when they are just touching on their edges.\n\n\n let time-to-collision -1\n\n if d1 >= 0 and v-squared > 0\n [set time-to-collision (- pv - sqrt d1) / (2 * v-squared) ] ;;solution for time step\n\n\n ;; if time-to-collision is still -1 there is no collision in the future - no valid solution\n ;; note: negative values for time-to-collision represent where particles would collide\n ;; if allowed to move backward in time.\n ;; if time-to-collision is greater than 1, then we continue to advance the motion\n ;; of the particles along their current trajectories. They do not collide yet.\n\n if future-time? time-to-collision\n [\n ;; time-to-collision is relative (ie, a collision will occur one second from now)\n ;; We need to store the absolute time (ie, a collision will occur at time 48.5 seconds.\n ;; So, we add ticks to time-to-collision when we store it.\n set colliding-pair (list (time-to-collision + ticks) self myself) ;; sets a three element list of\n ;; time to collision and the colliding pair\n set colliding-particles lput colliding-pair colliding-particles ;; adds above list to collection\n ;; of colliding pairs and time\n ;; steps\n ]\n ]\n\nend\n\n\nto check-for-wall-collision ;; particle procedure for determining if a particle will hit one of the\n ;; four walls of the box\n\n if not will-bounce? [stop] ;; stop\n\n\n let x-speed (speed * convert-heading-x heading)\n let y-speed (speed * convert-heading-y heading)\n let xpos-plane (box-edge - 0.5) ;;inside boundary of right side of the box\n let xneg-plane (- box-edge + 0.5) ;;inside boundary of left side of the box\n let ypos-plane (box-edge - 0.5) ;;inside boundary of top side of the box\n let yneg-plane (- box-edge + 0.5) ;;inside boundary of bottom side of the box\n\n ;; find point of contact on edge of circle\n ;; points of contact located at 1 radius above, below, to the left, and to the right\n ;; of the center of the particle\n\n let contact-point-xpos (xcor + (size / 2))\n let contact-point-xneg (xcor - (size / 2))\n let contact-point-ypos (ycor + (size / 2))\n let contact-point-yneg (ycor - (size / 2))\n\n ;; find difference in position between plane location and edge of circle\n\n let dpxpos (xpos-plane - contact-point-xpos)\n let dpxneg (xneg-plane - contact-point-xneg)\n let dpypos (ypos-plane - contact-point-ypos)\n let dpyneg (yneg-plane - contact-point-yneg)\n\n let t-plane-xpos 0\n\n ;; solve for the time it will take the particle to reach the wall by taking\n ;; the distance to the wall and dividing it by the speed in the direction to the wall\n\n ifelse x-speed != 0 [set t-plane-xpos (dpxpos / x-speed)] [set t-plane-xpos 0]\n if future-time? t-plane-xpos\n [\n assign-colliding-wall t-plane-xpos \"plane-xpos\"\n ]\n\n let t-plane-xneg 0\n ifelse x-speed != 0 [set t-plane-xneg (dpxneg / x-speed)] [set t-plane-xneg 0]\n if future-time? t-plane-xneg\n [\n assign-colliding-wall t-plane-xneg \"plane-xneg\"\n ]\n let t-plane-ypos 0\n ifelse y-speed != 0 [set t-plane-ypos (dpypos / y-speed)] [set t-plane-ypos 0]\n if future-time? t-plane-ypos\n [\n assign-colliding-wall t-plane-ypos \"plane-ypos\"\n ]\n\n let t-plane-yneg 0\n ifelse y-speed != 0 [set t-plane-yneg (dpyneg / y-speed)] [set t-plane-yneg 0]\n if future-time? t-plane-yneg\n [\n assign-colliding-wall t-plane-yneg \"plane-yneg\"\n ]\n\nend\n\nto assign-colliding-wall [time-to-collision wall]\n ;; this procedure is used by the check-for-wall-collision procedure\n ;; to assemble the correct particle-wall pair\n ;; time-to-collision is relative (ie, a collision will occur one second from now)\n ;; We need to store the absolute time (ie, a collision will occur at time 48.5 seconds.\n ;; So, we add ticks to time-to-collision when we store it.\n\n set colliding-pair (list (time-to-collision + ticks) self wall)\n set colliding-particles lput colliding-pair colliding-particles\n\nend\n\n\nto sort-collisions\n ;; Sort the list of projected collisions between all the particles into an ordered list.\n ;; Take the smallest time-step from the list (which represents the next collision that will\n ;; happen in time). Use this time step as the tick-advance-amount for all the particles to move through\n\n ifelse colliding-particles != []\n [\n set winners first colliding-particles\n foreach colliding-particles [ pair ->\n if first pair < first winners [set winners pair]\n ]\n ;;winners is now the collision that will occur next\n let dt first winners\n set colliding-particle-1 item 1 winners\n set colliding-particle-2 item 2 winners\n if dt > 0\n [\n ;;If the next collision is more than 1 in the future,\n ;;clear the winners and advance the simulation one tick.\n ;;This helps smooth the model on smaller particle counts.\n ifelse dt - ticks <= 1\n ;;We have to subtract ticks back out because now we want the relative time until collision,\n ;;not the absolute time the collision will occur.\n [set tick-advance-amount dt - ticks]\n ;;Since there are no collisions in the next second, we will set winners to [] to keep from\n ;;mistakenly colliding any particles that shouldn't collide yet.\n [set tick-advance-amount 1 set winners []]\n ]\n\n ]\n ;; When there are no collisions for the next time step,\n ;; tick-advance-amount goes back to the value of original-tick-advance-amount\n [set tick-advance-amount original-tick-advance-amount]\n\nend\n\n\nto collide-winners ;; deal with 3 possible cases of collisions:\n ;; particle and one wall, particle and two walls, and two particles\n\n ;; deal with a case where the next collision in time is between a particle and a wall\n\n\n ;;; umit - in the previous version, I put this directly in the GO procedure\n ;;; but this time it feels better to place it here\n ;;; it complicates things, so I'll place \"umit\" on each line I changed\n\n if colliding-particle-2 = \"plane-xpos\" or colliding-particle-2 = \"plane-xneg\"\n [\n ask colliding-particle-1 [\n set heading (- heading)\n perform-tango-bounce ;; umit\n ]\n stop\n ]\n\n if colliding-particle-2 = \"plane-ypos\" or colliding-particle-2 = \"plane-yneg\"\n [\n ask colliding-particle-1 [\n set heading (180 - heading)\n\t\t\tperform-tango-bounce ;; umit\n ]\n stop\n ]\n\n\n ;; deal with the remaining case of the next collision in time being between two particles.\n\n ask colliding-particle-1 [\n perform-tango-collide ;; umit\n collide-with colliding-particle-2\n ]\n\nend\n\nto collide-with [ other-particle ] ;; particle procedure\n\n ;;; PHASE 1: initial setup\n\n ;; for convenience, grab some quantities from other-particle\n let mass2 [mass] of other-particle\n let speed2 [speed] of other-particle\n let heading2 [heading] of other-particle\n\n ;;modified so that theta is heading toward other particle\n let theta towards other-particle\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-particle\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 particle 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 particle velocity.\n set v1t (2 * vcm - v1t)\n set v2t (2 * vcm - v2t)\n\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 * v1t) + (v1l * v1l))\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\n [ set heading (theta - (atan v1l v1t)) ]\n\n ;; and do the same for other-particle\n ask other-particle [\n set speed sqrt ((v2t ^ 2) + (v2l ^ 2))\n if v2l != 0 or v2t != 0\n [ set heading (theta - (atan v2l v2t)) ]\n ]\n\n ;; PHASE 5: final updates\n\n ;; now recolor, since color is based on quantities that may have changed\n recolor ask other-particle [ recolor ]\nend\n\n\nto recolor\n if show-speed-as-color? = \"red-green-blue\" [ recolor-banded ]\n if show-speed-as-color? = \"violet shades\" [ recolor-shaded ]\n if show-speed-as-color? = \"one color\" [ recolor-none ]\nend\n\n\nto recolor-banded ;; particle procedure\n let avg-speed 1\n ;; avg-speed is assumed to be 0.5, since particles are assigned a random speed between 0 and 1\n ;; particle coloring procedures for visualizing speed with a color palette,\n ;; red are fast particles, blue slow, and green in between.\n\n ifelse speed < (0.5 * avg-speed) ;; at lower than 50% the average speed\n [\n set color blue ;; slow particles colored blue\n ]\n [\n ifelse speed > (1.5 * avg-speed) ;; above 50% higher the average speed\n [ set color red ] ;; fast particles colored blue\n [ set color green ] ;; medium speed particles colored green\n ]\n\nend\n\n\nto recolor-shaded\n let avg-speed 1\n ;; avg-speed is assumed to be 0.5, since particles are assigned a random speed between 0 and 1\n ;; a particle shading gradient is applied to all particles less than speed 1.5,\n ;; the uppermost threshold speed to apply the shading gradient to.\n\n ifelse speed < (3 * avg-speed)\n [ set color (violet - 3.001) + (8 * speed / (3 * avg-speed)) ]\n [ set color (violet + 4.999)]\nend\n\nto recolor-none\n set color green - 1\nend\n\n\n;;;\n;;; drawing procedures\n;;;\n\nto make-box\n ask patches with [ ((abs pxcor = box-edge) and (abs pycor <= box-edge)) or\n ((abs pycor = box-edge) and (abs pxcor <= box-edge)) ]\n [ set pcolor yellow ]\nend\n\n;; creates some particles\nto make-particles\n create-particles number-of-particles\n [\n set speed 1\n set size smallest-particle-size + random-float (largest-particle-size - smallest-particle-size)\n set mass (size * size) ;; set the mass proportional to the area of the particle\n random-position\n set zig-zag-direction one-of [-1 1] ;; umit\n recolor\n ]\nend\n\n;; place particle at random location inside the box.\nto random-position ;; particle procedure\n let count-loops 0\n let radius (size / 2)\n let largest-radius (largest-particle-size / 2)\n let both-radii (radius + largest-radius)\n\n ;;this loop only works with < 25 particles\n while [(count particles in-radius both-radii) > 1 and count-loops < 5000]\n [\n setxy ((radius - (box-edge - size )) + random-float ((2 * (box-edge - size )) - (2 * radius)))\n ((radius - (box-edge - size )) + random-float ((2 * (box-edge - size )) - (2 * radius)))\n set count-loops count-loops + 1\n ]\nend\n\n\n\n\n; Copyright 2005 Uri Wilensky.\n; See Info tab for full copyright and license.\n; --- NETTANGO BEGIN ---\n\n; This block of code was added by the NetTango Web Builder. If you modify this code\n; and re-import it into the NetTango Web Builder you may lose your changes or need\n; to resolve some errors manually.\n\n; If you do not plan to re-import the model into the NetTango Web Builder then you\n; can safely edit this code however you want, just like a normal NetLogo model.\n\nto define-tango\n set num-loops -1\n ask particles\n [\n set move-behavior \"zig-zag\"\n if particle-is \"touching a wall\" \n [\n set-particle-behavior \"basketball\"\n ]\n if particle-is \"touching another particle\" \n [\n set-particle-behavior \"bowling\"\n ]\n ]\nend\n; --- NETTANGO END ---\n@#$#@#$#@\nGRAPHICS-WINDOW\n305\n0\n635\n330\n-1\n-1\n10\n1\n20\n1\n1\n1\n0\n0\n0\n1\n-16\n16\n-16\n16\n1\n1\n1\nticks\n30\n\nBUTTON\n10\n55\n117\n115\nā†»ā†» SETUP\nsetup\nNIL\n1\nT\nOBSERVER\nNIL\nNIL\nNIL\nNIL\n1\n\nSLIDER\n0\n0\n287\n33\nnumber-of-particles\nnumber-of-particles\n1\n4\n2\n1\n1\nNIL\nHORIZONTAL\n\nBUTTON\n125\n55\n287\n115\nāž¤āž¤ GO\ngo\nT\n1\nT\nOBSERVER\nNIL\nNIL\nNIL\nNIL\n0\n\nCHOOSER\n95\n190\n290\n235\nshow-speed-as-color?\nshow-speed-as-color?\n\"red-green-blue\" \"violet shades\" \"one color\"\n0\n\nSWITCH\n155\n250\n289\n283\nlabels?\nlabels?\n1\n1\n-1000\n\nSWITCH\n155\n300\n288\n333\ntrace?\ntrace?\n1\n1\n-1000\n\nTEXTBOX\n75\n345\n255\n405\n.\n12\n0\n1\n@#$#@#$#@\n## WHAT IS IT?\n\nThis model explores the relationship between particle kinetic energies during particle collisions. This model is part of the \"Connected Chemistry\" curriculum http://ccl.northwestern.edu/curriculum/ConnectedChemistry/ which explore the behavior of gases.\n\nThis model is different from the other Connected Chemistry and GasLab models in that the collision calculations take into account the circular shape and size of the particles, instead of modeling the particles as dimensionless points.\n\n## HOW IT WORKS\n\nThe model determines the resulting motion of particles that collide, with no loss in their total momentum or total kinetic energy (an elastic collision).\n\nTo calculate the outcome of collision, it is necessary to calculate the exact time at which the edge of one particle (represented as a circle), would touch the edge of another particle (or the walls of a container) if the particles were allowed to continue with their current headings and speeds.\n\nBy performing such a calculation, one can determine when the next collision anywhere in the system would occur in time. From this determination, the model then advances the motion of all the particles using their current headings and speeds that far in time until this next collision point is reached. Exchange of kinetic energy and momentum between the two particles, according to conservation of kinetic energy and conservation of momentum along the collision axis (a line drawn between the centers of the two particles), is then calculated, and the particles are given new headings and speeds based on this outcome.\n\n## HOW TO USE IT\n\nINITIAL-NUMBER determines the number of gas particles used with SETUP. If the world is too small or the particles are too large, the SETUP procedure of the particles will stop so as to prevent overlapping particles.\n\nChoosers:\nSHOW-SPEED-AS-COLOR? allows you to visualize particle speed using a color palette.\n- The \"blue-green-red\" setting shows the lower half of the speeds of the starting population as blue, and the upper half as red.\n- The \"violet shades\" setting shows a gradient from dark violet (slow) to light violet (fast).\n- The \"all green\" setting shows all particles in green, regardless of speed.\n- The \"custom color\" setting, referenced in the Pedagogica version of this model, allows the user to modify the color of one or more particles, without having to worry that the particles will be recolored with each tick of the clock (as is the case for the other color options).\n\nMonitors:\nCLOCK - number of clock cycles that GO has run.\nPARTICLE 0 SPEED - reports the speed for one of the particles (the first particle created that has a who value of 0)\nPARTICLE 0 HEADING - reports the heading for one of the particles (the first particle created that has a who value of 0)\n\nPlots:\nKINETIC ENERGY VS TIME - plots the kinetic energy for two particles. If the model is run with only two particles for the INITIAL-NUMBER slider, then this graph will show that kinetic energy is conserved in collisions between these two particles.\nPARTICLE 0 SPEED VS. TIME - plots the speed for one of the particles (the first particle created that has a who value of 0) over time.\nPARTICLE 0 HEADING - plots the heading for one of the particles (the first particle created that has a who value of 0) over time.\n\n## THINGS TO NOTICE\n\nParticles never overlap or penetrate into each other or the wall as they move about.\n\nFor only two particles in the world, what do you notice about the kinetic energy of the particles before and after a collision?\n\nDoes kinetic energy of a particle (e.g. particle 0) change when a particle hits the wall?\n\n## THINGS TO TRY\n\nSetting all the particles to have a very slow speed (e.g. 0.001) and one particle to have a very fast speed helps show how kinetic energy is eventually transferred to all the particles through a series of collisions and would serve as a good model for energy exchange through conduction between hot and cold gases.\n\nTo see what the approximate mass of each particle is, type this in the command center:\nask particles [set label precision mass 0]\n\nUse the speed slider (at the top of the View) to run the model in slow motion.\n\nUse the command center to set the speed of all the particles to a very low number (but not zero - e.g. 0.01) and set the speed of one particle to a very high number (e.g. 1000). Watch how the kinetic energy of the fast particle is distributed in collisions to the other particles.\n\nUse the command center to trace the path of a particle, using pendown.\n\nHow is kinetic energy represented by color when you set the SHOW-SPEED-AS-COLOR? chooser to \"violet shades\"?\n\n## EXTENDING THE MODEL\n\nCollisions between boxes and circles could also be explored. Variations in size between particles could investigated or variations in the mass of some of the particle could be made to explore other factors that affect the outcome of collisions.\n\n## NETLOGO FEATURES\n\nThe global variable VIEW-UPDATE-RATE determines the minimum number of simulation clock ticks that must pass before the view is updated. This helps to smooth out the motion of the particles seen in the View. The particles should appear to have a linear rate of change in their motion when they are not colliding. Without a minimum VIEW-UPDATE-RATE, however, this would not appear to be the case, because the model would update the graphics after every tick, and ticks vary in length, depending on how close the next projected collision is. As the tick length moved up and down, the simulation time the particles were allowed to move forward before they were redisplayed would also move up and down. This would cause the motion of the particles to look jerky and non-linear.\n\n## RELATED MODELS\n\nSee GasLab Circular Particles\nSee other Connected Chemistry models.\n\n## CREDITS AND REFERENCES\n\nThis model is part of the Connected Chemistry curriculum. See http://ccl.northwestern.edu/curriculum/chemistry/.\n\nWe would like to thank Sharona Levy and Michael Novak for their substantial contributions to this model.\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* Wilensky, U. (2005). NetLogo Connected Chemistry 3 Circular Particles model. http://ccl.northwestern.edu/netlogo/models/ConnectedChemistry3CircularParticles. 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 Connected Chemistry curriculum as a whole, please use:\n\n* Wilensky, U., Levy, S. T., & Novak, M. (2004). Connected Chemistry curriculum. http://ccl.northwestern.edu/curriculum/chemistry/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.\n\n## COPYRIGHT AND LICENSE\n\nCopyright 2005 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\n\n@#$#@#$#@\ndefault\ntrue\n0\nPolygon -7500403 true true 150 5 40 250 150 205 260 250\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\ncircle\nfalse\n0\nCircle -7500403 true true 1 1 298\n\ncircle 2\nfalse\n0\nCircle -7500403 true true 0 0 300\nCircle -16777216 true false 30 30 240\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\ncylinder\nfalse\n0\nCircle -7500403 true true 0 0 300\n\ndot\nfalse\n0\nCircle -7500403 true true 90 90 120\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\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\nline half\ntrue\n0\nLine -7500403 true 150 0 150 150\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\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\nvector\ntrue\n0\nLine -7500403 true 150 15 150 150\nPolygon -7500403 true true 120 30 150 0 180 30 120 30\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.2.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}}