patches-own [ chemical ;; amount of chemical on this patch food ;; amount of food on this patch (0, 1, or 2) food-life;; duration (energy) of food nest? ;; true on nest patches, false elsewhere nest-scent ;; number that is higher closer to the nest food-source-number ;; number (1, 2, or 3) to identify the food sources infection? growth ;growth is in proccess? decrease on day, when growth < 0 reroduction begin reproduction ;reproduction? decrease on day, when reproduction < 0 dead patch infection-energy ;;energy of infection - decrease each tick ] ;;;;;;;;;;;;;;;;;;;;;;;; ;;; Setup procedures ;;; ;;;;;;;;;;;;;;;;;;;;;;;;energy globals [START_ANTS START_NEST_ENERGY NEST_ENERGY ANTS_POPULATION ANTS_AVG_ENERGY ANTS_POPULATION_OUT ANTS_POPULATION_IN CORDYCEPS_POPULATION CORDYCEPS_INFECTION_ENERGY CORDYCEPS_GROWTH CORDYCEPS_INFECTED CORDYCEPS_SPORES DAYS_SCALE ANTS_BIRTH ] breed [ants ant] breed [cordyceps cordycep] ants-own [ energy;;ants have life duration random energy-infected;;ants have ultimately life with cordyceps (life to death) infected?;;could be infected dead?;;coul be dead idle?;could be resting :) ] to setup clear-all set-default-shape turtles "bug" set START_ANTS 10 set NEST_ENERGY 0 set CORDYCEPS_INFECTION_ENERGY 60 set ANTS_POPULATION_IN 0 set DAYS_SCALE 100 create-ants population [ set size 2 ;; easier to see set color brown set energy random-normal 50 10 ] ;; brown = not carrying food ask n-of population-cordyceps patches [ set infection? 1 set infection-energy random-normal CORDYCEPS_INFECTION_ENERGY 30 ] setup-patches end to setup-patches ; ask n-of (food-creation) patches [ ; set food-source-number 1 ; set food random food-energy ; set food-life random-normal food-duration (food-duration / 100) ; ] ask patches [ setup-nest ;setup-food ; setup-cordyceps recolor-patch ] end to setup-cordyceps ;ask patch-at 50 50 [ ; set infection? 1 ;set infection-energy random-normal CORDYCEPS_INFECTION_ENERGY CORDYCEPS_INFECTION_ENERGY ; ] if random-float 100000 < (population-cordyceps * population-cordyceps) [ set infection? 1 set infection-energy random-normal CORDYCEPS_INFECTION_ENERGY 30 ] end to setup-nest ;; patch procedure ;; set nest? variable to true inside the nest, false elsewhere set nest? (distancexy 0 0) < 5 ;; spread a nest-scent over the whole world -- stronger near the nest set nest-scent 200 - distancexy 0 0 end to recolor-patch ;; patch procedure ;; give color to nest and food sources ifelse nest? [ set pcolor violet ] [ ifelse food > 0 [ if food-source-number = 1 [ set pcolor cyan ] if food-source-number = 2 [ set pcolor sky ] if food-source-number = 3 [ set pcolor blue ] ] ;; scale color to show chemical concentration [ set pcolor scale-color green chemical 0.1 5 ] ] if infection? > 0 [set pcolor yellow] if growth > 0 [ set pcolor white ] if reproduction > 0 [set pcolor orange] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Go procedures ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to go ;; forever button set ANTS_POPULATION_IN count ants with [idle? = 1 AND infected? = 0] set ANTS_POPULATION_OUT (count ants with [infected? = 0 AND idle? = 0 AND energy > 0]) set ANTS_POPULATION ( ANTS_POPULATION_OUT + ANTS_POPULATION_IN ) if ANTS_POPULATION = 0 [ show "ANTS died" ifelse NEST_ENERGY > 0 [ show "not enough food" ] [ show "by cordyceps"] stop ] set CORDYCEPS_GROWTH ( (count patches with [growth > 0]) + (count patches with [reproduction > 0])) set CORDYCEPS_INFECTED (count ants with [infected? = 1]) set CORDYCEPS_SPORES (count patches with [infection? = 1 AND infection-energy > 0]) ;infection on patches + infected ants set CORDYCEPS_POPULATION ( CORDYCEPS_SPORES + CORDYCEPS_INFECTED + CORDYCEPS_GROWTH ) if CORDYCEPS_POPULATION = 0 [ show "cordyceps died" stop ] set ANTS_AVG_ENERGY ( sum [energy] of turtles ) / (ANTS_POPULATION) ask ants with [ idle? = 0] [ if who >= (ticks ) [ stop ] ;; delay initial departure ifelse color = brown [ look-for-food ] ;; not carrying food? look for it [ if color != yellow AND color != orange [ return-to-nest ]] ;; carrying food? take it back to nest if color = yellow [ avoid-nest ] wiggle fd 1 ] diffuse chemical (diffusion-rate / 100) ask patches [ set chemical chemical * (100 - evaporation-rate) / 100 ;; slowly evaporate chemical recolor-patch ] if (NEST_ENERGY < (ANTS_POPULATION / 10)) OR (NEST_ENERGY < ANT_BIRTH_COST) [ ;idle workers must now have to work too! ask ants with [idle? = 1] [ set idle? 0 ] ] ;food regeration if ticks mod (food-creation * DAYS_SCALE) = 0 [ ask n-of (food-creation * 100) patches [ set food-source-number 1 set food random food-energy set food-life random-normal (food-duration + 1) (food-duration / 100) ] ] ;one day if ticks mod DAYS_SCALE = 0 [ ;patch cordyceps policy ;patch with growth > 1 descrease ;probability of death - !!! P_C_GROWTH = 20 ;grow & reproduction decrease ask patches with [growth > 0] [ set growth (growth - 1) if growth <= 0 [ set reproduction random-normal 10 3 ; set pcolor orange show "reproduction begin"; ; set infection-energy random-normal CORDYCEPS_INFECTION_ENERGY 100 ; set infection? 1 ] ] ask patches with [reproduction > 0] [ set reproduction reproduction - 1] ask patches with [infection? = 1 AND infection-energy > 0] [ set infection-energy (infection-energy - 1)] ask patches with [infection? = 1 AND infection-energy < 1] [ set infection? 0 ] ask patches with [reproduction > 0 ] [ ;set infection? 1 ; patch where is reproduction is source ;reproduction depends on huminity && on nest_energy (higher nest energy means traveling throw high canopy for ants) ;it creates nearby new spore if random 100 < (random-normal cordyceps-reproduction ((cordyceps-reproduction) / 10 ))[ ;reproduction ask neighbors [ set infection? 1 set infection-energy random-normal CORDYCEPS_INFECTION_ENERGY 30 ] ] ; ] ask patches with [ food-life > 0] [ set food-life food-life - 1] ask patches with [food-life < 1] [ set food 0 ] ask patches with [reproduction < 0] [ ;reproduction 0, died - ] ;consumpsion ifelse NEST_ENERGY > (ANTS_POPULATION / 10) [ set NEST_ENERGY (NEST_ENERGY - (ANTS_POPULATION / 10)) ] [ ;starving - decrease life if starving? [ ask ants [set energy (energy - 1) ]; ] ] ;some business ;Ant life decreases ask ants [set energy (energy - 1) ]; ask ants with [infected? = 1] [ set energy-infected (energy-infected - 1) ] ;ants with infection must die ultimately, after that, on same location will show up possible new infection which will grow in a week, and then 1 - 2 weeks produce spores ask ants with [infected? = 1 AND energy-infected < 1] [ ask patch-here [ ;this patch, is now starting to grow, after week, there's a reproduction cycle set growth random-normal 7 3 show "start growth" ] ;die ant die ] ;kill ants ask ants with [energy < 1] [ die ] ] ;birth of new, if there's a energy ;birth of new, if there's a energy if ticks mod (ants-creation * DAYS_SCALE) = 0 [ if (NEST_ENERGY > ANT_BIRTH_COST ) [ ;how many? let numberAnts floor (NEST_ENERGY / ANT_BIRTH_COST) set NEST_ENERGY (NEST_ENERGY - (numberAnts * ANT_BIRTH_COST )) set ANTS_BIRTH numberAnts create-ants numberAnts [ set color brown set size 2 set idle? 0 setxy 0 0 set energy random-normal 50 10 ] ] ] do-plotting tick end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to do-plotting if not plot? [ stop ] set-current-plot "Population" ;; since the plot? switch can be turned on and off at ;; any time, we must use PLOTXY to make sure points are ;; plotted with the proper x coordinates set-current-plot-pen "ants" plotxy ticks ANTS_POPULATION set-current-plot-pen "cordyceps" plotxy ticks CORDYCEPS_POPULATION ; set CORDYCEPS_POPULATION ( (count patches with [infection? = 1 AND infection-energy > 0]) + (count ants with [infected? = 1]) + (count patches with [growth > 0]) + (count patches with [reproduction > 0]) ) set-current-plot-pen "cordyceps-spores" plotxy ticks CORDYCEPS_SPORES set-current-plot-pen "cordyceps-growth" plotxy ticks CORDYCEPS_GROWTH set-current-plot-pen "cordyceps-infected" plotxy ticks CORDYCEPS_INFECTED end to return-to-nest ;; turtle procedure ifelse nest? [ ;; drop food and head out again ; set NEST_ENERGY (NEST_ENERGY + ( (1 / ANTS_POPULATION) * 100)) set NEST_ENERGY NEST_ENERGY + 1 ;if nest_energy > 0, stay in, otherwise, search for food ifelse NEST_ENERGY > (ANTS_POPULATION / 10) [ set color brown set idle? 1 ;set ANTS_POPULATION_IN (ANTS_POPULATION_IN + 1) ] [ set color brown rt 180 ] ] [ set chemical chemical + 60 ;; drop some chemical uphill-nest-scent ] ;; head toward the greatest value of nest-scent end to avoid-nest ;; turtle procedure let scent-ahead nest-scent-at-angle 0 let scent-right nest-scent-at-angle 45 let scent-left nest-scent-at-angle -45 if (scent-right > scent-ahead) or (scent-left > scent-ahead) [ ifelse scent-right > scent-left [ rt -45 ] [ lt 0 ] ] ;; head toward the greatest value of nest-scent end to look-for-food ;; turtle procedure ;oops ant got infection if infection? > 0 [ ifelse random 100 < probability-of-infection [ ;this turtle is not ant anymore, its cordyceps now... ;create-cordyceps set color yellow set infected? 1 set infection? 0 set infection-energy 0 set energy-infected random-normal 35 21 ;random distribution 2 - 8 weeks till dead of ant ;;;;;;;;;; show "infected" stop ] [ show "no" ;patch is used ask patch-here [ set infection? 0 set infection-energy 0 ] ] ] if food > 0 [ set color orange + 1 ;; pick up food set food food - 1 ;; and brownuce the food source rt 180 ;; and turn around stop ] ;; go in the direction where the chemical smell is strongest if (chemical >= 0.05) and (chemical < 2) [ uphill-chemical ] end ;; sniff left and right, and go where the strongest smell is to uphill-chemical ;; turtle procedure let scent-ahead chemical-scent-at-angle 0 let scent-right chemical-scent-at-angle 45 let scent-left chemical-scent-at-angle -45 if (scent-right > scent-ahead) or (scent-left > scent-ahead) [ ifelse scent-right > scent-left [ rt 45 ] [ lt 45 ] ] end ;; sniff left and right, and go where the strongest smell is to uphill-nest-scent ;; turtle procedure let scent-ahead nest-scent-at-angle 0 let scent-right nest-scent-at-angle 45 let scent-left nest-scent-at-angle -45 if (scent-right > scent-ahead) or (scent-left > scent-ahead) [ ifelse scent-right > scent-left [ rt 45 ] [ lt 45 ] ] end to wiggle ;; turtle procedure rt random 40 lt random 40 if not can-move? 1 [ rt 180 ] end to-report nest-scent-at-angle [angle] let p patch-right-and-ahead angle 1 if p = nobody [ report 0 ] report [nest-scent] of p end to-report chemical-scent-at-angle [angle] let p patch-right-and-ahead angle 1 if p = nobody [ report 0 ] report [chemical] of p end ; Copyright 1998 Uri Wilensky. All rights reserved. ; The full copyright notice is in the Information tab. @#$#@#$#@ GRAPHICS-WINDOW 266 11 579 345 50 50 3.0 1 10 1 1 1 0 0 0 1 -50 50 -50 50 1 1 1 ticks BUTTON 12 74 80 107 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 9 396 127 429 diffusion-rate diffusion-rate 0 99 15 1 1 NIL HORIZONTAL SLIDER 129 397 248 430 evaporation-rate evaporation-rate 0 99 20 1 1 NIL HORIZONTAL BUTTON 85 74 155 107 NIL go T 1 T OBSERVER NIL NIL NIL NIL SLIDER 596 12 775 45 population population 0 200 50 1 1 NIL HORIZONTAL BUTTON 14 113 111 146 watch watch one-of turtles NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 115 113 222 146 follow follow one-of turtles NIL 1 T OBSERVER NIL NIL NIL NIL TEXTBOX 12 17 250 59 Ophiocordyceps vs ants. \nModified version of Ants model. Parameters are on the right. Try it in both 2D and 3D. 11 0.0 0 BUTTON 8 440 71 473 NIL pd NIL 1 T TURTLE NIL NIL NIL NIL BUTTON 79 441 142 474 NIL pu NIL 1 T TURTLE NIL NIL NIL NIL MONITOR 118 155 220 200 NIL subject 3 1 11 BUTTON 10 480 137 513 NIL clear-drawing NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 147 441 243 474 subject pd if subject != nobody\n[ ask subject [ pd ] ] NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 14 156 114 189 reset reset-perspective NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 9 318 125 351 food-creation food-creation 0.1 3 1.5 0.1 1 NIL HORIZONTAL SLIDER 596 54 768 87 population-cordyceps population-cordyceps 0 100 5 1 1 NIL HORIZONTAL SLIDER 596 100 771 133 probability-of-infection probability-of-infection 0 100 70 1 1 NIL HORIZONTAL MONITOR 268 489 338 534 cordyceps CORDYCEPS_POPULATION 17 1 11 MONITOR 537 437 616 482 NIL NEST_ENERGY 1 1 11 SLIDER 129 318 242 351 food-energy food-energy 2 10 9 1 1 NIL HORIZONTAL MONITOR 395 438 467 483 ants inside ANTS_POPULATION_IN 17 1 11 BUTTON 159 74 222 107 NIL go NIL 1 T OBSERVER NIL NIL NIL NIL MONITOR 474 438 533 483 ants out ANTS_POPULATION_OUT 17 1 11 MONITOR 177 254 234 299 days (ticks / 100) 17 1 11 SLIDER 10 208 113 241 ants-creation ants-creation 0 2 1 0.1 1 NIL HORIZONTAL MONITOR 267 437 391 482 NIL ANTS_POPULATION\n 17 1 11 MONITOR 175 488 260 533 Ants AVG life ANTS_AVG_ENERGY 17 1 11 SLIDER 595 140 776 173 cordyceps-reproduction cordyceps-reproduction 0 80 15 1 1 NIL HORIZONTAL SLIDER 8 358 248 391 food-duration food-duration 2 100 21 1 1 NIL HORIZONTAL SWITCH 119 209 225 242 starving? starving? 1 1 -1000 INPUTBOX 9 250 164 310 ANT_BIRTH_COST 5 1 0 Number PLOT 599 183 925 426 Population time population 0.0 10.0 0.0 10.0 true true PENS "default" 1.0 0 -16777216 true "cordyceps" 1.0 0 -5825686 true "ants" 1.0 0 -6459832 true "cordyceps-spores" 1.0 1 -1184463 true "cordyceps-growth" 1.0 1 -16777216 true "cordyceps-infected" 1.0 1 -2674135 true MONITOR 621 437 692 482 BIRTH ANTS ANTS_BIRTH 17 1 11 SWITCH 797 140 900 173 plot? plot? 0 1 -1000 MONITOR 344 489 455 534 cordyceps-spores (count patches with [infection? = 1 AND infection-energy > 0]) 17 1 11 MONITOR 459 489 578 534 cordyceps-infected (count ants with [infected? = 1]) 17 1 11 MONITOR 582 490 695 535 cordyceps-growth (count patches with [growth > 0]) + (count patches with [reproduction > 0]) 17 1 11 @#$#@#$#@ WHAT IS IT? ----------- This is a version of the Ants model, modified to show off NetLogo's perspective features. Try it in both 2D and 3D. Default Ant model (Wilensky, 1998) modified by (c) 2011 Vojtech Schlesinger (http://www.pifik.com / pif@broskev.cz). In this project, a colony of ants forages for food. Each ant follows a set of simple rules, but the colony as a whole acts in a sophisticated way. When an ant finds a piece of food, it carries the food back to the nest, dropping a chemical as it moves. When other ants "sniff" the chemical, they follow the chemical toward the food. As more ants carry food to the nest, they reinforce the chemical trail. Ants could be infected by ophiocordyceps, it takes 2 - 8 weeks, until ant is killed. Ophiocordyceps has own life cycle, with probability of reproduction and infection. POPIS PARAMETRŮ ----------------- Mraveniště ---- Mraveniště je umístěno ve středu mapy, a odtud mravenci na začátku začínají hledat potravu. Když mravenci potravu naleznou, vrací se s ní do mraveniště, a tím navýší energii mraveniště o přinesenou jednotku. Energie mraveniště Energie mraveniště může být kladná, nebo záporná. Pokud je energie mraveniště záporná, mravenci mají nedostatek potravy a nemůže docházet k rozmnožování mravenců. Pokud je energie mraveniště kladná, dochází k rozmnožování mravenců a zároveň jsou uspokojovány běžné nároky mraveniště na vlastní spotřebu potravu. Potrava Potrava se nachází na daných políčkách, kde se tvoří náhodně podle nastavených parametrů food-creation a food-energy. Potrava je v modelu zobrazena modře. Vytváření potravy (food-creation - FC) Tento parametr určuje, jak rychle a v jaké míře se tvoří nová potrava. Parametr udává, kolik dnů je zapotřebí k vytvoření nové potravy (1 – 30). Nová potrava se vytvoří na 100 krát food-creation polí s energií dánou parametrem food-energy. Energie potravy (food-energy – FE) Tento parametr určuje, kolik maximálně může mít nově vytvořená potrava energie – tzn. že při energii vyšší než jedna, je možné stejné pole pro přesun jednotky energie navštívit mravencem znovu. Modelujeme jako normální rozdělení s parametrem od µ = FE a ?=FE / 100 Mravenci --- Základním agentem je mravenec, který má stanovenou délku života v dnech podle normálního rozdělení s µ=50 a ?=10. Mravenci se pohybují po mapě a hledají jídlo, k čemuž jim napomáhá chemická stopa jiných mravenců, kteří se s potravou vracejí do mraveniště. Mravenci jsou v modelu zobrazeni hnědou barvou. Spotřeba potravy (energie) Každý den spotřebuje mraveniště energii dáno jako desetinu množství populace mravenců. Jedna jednotka jídla tak uživí deset mravenců na den. Pokud není energie k dispozici, mravenci hladoví, což všem sníží o jeden den jejich život, pokud je pravdivý parametr hladovění. Chemikálie a sběr potravy – diffusion-rate a evaporation-rate V modelu jsme zachovali parametry diffusion-rate a evaporation-rate, které udávají, jak široké cesty z chemikálií jsou vytvořeny, resp. jak rychle se tyto cesty vypaří (blíže původní popis modelu). Počet mravenců mimo mraveniště V případě, že je energie mraveniště dostačující pro spotřebu mravenců a rozmnožování, mravenci neopouštějí mraveniště a nesbírají potravu. Tím zmenšují riziko, že budou nakaženi. Tuto informaci, zda mají pracovat dále, nebo ne, se však dozvědí až při navrácení potravy do mraveniště. Vznik nových mravenců – ants-creation AC Vytvoření jednoho mravence stojí podle nastaveného parametru ANT_BIRTH_COST. Je vždy vytvořen takový počet mravenců, na které je energie hnízda, ale jen za AC dní. Nově vytvoření mravenci jsou vytvoření přímo v mraveništi, a jen podle potřeby potravy se mohou hned zapojit do práce, nebo zůstat v mraveništi. Pokud není energie ani na jednoho nového mravence, mravenec není vytvořen. Hladovění – starving? Pokud není dostatek energie pro mravenčí spotřebu, a je tento parametr pravdivý, mravencům je snížen o jednotku jejich život (energie) z důvodů hladovění. Nakažení mravence probability-of-infection PI Probíhá, když je mravenec na políčku s infekcí. Pravděpodobnost, že se mravenec nakazí, je dána parametrem PI. Tento parametr určuje, zda u mravence propukne infekce. Předpokládáme, že ne všichni nakažení mravenci jsou vždy nakonec usmrceni a dojde u nich k rozmnožení Ophiocordycepsu. Tímto parametrem se dá také kompenzovat vliv prostředí, nebo externích vlivů, které mohou ovlivňovat to, zda výtrus nakazí mravence. Ophiocordyceps ---------------- V modelu jsou nakažlivé výtrusy zobrazeny žlutou barvou. Pokud dochází k růstu nové houby, je pole označeno bílou barvou. Pokud je tento výrůstek zralý k reprodukci, je zobrazen červeně. Délka života výtrusu Modelujeme náhodným rozdělením s µ= 60 ?=30. Nakažení mravence Samotné nakažení probíhá, když je mravenec na políčku, které obsahuje výtrus cordycepsu. Pokud se mravenec nakazí, už není pod kontrolou mraveniště, a jen náhodně pobíhá dále od mraveniště, bez toho, aby přijímal potravu. Usmrcení mravence je modelováno normálním rozdělením s µ=35 a ?=21. Usmrcení mravence Po usmrcení mravence trvá, než vyroste plodnice, a může být započnut proces reprodukce. Růst před započetím reprodukce modelujeme normálním rozdělením µ=7 a ?=3. Rozmnožování cordyceps-reproduction CR Délku rozmnožování modelujeme podle normálního rozdělení s hodnotou µ=10 a ?=3. Po skončení této doby končí jeden životní cyklus a proto bude obsazené políčko uvolněno. Rozmnožování probíhá jednou za den, pokud je náhodná pravděpodobnost menší než pravděpodobnost z normálního rozdělení µ=CR a ?=CR/10. Na rozmnožení velmi závisí změna vlhkosti a celkový charakter počasí, kterou v tomto rozdělení velkou odchylkou sledujeme. Pro rozmnožení používáme blízké okolí – pokud dojde k rozmnožení, výtrusy se objeví na sousedních čtyřech políčkách. HOW TO USE IT ------------- Click the SETUP button to set up the ant nest (in violet, at center) and three piles of food. Click the GO button to start the simulation. The chemical is shown in a green-to-white gradient. The EVAPORATION-RATE slider controls the evaporation rate of the chemical. The DIFFUSION-RATE slider controls the diffusion rate of the chemical. If you want to change the number of ants, move the POPULATION slider before pressing SETUP. Press the WATCH ONE-OF TURTLES and FOLLOW ONE-OF TURTLES buttons to focus on the behavior of one specific ant and the area directly surrounding it. Notice that the selected ant is displayed in the SUBJECT monitor. While watching or following an ant you can study its behavior in another way by pressing the SUBJECT PD button. This leaves a trail behind the subject so you can see where its been. Press the RESET-PERSPECTIVE button to return to the broad view of the world. THINGS TO NOTICE ---------------- The ant colony generally exploits the food sources in order, starting with the food closest to the nest, and finishing with the food most distant from the nest. It is more difficult for the ants to form a stable trail to the more distant food, since the chemical trail has more time to evaporate and diffuse before being reinforced. Once the colony finishes collecting the closest food, the chemical trail to that food naturally disappears, freeing up ants to help collect the other food sources. The more distant food sources require a larger "critical number" of ants to form a stable trail. Notice the graveyards with ophiocordyceps. THINGS TO TRY ------------- Try using both the watch and follow perspectives in the 2D and the 3D views. In the 3D view zoom in and out while in follow mode. Note that when you zoom all the way in you are in ride mode. Put the subject's pen down to trace its path. Put all the pens down and study the behavior of all the ants at a high level. NETLOGO FEATURES ------------------- The built-in DIFFUSE primitive lets us diffuse the chemical easily without complicated code. The primitive PATCH-RIGHT-AND-AHEAD is used so to make the ants smell in different directions without actually turning.\ INSPIRATION ----------- - Wilensky, U. (1998). NetLogo Ants (Perspective Demo) model. http://ccl.northwestern.edu/netlogo/models/Ants(PerspectiveDemo). Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. - Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. In other publications, please use: - Copyright 1998 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/Ants(PerspectiveDemo) for terms of use. COPYRIGHT NOTICE ---------------- Copyright 1998 Uri Wilensky. All rights reserved. Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed: a) this copyright notice is included. b) this model will not be redistributed for profit without permission from Uri Wilensky. Contact Uri Wilensky for appropriate licenses for redistribution for profit. This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612. This model was developed at the MIT Media Lab using CM StarLogo. See Resnick, M. (1994) "Turtles, Termites and Traffic Jams: Explorations in Massively Parallel Microworlds." Cambridge, MA: MIT Press. Adapted to StarLogoT, 1998, as part of the Connected Mathematics Project. This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -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 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -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 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -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 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -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 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -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 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -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 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -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 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -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 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 4.1 @#$#@#$#@ need-to-manually-make-preview-for-this-model @#$#@#$#@ @#$#@#$#@ setup go ANTS_POPULATION_IN ANTS_POPULATION_OUT ANTS_POPULATION CORDYCEPS_POPULATION setup go count turtles setup go ANTS_POPULATION_IN ANTS_POPULATION_OUT ANTS_POPULATION CORDYCEPS_POPULATION setup go count turtles setup go ANTS_POPULATION ANTS_POPULATION_IN CORDYCEPS_POPULATION CORDYCEPS_SPORES CORDYCEPS_INFECTED CORDYCEPS_GROWTH ANTS_BIRTH NEST_ENERGY setup go ANTS_POPULATION CORDYCEPS_POPULATION CORDYCEPS_SPORES CORDYCEPS_INFECTED CORDYCEPS_GROWTH NEST_ENERGY setup go ANTS_POPULATION ANTS_POPULATION_IN CORDYCEPS_POPULATION CORDYCEPS_SPORES CORDYCEPS_INFECTED CORDYCEPS_GROWTH ANTS_BIRTH NEST_ENERGY setup go ANTS_POPULATION ANTS_POPULATION_IN CORDYCEPS_POPULATION CORDYCEPS_SPORES CORDYCEPS_INFECTED CORDYCEPS_GROWTH ANTS_BIRTH NEST_ENERGY setup go ANTS_POPULATION ANTS_POPULATION_IN CORDYCEPS_POPULATION CORDYCEPS_SPORES CORDYCEPS_INFECTED CORDYCEPS_GROWTH ANTS_BIRTH NEST_ENERGY @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@