globals [ tick-delta ;; how much we advance the tick counter this time through max-tick-delta ;; the largest tick-delta is allowed to be box-edge ;; distance of box edge from axes divider ;; how wide is the divider/hole channel-size ;;size of the channel that lets the combatants engage--set by user channel-interval ;;Interval between two channels--set by program/uniform..can be random lpar-kills ;; total count of lpar kills lneg-kills ;; total count of lneg kills lneg-to-lpar-kill-ratio ;; ration of lneg/lpar kills (0 floor) war-status? ;;tracks status of war (war: T; no war: F) ] breed [ lpars lpar ] breed [ lnegs lneg ] lpars-own [ step-size speed tick-count ;; helps switch between strategies in case of war ] lnegs-own [ step-size speed tick-count ;; helps switch between strategies in case of war ] patches-own [ lpar_phero lneg_phero ] ;;=============================================== ;; SETUP ;;=============================================== to setup clear-all set war-status? FALSE ask patches [ set pcolor white set lpar_phero 0 ; initialize pheromone levels at the patch to 0 set lneg_phero 0 ; initialize pheromone levels at the patch to 0 ] set-default-shape lpars "bug" set-default-shape lnegs "bug" set max-tick-delta 0.1073 ; the max tick-delta we can simulate ;--Create a square box that contains two chambers that refelects set box-edge (round (max-pxcor * box-size / 100) - 1) set divider (round (max-pxcor * divider-width / 100)) make-box ;--Create the warring swarms, each behind its dividing line make-ants set lpar-kills 0 set lneg-kills 0 set lneg-to-lpar-kill-ratio 0 reset-ticks end ;;=============================================== ;; GO ;;=============================================== to go ask lpars [ set step-size speed * tick-delta ;distance traveled at each tick bounce wiggle set tick-count tick-count + 1 chase-ln jump (speed * tick-delta) set lpar_phero lpar_phero + 1 ] ask lnegs [ set step-size speed * tick-delta ;distance traveled at each tick bounce wiggle set tick-count tick-count + 1 chase-lp jump (speed * tick-delta) set lneg_phero lneg_phero + 1 ] tick-advance tick-delta ;update tick counter by custom amount calculate-tick-delta lnegs lpars diffuse lpar_phero (lp-diffusion-rate / 100) ;observer command diffuse lneg_phero (ln-diffusion-rate / 100) ;observer command ask patches [ if (pcolor = black) [ set lpar_phero 0 set lneg_phero 0 ] set lpar_phero lpar_phero * (100 - lp-evaporation-rate) / 100 ;; slowly evaporate chemical set lneg_phero lneg_phero * (100 - ln-evaporation-rate) / 100 ;; slowly evaporate chemical recolor-patch ;; let the patch color help visualize the pheromone dominance ;; ultimately, the war is really a chemical-war killing-zone ] if lpar-kills != 0 [ set lneg-to-lpar-kill-ratio lneg-kills / lpar-kills ] update-plots display ;update the view immediately ;;no point simulating beyond this... if (lpar-kills = num-lps) or (lneg-kills = num-lns) [ stop ] end ;;=============================================== ;; DRAW THE BOUNDING BOX ;;=============================================== to make-box ask patches with ;set the partionined black-box [ ((abs pxcor = box-edge) and (abs pycor <= box-edge)) or ;left & right edges ((abs pycor = box-edge) and (abs pxcor <= box-edge)) or ;top & bottom edges ((abs pycor <= box-edge) and (abs pxcor <= divider )) ;= 0)) ; the central vertical demarcator ] [ set pcolor black ] ask patches with ; set universe outside the black-box as grey [ (abs pxcor > box-edge) or ;left & right edges (abs pycor > box-edge) ; top & bottom ] [ set pcolor grey ] end ;;=============================================== ;; MAKE-ANTS: CREATE THE ARMY OF ANTS ON BOTH SIDES ;;=============================================== to make-ants create-lnegs num-lns [ set speed ln-speed random-position-left ;this needs to be network based set color red + 1.3 set size 2 set lneg_phero lneg_phero + 1 ] create-lpars num-lps [ set speed lp-speed random-position-right ;this needs to be erdos based set color black ;brown - 0.3 set size 4 set lpar_phero lpar_phero + 1 ] calculate-tick-delta lnegs lpars end ;;=============================================== ;; HELPER FUNCTION TO RANDOMLY SET AGENTS AT RIGHT ;;=============================================== to random-position-right setxy ( 1 + divider + random-float (box-edge - 2 - divider)) ;2)) ((1 - box-edge) + random-float (2 * box-edge - 2)) end ;;=============================================== ;; HELPER FUNCTION TO RANDOMLY SET AGENTS AT LEFT ;;=============================================== to random-position-left setxy (-1 - divider - random-float (box-edge - 2 - divider)) ;2)) ((1 - box-edge) + random-float (2 * box-edge - 2)) end ;;=============================================== ;; BOUNCE OFF THE WALL'S BY SETTING heading ;;=============================================== to bounce ;; turtle procedure ;; if we are already on a wall, no need for further checks if pcolor = black [stop] ;; get the coordinates of the patch we'll be on if we go forward 1 let new-patch patch-ahead step-size let new-px [pxcor] of new-patch let new-py [pycor] of new-patch if [pcolor] of new-patch != black ; no need to bounce [ stop ] ;; if hitting left or right extreme wall, reflect heading around x axis if abs new-px = box-edge [ set heading (- heading)] ;; if hitting top or bottom wall, reflect heading around y axis if abs new-py = box-edge [ set heading (180 - heading) ] ;; if hitting partition, reflect heading around x axis unless near an opening if abs new-px <= divider + 1 [ set heading ( - heading) if [pcolor] of patch-ahead step-size = black [set heading (180 - heading)] ] end ;;=============================================== ;; CALCULATE-TICK-DELTA ;;=============================================== to calculate-tick-delta [ agentset1 agentset2 ] ;; tick-delta is calculated in such a way that even the fastest ;; agent will jump at most 1 patch length in a tick. As ;; agents jump (speed * tick-delta) at every tick, making ;; tick length the inverse of the speed of the fastest agent ;; (1/max speed) assures that. Having each agent advance at most ;; one patch-length is necessary for it not to "jump over" a wall. ifelse ((any? agentset1 with [speed > 0]) or (any? agentset2 with [speed > 0])) [ set tick-delta min (list (1 / (ceiling max [speed] of agentset1)) (1 / (ceiling max [speed] of agentset1)) max-tick-delta) ] [ set tick-delta max-tick-delta ] end ;;=============================================== ;; START-WAR/open partition for the attack begin ;;=============================================== to start-war set war-status? TRUE set channel-size floor (box-edge * (hole-size / 100)) set channel-interval 3 * channel-size let ydelta channel-size + channel-interval ; this is the begin of each hole let patchlist [] ;; patch list to help open the divider and start the war ifelse (many-holes?) [ let y 0 - box-edge + 1 while [y < box-edge - 1 ] [ let k 0 let y1 y while [ k < channel-size] [ let l 0 - (divider) ; to find all patches along x-axis to open-up while [ l < divider + 1] [ set patchlist lput patch l y1 patchlist set l l + 1 ] ;set ylist lput patch 0 y1 ylist set y1 y1 + 1 set k k + 1 ] set y y + ydelta ] foreach patchlist [ ask ?1 [ set pcolor white ;ask flashes-here [die] ] ] ] [ let y ( 0 - channel-size / 2.0) set patchlist [] while [(y < box-edge - 1) and (y <= channel-size)] [ let k 0 let y1 y while [ k < channel-size] [ let l 0 - (divider) ; to find all patches along x-axis to open-up while [ l < divider + 1] [ set patchlist lput patch l y1 patchlist set l l + 1 ] ;set ylist lput patch 0 y1 ylist set y1 y1 + 1 set k k + 1 ] set y y + ydelta ] foreach patchlist [ ask ?1 [ set pcolor white ;ask flashes-here [die] ] ] ] end ;;=============================================== ;; TRUCE/close partition ;;=============================================== to truce set war-status? FALSE ask patches with [ ((abs pycor <= box-edge) and (abs pxcor <= divider )) ] [ set pcolor black ] end ;;=============================================== ;; RECOLOR-PATCH to help visualize pheromone trace ;;=============================================== to recolor-patch ;; patch procedure ;; scale color to show chemical concentration if ((pcolor != black) and (pcolor != grey) ) [ ifelse (abs (lpar_phero - lneg_phero) > 0) [ ifelse (lpar_phero >= lneg_phero) [ set pcolor cyan + 3] [ set pcolor yellow + 3] ] [ set pcolor white ] ] end ;;=============================================== ;; LP-SCENT-AT-ANGLE to help find lp ;;=============================================== to-report lp-scent-at-angle [angle] let p patch-right-and-ahead angle 1 if p = nobody [ report 0 ] report [lpar_phero] of p end ;;=============================================== ;; LN-SCENT-AT-ANGLE to help find ln ;;=============================================== to-report ln-scent-at-angle [angle] let p patch-right-and-ahead angle 1 if p = nobody [ report 0 ] report [lneg_phero] of p end ;;=============================================== ;; CHASE-LP to find lp ;;=============================================== ;; sniff left and right, and go where the strongest lp smell is to chase-lp ;; turtle procedure let scent-ahead lp-scent-at-angle 0 let scent-right lp-scent-at-angle 45 let scent-left lp-scent-at-angle -45 if (scent-right > scent-ahead) or (scent-left > scent-ahead) [ ifelse scent-right > scent-left [ rt 45 ] [ lt 45 ] ] end ;;=============================================== ;; FLEE-LP to flee lp ;;=============================================== ;; sniff left and right, and go away from where the strongest lp smell is to flee-lp ;; turtle procedure let scent-ahead lp-scent-at-angle 0 let scent-right lp-scent-at-angle 8 let scent-left lp-scent-at-angle -8 if (scent-right > scent-ahead) or (scent-left > scent-ahead) [ ifelse scent-right > scent-left [ lt 8 ] [ rt 8 ] ] end ;;=============================================== ;; CHASE-LN to find ln ;;=============================================== ;; sniff left and right, and go where the strongest ln smell is to chase-ln ;; turtle procedure let scent-ahead ln-scent-at-angle 0 let scent-right ln-scent-at-angle 45 let scent-left ln-scent-at-angle -45 if (scent-right > scent-ahead) or (scent-left > scent-ahead) [ ifelse scent-right > scent-left [ rt 45 ] [ lt 45 ] ] end ;;=============================================== ;; FLEE-LN to find ln ;;=============================================== ;; sniff left and right, and go away from where the strongest ln smell is to flee-ln ;; turtle procedure let scent-ahead ln-scent-at-angle 0 let scent-right ln-scent-at-angle 45 let scent-left ln-scent-at-angle -45 if (scent-right > scent-ahead) or (scent-left > scent-ahead) [ ifelse scent-right > scent-left [ rt 45 ] [ lt 45 ] ] end ;;=============================================== ;; KILLING-ZONE; patches execute the cut ;;=============================================== to killing-zone ;; terminator patches let lncount (count lnegs-here) let lpcount (count lpars-here) if (lpcount >= 1 and lncount >= 1) [ ifelse ((lncount - lpcount) >= 2) ; RULE 3: advantage ln [ let prey one-of lpars-here if prey != nobody [ ask prey [ die ] set lpar-kills lpar-kills + 1 ] ] [ ifelse ((lncount - lpcount) = 1) ; RULE 2: toss-up [ let i random 1 ifelse (i = 0) ; advantage lp [ let prey one-of lnegs-here if prey != nobody [ ask prey [ die ] set lneg-kills lneg-kills + 1 ] ] [ ; advantage ln let prey one-of lpars-here if prey != nobody [ ask prey [ die ] set lpar-kills lpar-kills + 1 ] ] ] [ ;RULE 1: advantage lp let prey one-of lnegs-here if prey != nobody [ ask prey [ die ] set lneg-kills lneg-kills + 1 ] ] ] ] ; ; ; if (lncount >= 3) and (lpcount >= 1) and (lpcount <= 2 ) ; Rule 3: dominance ln ; [ ; let prey one-of lpars-here ; if prey != nobody ; [ ; ask prey [ die ] ; set lpar-kills lpar-kills + 1 ; ] ; ] ; ; if (lncount = 2) and (lpcount >= 1) and (lpcount <= 2 ) ;equal dominance ; [ ; let i random 1 ; ifelse (i = 0) ; advantage lp ; [ ; let prey one-of lnegs-here ; if prey != nobody ; [ ; ask prey [ die ] ; set lneg-kills lneg-kills + 1 ; ] ; ] ; [ ; advantage ln ; let prey one-of lpars-here ; if prey != nobody ; [ ; ask prey [ die ] ; set lpar-kills lpar-kills + 1 ; ] ; ] ; ] ; ; if (lncount <= 1) and (lpcount >= 1) ; dominance lp ; [ ; let prey one-of lnegs-here ; if prey != nobody ; [ ; ask prey [ die ] ; set lneg-kills lneg-kills + 1 ; ] ; ] end ;;=============================================== ;; WIGGLE; let the ants do their natural wiggle ;;=============================================== to wiggle if pcolor = black [stop] let r random 5 let l random 5 let p patch-right-and-ahead r 1 let q patch-left-and-ahead l 1 ifelse ([pcolor] of p = black ) or ([pcolor] of q = black ) [stop] [ ; print r ; print l rt r lt l ] end @#$#@#$#@ GRAPHICS-WINDOW 410 10 784 405 45 45 4.0 1 10 1 1 1 0 1 1 1 -45 45 -45 45 0 0 1 ticks 30.0 SLIDER 2 11 174 44 box-size box-size 10 100 97 1 1 % HORIZONTAL SLIDER 4 85 176 118 num-lns num-lns 0 1000 800 1 1 NIL HORIZONTAL SLIDER 182 84 353 117 num-lps num-lps 0 500 135 1 1 NIL HORIZONTAL SLIDER 4 122 176 155 ln-speed ln-speed 0 50 50 1 1 NIL HORIZONTAL SLIDER 183 122 355 155 lp-speed lp-speed 0 25 25 1 1 NIL HORIZONTAL BUTTON 2 235 65 268 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 2 49 173 82 hole-size hole-size 3 30 5 1 1 % HORIZONTAL SWITCH 181 49 355 82 many-holes? many-holes? 0 1 -1000 BUTTON 71 235 134 268 NIL go T 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 150 235 233 268 NIL start-war NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 248 237 311 270 NIL truce NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 3 159 175 192 ln-diffusion-rate ln-diffusion-rate 0 99.0 13 1.0 1 NIL HORIZONTAL SLIDER 4 195 176 228 ln-evaporation-rate ln-evaporation-rate 0 99.0 74 1.0 1 NIL HORIZONTAL SLIDER 183 161 355 194 lp-diffusion-rate lp-diffusion-rate 0 99.0 11 1.0 1 NIL HORIZONTAL SLIDER 185 197 357 230 lp-evaporation-rate lp-evaporation-rate 0 99.0 82 1.0 1 NIL HORIZONTAL MONITOR 192 286 272 331 NIL count(lpars) 17 1 11 MONITOR 3 286 85 331 NIL count(lnegs) 17 1 11 PLOT 8 418 407 692 In Memoriam To Those Who Died time Ant Body-Count 0.0 10.0 0.0 10.0 true true "" "" PENS "lpars" 1.0 0 -16777216 true "" "plotxy ticks lpar-kills" "lnegs" 1.0 0 -2674135 true "" "plotxy ticks lneg-kills" MONITOR 280 286 337 331 lp-dead lpar-kills 17 1 11 MONITOR 92 286 151 331 ln-dead lneg-kills 17 1 11 PLOT 419 419 788 691 For whom the bell tolls... Normalized lneg-body count Normalized lpar-body count 0.0 1.0 0.0 1.0 true false "" "" PENS "default" 1.0 0 -13345367 true "" "plotxy (lneg-kills / num-lns) (lpar-kills / num-lps)" SLIDER 180 11 352 44 divider-width divider-width 1 15 1 1 1 % HORIZONTAL @#$#@#$#@ ## WHAT IS IT? ANTS AT WAR: THE INVASIVE ANT SYNDROME This project focuses on the swarming behavior witnessed in the "INVASIVE ANT SYNDROME". L. Paralienus (lpar or lp for brevity) is the native specialist species; whereas L. Neglectus (lneg or ln for brevity) is the smaller but more numerous/invasive generalist species. By hitch-hiking alongside the modern human-dispersal patterns, these invasive species have rapidly spread across Europe. In just a few decades, they succeeded in eliminating many of the native species. This has had a dramatic disequilibrating effect across many levels of the ecosystem. And it is now poised as a global threat. To put this in perspective, ants constitute 15-20% of the total terrestial animal biomass" [3]. Ants belong to the genus Formicidae that consists of about 12000 (mostly specialized) species. The invasive generalist ants constitute about 200 (less than 2%) of the ant diversity. By rapidly collapsing the bio-diversity across the family lineage, they dramatically narrow the evolutionary ant pathways. Furthermore, given their generalist-nature, they are far more prone to local diseases (fungal/bacterial) that the specialist/nativists have evolved defenses against. Also, estimates of economic "damage and cost-control of invasive species in the U.S. alone amount to more than $138 billion annually [8]." The phenomenon of interest for this project is not the normal foraging or nest building activities; it is instead focused on modeling the relative battle strategies between these two swarms of ant armies. Questions of interest include: 1: What makes the smaller, but more numerous ln's so effective as a fighting machine? 2: How may one visualize the swarm effect when two massive ant armies go to battle? 3: What are some of the structural intervensions one may propose to help regain the diversity balance? The fundamental theoretical work that informs this project is based on the Lanchester laws of combat [Refs. 1, 3 & 7] , first formulated in 1916 (during World War I) by the British Automotive Engineer, Frederick W. Lanchester. There are two versions of the law: the linear vs. the square-law. In the linear version, each of the combatants is sufficiently distributed across the warring landscape and is therefore evenly paired with one other opponent. Here, the lp species has the advantage over ln as it is physically much more stronger in a 1:1 combat. In contrast, the square-law brings about the swarming effect that the ln's are able to project given their larger numbers. Each lp is here being attacked by 2 or more ln's; and the advantage shifts to the more numerous ln's; with the casualties adding up in proportion to the square of the opposing forces. In the ABM simulation, the opposing ant armies are "set up" in two separate chambers that are separated by a partition wall. When the war starts, the partition wall is breached at either a single central location; or evenly across the length of the partition. The former choice helps simulate the square-law effect; wheras the later (by evenly distributing the combatants) helps simulate the linear-law effect. A wide-enough, single opening elicits the square law; whereas multiple small openings elicit the linear law. Experimentally, this is supported in [7] where it is suggested that "..the top dish with a 180 degree opening is consistent with the square law, and the bottom dish with a narrow entrance creates the conditions of the linear law." Extrapolating from the above, one may attempt to visualize what forms of human intervensions may help tilt the balance towards the linear law and away from the square law. As [6] indicates: "Different species may respond differently to habitat fragmentation. Theory predicts that abundant generalist species should be less affected by fragmentation than specialist species. In ant communities, the most abundant species is often behaviourally dominant." On the face of it, this indicates that fragmentation of the habitat (such as clearing the brush or mowing the lawn) clearly favors the invasive species. But a controlled form of fragmentation could favor the nativists while also leveraging the linear law. This is because fragmentation is more akin to opening multiple perforations in the ABM partition wall which gave the advantage to the lp's. But the problem with blanket fragmentation is that it also disrupts the lp-nest. If instead, fragmentation was done by leaving a few spots untouched for the lp-nest to grow and thrive, the balance can then perhaps be restored. The current practice of using baits and toxins does not really scale when faced with the numbers involved in the invasive ant swarms. As Francis Bacon indicated, "Nature to be commanded, must be obeyed." It is far better to work with nature rather than trying to disrupt it without understanding the larger consequences. ## HOW IT WORKS Before the war starts, the respective ant armies are "set up" in two adjacent chambers separated by a dividing wall. The smaller (but usually far more numerous & nimble) L. Neglectus (lneg or ln for brevity) red-ants are to the left; while the larger (and not so numerous nor agile) dark-brown L. Paralienus (lpar or lp for brevity) ants are to the right. Do note that in real-life lneg is not really red; instead they are slightly yellow on brown. But they are depicted as red in order to make the colors stand out for contrast. At each step, the combatants leave chemical signatures (i.e., pheromones) in the patch they inhabit. These chemicals diffuse and evaporate over time. The pheromone trace of the ln-agent is yellowish; while the pheromone trace of the lp-agent is blueish. Ants can sniff and identify both their own chemical droppings as well as that of the enemy. Usually, the diffusion rate is low; while the evaporation rate is high. The user can adjust the various controls (as explained in detail below) to influence the set-up. The event that starts the war is the button-push on "Start-War" which executes the opening of the divider that separates the two ant swarms. The dividing wall can be perforated either at a single central location, or at multiple locations. This option (single vs. multiple perforations) is controlled by the switch: many_holes? This helps establish the distributional toplology of the perforation. As explained above, a single perforation helps elicit the square-law; whereas, multiple perforations help elicit the linear-law. The user can also control the perforation dimensions via the divider-width as well as the hole-size. Larger the size of each perforation, greater the chance that the square law is operative. Once the war starts, each agents starts homing into the enemy pheromone trace wafting around. From then on, it is the decimating numbers as well as the spatial-distribution of the combatants that governs the outcome. The battle-front quickly transforms into clusterrs of fighting, swarmings ants rushing at each other. A few basic rules that govern each of these combat outcomes are as follows (all fights require at least one of each lp & ln in the observant patch): Rule 1: Linear-Law Combat where (lpcount - lncount) >=0); advantage lp Rule 2: Toss-Up Combat where (lncount - lpcount) = 1; it's a toss-up Rule 3: Sqaure-Law Combat where (lncount - lpcount) >= 2; advantage ln Depending on the settings, one may view the formation of the linear vs. the square law patterns on the plot titled: For whom the bell tolls.... While the linear formation is more or less linear; the square law formation shows the classic parabola formation. Where it is a toss-up, it could go either way--with regions of the plot sometimes showing linear sections and sometimes parabolic. ## HOW TO USE IT Note: Length Dimensioning is set as a percentage of the maximum x-dimension of the world view. This approach is denoted as pct-x-max in the description below In summary, the controls include (organized top to bottom on the left of the Interface): 1: Slider/box-size: the size of the bounding-box; set as a pct-x-max. 2: Slider/divider-width: the width of the partition wall; set as a pct-x-max. 3: Slider/hole-size: the diameter (size) of the holes in the partition that will allow the combatants to engage; set as a pct-x-max. 4: Switch/many-holes?: Boolean that indicates if there is to be a single central hole...or many that are evenly placed across the length iof the partition. 5: Slider/num-lns: The number of the more numerous ln's 6: Slider/num-lps: The number of the less numerous lp's 7: Slider/ln-speed: The speed at which the more agile ln moves 8: Sliderlp-speed: The speed at which the less agile lp moves 9: Slider/ln-diffusion-rate: The rate at which the ln pheromone diffuses across the adjacent patches 10: Slider/lp-diffusion-rate: The rate at which the lp pheromone diffuses across the adjacent patches 11: Slider/ln-evaporation-rate: The rate at which the ln pheromone evaporates and is lost 12: Slider/lp-evaporation-rate: The rate at which the lp pheromone evaporates and is lost 13: Button/setup: The setup routine that sets up the bounding boxes as well as the two adjacent armies separated by the partition 14: Button/go: The iterative looping of events that include: Agent-Level Events: a: Bouncing of the agent if near an impenetrable wall b: Random agent wiggle c: Chasing after the strongest enemy pheromone concentration d: Motion into the new patch e: Marking the new patch with self pheromone markings Observer-Level Events: a: Diffusion of the pheromone traces b: Plotting & display updating c: Stopping the simulation/war if one (or both) of the agent sets is anhilated Patch-Level Events: a: Making sure there are no pheromones leaking across impermeable wall's b: Evaporation of the pheromone trace from each of the patches c: Recoloring the patches to reflect the dominant pheromone present in the patch d: Function as the terminator that evaluates the population of combatants at each patch to execute the three basic rules 15: Button/start-war: This opens the perforations as dictated by the user settings (items 1-4 above) 16: Button/truce: This closes the perforation. Any of the enemy combatants (including ones in the perforation) are allowed to continue the battle. 17: Monitor/count(lnegs): Count of ln's currently alive 18: Monitor/ln-dead: ln body count 19: Monitor/count(lpars): Count of lp's currently alive 20: Monitor/lp-dead: lp body count 21: Plot/In Memoriam To Those Who Died: Plots the Ant Body Count against time for each of the combatant spoecies (lp in black, ln in red). 22: Plot/For whom the bell tolls...: Normalized plot of the lp against the ln body-count. Ultimately, one or the other will hit the anhilation wall of 100% destruction. If the trace hits the ceiling, most likely the sqaure law is in effect with the anhilation of the lp's; if the trace hits the right vertical, the linear-law is in effect, with the anhilation of the ln's. ## THINGS TO NOTICE 1: Notice the formation of the ant swarms as the battle lines are joined. 2: Every battle has a begin, middle and end game. See if you can predict which side wins when either one of the sides has hit the 80% anhilation mark. 3: See if the dominance of sqaure law or the linear law can be predicted based on the user settings. 4: Compare and contrast the model with the ant swarm activities one may have noticed in the wild. 5: Notice the marked difference in the body counts when the switch is flipped between single vs. multiple holes. ## THINGS TO TRY Let the default settings be 1: box-size: 97% 2: divider-width: 1% 3: hole-size: 5% 4: many-holes: TRUE 5: num-lns: 1000 6: num-lps: 250 7: ln-speed: 50 8: lp-speed: 25 9: ln-diffusion-rate: 13 10: lp-diffusion-rate: 11 11: ln-evaporation-rate: 74 12: lp-evaporation-rate: 82 Now vary one paired item at a time. A: num-lns vs num-lps 1: Test the model at the low ln extreme. Set num-lns very low (say 100) and num-lps as much higher (say 500). See the working of the linear law. 2: Test the model at the high ln extreme. Set num-lns very high (say 1000) and num-lps as rather low (say 100). See if you notice the parabolic shape of the square law emerge. 3: Test the model as possibly a toss-up with (lp: 135, ln: 800). B: Flip the many-holes switch In each of the above cases in A, flip the many-holes switch to see the difference in the body-count. C: Divider-Width Settings With the default settings, change the divider-width to see if the default case can be flipped over to the losing side. D: Hole-Size Settings With the default settings, change the hole-size to see if the default case can be flipped over to the losing side. E: Speed Settings With the default case, see if changing the speed of the combatants has a marked effect. F: Diffusion-Rate Settings With the default case, see if changing the diffusion-rate of the combatants has a marked effect. G: Evaporation-Rate Settings With the default case, see if changing the evaporation-rate of the combatants has a marked effect. ## EXTENDING THE MODEL 1: The model currently lacks the ability to use the pheromone information of the allied forces; it is only focused on the enemy pheromone trace. It would make sense that the invasive species uses both the pheromone traces (enemy as well as friendly) to launch its swarm attacks. Likewise, the natives are advantaged if they spread out as much as possible (from time to time) and then attack the enemy. For doing that, the natives would need to take advantage of their own pheromone trace levels. Currently, the pheromone trace levels are being used only by the enemy forces; it is not being used to coordinate with the friendly forces for maximum effect. 2: The invasive species is known to exist in multiple interconnected nests (Polydomy--see theory notes below), with communication lines going out to the sister nests. The current model only shows a sinkle war front. In reality, there could be multiple such invasive fronts against a single native nest. To model such a scenario, one would have to put forth a far more complicated multi-faceted war front. ## NETLOGO FEATURES This model was derived by combining elements from two of the models available in the models libaray ("The Ant Model" as well as the "GasLab Two Gas Model"..see Related Model reference below). A few of the interesting usage patterns include: 1: Figuring out how to combine and mash-up existing code bases to put forth a working solution that salavages modeling insights from the samples. 2: Taking advantage of plotxy for plotting items that are not time based 3: Using lput for creating multi-dimensional lists ## RELATED MODELS 1: Ant Model: http://ccl.northwestern.edu/netlogo/models/Ants 2: GasLab Two Gas: http://ccl.northwestern.edu/netlogo/models/GasLabTwoGas 3: War Guard Queen 2 http://ccl.northwestern.edu/netlogo/models/community/War%20Guard%20Queen%202 ## CREDITS AND REFERENCES 1.Modeling warfare in social animals: a "chemical" approach. https://www.ncbi.nlm.nih.gov/pubmed/25369269 2.The Evolution of Invasiveness in Garden Ants https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585788/ 3.Modeling ant battles by means of a diffusion-limited Gillespie algorithm https://arxiv.org/pdf/1503.06094 4.Discrimination behavior in the supercolonial pharaoh ant www2.bio.ku.dk/bibliotek/phd/Luigi%20Pontieri.pdf 5.Invasive Ant Risk Assessment: Lasius neglectus https://mpi.govt.nz/document-vault/2903 6: Experimental small-scale grassland fragmentation alters competitive interactions among ant species http://link.springer.com/article/10.1007/s00442-004-1778-x 7: Do Lancasters Laws of Combat Describe Competition in Ants www.leaflitter.org/pdfs/2000McGlynnBehEcol.pdf 8: Discrimination behavior in the supercolonial pharaoh ant www2.bio.ku.dk/bibliotek/phd/Luigi%20Pontieri.pdf ## THEORY/ANT ENTOMOLOGY 101 Lasius Neglectus (lneg or ln) • Exhibit "Invasive Ant Syndrome" [4]: • They are pre-adapted to live in disturbed environments. • With loose nesting requirements they are able to quickly relocate their colonies in response to home-turf disturbance. • As opportunistic foragers, they are able to thrive in environments that are resource-depleted or different from their natal turf. • They are fully capable of taking advantage of the recent human-mediated, global dispersal machinery. • Polygyny: Many queens in a single nest • Polydomy: A vast colony spread across many nests • Intranidal mating: Mating is within the nest, thus sparing the costly adventure of the queen winging it across hostile terrain to find a partner. Thus queens do not require functional wings weighed down with large fat reserves to survive during the treacherous mating season • Budding: Nest reproduction is via budding, where the queen, its brood and associated workers leave the nest on foot to found a new nest. Budding avoids the costly mating flight as well as the initial set-up cost of reaching a self-sustaining critical mass. • Lacking in stinger but acidopore (for formic acid) present • Large Eyes • Color: Slightly yellow on brown • Primary food: aphid honeydew • Mandibles with 7 teeth • Small body size (length 2.5–3.5 mm). • Large colony size: Small body size goes hand in hand with large colony size as it is less costly to reproduce and grow. They are therefore able to form super-colonies that often outnumber the natives by 10 to 100 times • Unicolonial: Most ant species are multicolonial in nature with distinct boundaries that are aggressively defended. In contrast, the unicolonial species have a looser sense of the "self vs other", thus allowing them to dramatically scale into large numbers with the sharing of agents and resources across the polydome towards a peaceful co-existence. This is by far the key characteristic of the invasive ant species as it dramatically reduces friction (that goes with territoriality) while encouraging colonial cohesion and massing. Genetically this is achieved via reduced genetic variability at the loci coding for cuticular hydrocarbons that function as their chemical id. • Super colonies may grow as large as 14 ha; with just the number of queens estimated to be about 35500 ± 10000; and workers estimated to be around 10^8 workers for the entire super colony. Lasius Paralienus (lpar or lp) • Large body size (length 6-7 mm) • Monogynous species • Biggest queens of all Palaearctic species. • Small colonies • Non-dominant behavior • Color: Black lp-ln Agent-Agent Interaction • ln is often the first aggressor and cooperates and coordinates during attack • ln has the greater mortality. • lp is the escape artist and given the chance it will avoid fighting. • lp is much bigger & stronger than any individual ln. • But lp does not cooperate with its kind. It is therefore often a swarm of ln's around each lp ## AUTHORSHIP John Thomas Submitted as part of the course: Introduction to Agent Based Modeling @#$#@#$#@ 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 sheep false 15 Circle -1 true true 203 65 88 Circle -1 true true 70 65 162 Circle -1 true true 150 105 120 Polygon -7500403 true false 218 120 240 165 255 165 278 120 Circle -7500403 true false 214 72 67 Rectangle -1 true true 164 223 179 298 Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 Circle -1 true true 3 83 150 Rectangle -1 true true 65 221 80 296 Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 Polygon -7500403 true false 276 85 285 105 302 99 294 83 Polygon -7500403 true false 219 85 210 105 193 99 201 83 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 wolf false 0 Polygon -16777216 true false 253 133 245 131 245 133 Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 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 5.2.0 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ 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 @#$#@#$#@