;;Note, in my variables I use rt to designate rest time, md to represent move distance, ta for turn angle extensions [table] globals [ file-name ;;name of this code file - used to name output files allow-move? ;;an indicator of whehter a selected move is allowable TRUE or FALSE rest-time ;;a variable that temporarily holds the length of rest time for each butterfly - it is a global because after the rest time is selected, that amount of time is added to a butterfly's nticks pixel-size ;;length of one side of a patch, e.g., 10 m = 100m^2 patch; this information comes from the habitat file that is loaded p-rest-list ;;list of probabilities of resting in each habitat type (host, nectar, field, forest, exurban) md-mn-list ;;list of mean move distance in each habitat type (host, nectar, field, forest, exurban) md-var-list ;;list of move distance standard dev. (normal dist) for each habitat type (host, nectar, field, forest, exurban) md-alpha-list ;;list of move distance alpha parameters for gamma distribution, calculated from move distance mean and variance md-lambda-list ;;list of move distance lambda parameters for gamma distribution, calculated from move distance mean and variance rt-log-mn-list ;;list of means on the log scale of rest times (normal dist) in each habitat type rt-log-sd-list ;;list of st. devs on the log scale of rest times (normal dist) in each habitat type ta-mn-list ;;turn angle mean cosine new-heading ;;temporarily holds the new heading for an adult while testing is completed to see if the adult can make the move move-dist ;;temporarily holds the move distance chosen for the adult while testing is completed to see if the adult can make the move new-patch? ;;temporary indicator for testing whether the move by an adult results in a location in a different patch p-cross-list ;;holds the matrix of probabilities of crossing from one habitat type to another hab#-from ;;used in choosing a path - temporarily holds the order number (i.e., habtype - 1; host = 0, nectar = 1, field = 2, forest = 3, exurban = 4) of the patch adult is currently in; used to look up the transition probability between habitat types hab#-to ;;used in choosing a path - temporarily holds the order number (i.e., habtype - 1; host = 0, nectar = 1, field = 2, forest = 3, exurban = 4) of the patch adult is heading to; used to look up the transition probability between habitat types ticks-per-day ;;value calculated from number of flight hours per day and number of seconds per tick (flight-hrs/day * 60 min/hr * 60 sec/min / seconds/tick surv-B0 ;;adult survival parameter B0 surv-B1 ;;adult survival parameter B1 p-ovip ;;probability of ovipositing mn-nest-size ;;mean nest size (per oviposition event) max-life-span ;;maximum lifespan for any butterfly; if they haven't died by the end of this value, they are killed winter-surv ;;mean over-winter survival for pre-diapause larvae post-surv ;;post-diapause survival #colonies ;;number of colonies on the landscape #host-patches ;;number of host patches within each colony sim-year ;;keeps track of how many years have been simulated sim-day ;;keeps track of the day within the flight period season ;;keeps track of what season resid-time-1000 ;;running total of residence time in Mima Mounds (1000) host patches for all adults (used to calculate average residence time at the end of each year) resid-time-2000 ;;running total of residence time in Glacial Heritage (2000) host patches for all adults (used to calculate average residence time at the end of each year) patch-time-1000 ;;running total of residence times of all butterflies in in their original Mima host patch patch-time-2000 ;;running total of residence times of all butterflies in in their original Glacial host patch avg-1000-resid-time ;;average of the residence time in all Mima host patches per adult (calculated at end of each year) avg-2000-resid-time ;;average of the residence time in all Glacial host patches per adult (calculated at end of each year) avg-patch-time-1000 ;;average of residence time in original patches over all butterflies and Mima patches avg-patch-time-2000 ;;average of residence time in original patches over all butterflies and Mima patches avg-#nests ;;average number of nests oviposited per adult total-eggs ;;total number of eggs laid by adult butterflies in a flight period tot-eggs-1000 ;;total number of eggs laid by adult butterflies in colony# 1000 in a flight period tot-eggs-2000 ;;total number of eggs laid by adult butterflies in colony# 2000 in a flight period total-nests ;;total number of nests in all patches tot-nests-1000 ;;total number of nests in all patches of colony# 1000 tot-nests-2000 ;;total number of nests in all patches of colony# 2000 #adult-fem ;;number of adults each year (used to store value for output) #adult-fem-1000 ;;number of adult females each year in colony# 1000 (Mima Mounds) #adult-fem-2000 ;;number of adult females each year in colony# 2000 (Glacial Heritage) #post-larv-fem ;;number of post-diapause larvae in a year (used to store value for output) proceed? ;;boolean to indicate whether to proceed with writing a new output file sum-lifespan ;;running total of length of all adult lives (nticks added to total when an adult dies) avg-lifespan ;;avg lifespan (in days) of all adults rest-count ;;count of all rests for all butterflies, used to calculate mean number of rests per female sum-rest-time ;;sum of all rest times; used to calculate mean rest time per rest avg-rest-time ;;average rest time per rest avg-rests-per-f ;;avg rests per female host-area-1000 ;;total area covered by host patches with colony# 1000 (Mima) (in hectares) host-area-2000 ;;total area covered by host patches with colony# 2000 (Glacial) (in hectares) table-#patches ;;table containing the landscape file name as key and the number of host patches (#host-patches) as the lookup value table-dist ;;table containing the landscape file name as key and the distiance between patches (dist) as the lookup value dist ;;distance b/w patches for the landscape used for the sim #landscape-files ;;the number of different scenario landscape files currently in the pull-down menu on the user interface list-patch-pop ;;list of population sizes in each pop yr-env-stoch ;;level of environmental stochasticity for a given year (drawn from a normal with mean 0 and patch-env-stoch ;;level of environmental stochasticity applied in a given patch - only used for uncorrelated environmental stochasticity list-p-env-stoch ;;list of all environmental stochasticity levels in all patches - only used for uncorrelated environmental stochasticity patches-1000 ;;patch-set of patches with [colony# = 1000] patches-2000 ;;patch-set of patches with [colony# = 2000] mn-p-recruit ;;represents the mean recruitment probability from egg to next seasons adult #recruit ;;temporarily holds the number of potential recruits in a host area, then the rest of the larvae are killed off and the #recruited turn into adults #recruit-1000 ;;number of eggs/larvae recruited to adulthood in the colony 1000 (Mima Mounds) #recruit-2000 ;;number of eggs/larvae recruited to adulthood in the colony 2000 (Glacial Heritage) Nt-1-1000 ;;pop size in colony 1000 in previous year Nt-1-2000 ;;pop size in colony 2000 in previous year ln-growth-1 ;;log of the growth rate: ln(Nt/Nt-1); calculated at end of the year for colony 1000 ln-growth-2 ;;log of the growth rate: ln(Nt/Nt-1); calculated at end of the year for colony 2000 extinctime-1 ;;time to extinction for colony 1000 (remains at 0 if pop does not go extinct) extinctime-2 ;;time to extinction for colony 2000 (remains at 0 if pop does not go extinct) mn-grow-1 ;;mean of the log growth rate over all years for colony 1000 mn-grow-2 ;;mean of the log growth rate over all years for colony 2000 sum-grow-1 ;;running sum of log growth rates for colony 1000 sum-grow-2 ;;running sum of log growth rates for colony 2000 sum-sq-grow-1 ;;running sum of the square of log growth rates for colony 1000 sum-sq-grow-2 ;;running sum of the square of log growth rates for colony 2000 var-grow-1 ;;variance of growth rate over all years in sim for colony 1000 var-grow-2 ;;variance of growth rate over all years in sim for colony 2000 p-carry-cap ;;per-patch carrying capacity if environmental stochasticity is uncorrelated ] breed [adults adult] breed [larvae larva] ;;covers egg, pre-diapause larvae, and post-diapause larvae adults-own [ nticks ;;number of ticks this individual butterfly has experienced resting? ;;indicator of this adutl's status - moving or resting (TRUE or FALSE) orig-colony ;;the host area from which this butterfly originated (colony#) orig-patch ;;the host patch from which this butterfly originated (host#) parent-colony ;;the colony from which their parents came - to help understand if there's migration between colonies total-dist ;;total distance moved over lifetime col-resid-time ;;residence time within host patches (colony#) patch-resid-time ;;residence time within original patch (host#) ] larvae-own [ parent-colony ;;the colony from which their parents came - to help understand if there's migration between colonies orig-colony ;;colony in which the larvae is hatched orig-patch ;;patch in which the larvae was hatched ] patches-own [ habtype ;;habitat type value read in from landscape file: 1=host, 2=nectar, 3=field, 4=forest, 5=exurban host# ;;the number associated with each patch, e.g., 1001; 1000+ = Mima Mounds, 2000+ = Glacial Heritage, 3000+ = Scatter Creek East, and 4000+ = Scatter Creek West colony# ;;1000 = Mima Mounts, 2000 = Glacial Heritage p-rest ;;probability of resting in this habitat rt-log-mn ;;mean on the log scale of the normal for rest time rt-log-sd ;;standard deviation on the log scale of the normal for rest time md-alpha ;;move distance alpha parameters for gamma distribution, calculated from move distance mean and variance (from normal dist) md-lambda ;;move distance lambda parameters for gamma distribution, calculated from move distance mean and variance (from normal dist) entry-count ;;is incremented each time an adult enters this patch larvae-count ;;count of the number of larvae in the patch nest-count ;;count of nests laid in the patch ta-mn ;;turn angle mean ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;END OF INITIALIZING;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SET-UP PROCEDURES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup clear-all file-close-all setup-globals setup-patches add-butterflies if behaviorspace-run-number = 0 [set file-name "TCB_ExogDD_SEIBM_1.4" write-output-header ] reset-ticks end to setup-globals set p-rest-list [0.385 0.385 0.385 0.385 0.385] ;;based on Brown et al. 2017 Landscape Ecology set md-mn-list [4.8 6.7 12.5 8.0 12.5] ;;move distance means - from Brown et al. 2017 Landscape Ecology set md-var-list [48.9 91.4 327.4 131.7 327.4] ;;move distance variance - from Brown et al. 2017 Landscape Ecology let counter 0 set md-alpha-list [] set md-lambda-list [] while [counter < 5] [set md-alpha-list lput (((item counter md-mn-list) ^ 2) / item counter md-var-list) md-alpha-list ;;move distance gamma param calculated from mean and st. dev.; each habitat has a different value, thus the WHILE loop set md-lambda-list lput (item counter md-mn-list / item counter md-var-list) md-lambda-list ;;move distance gamma param calculated from mean and st. dev.; each habitat has a different value, thus the WHILE loop set counter counter + 1 ] set rt-log-mn-list [1.63 1.63 1.63 1.63 1.63] ;;rest time log mean - based on Brown et al. 2017 Landscape Ecology set rt-log-sd-list [1.79 1.79 1.79 1.79 1.79] ;;rest time log st. dev. - based on Brown et al. 2017 Landscape Ecology set ta-mn-list [0.292 0.318 0.479 0.378 0.479] ;;turn angle mean cosine for Cauchy distribution from Brown et al. 2017 Landscape Ecology set p-cross-list [[1 1 1 0.3 1 ] ;;probability of transitioning from host to host, nectar, field, forest, exurban; values for meadow to forest intermediate between Brown et al. 2017 Landscape Ecology & Kuefler et al. 2010 Ecology [1 1 1 0.3 1 ] ;;probability of transitioning from nectar to host, nectar, field, forest, exurban; made up values for meadow to forest [1 1 1 0.3 1 ] ;;probability of transitioning from field to host, nectar, field, forest, exurban; made up values for meadow to forest [1 1 1 1 1 ] ;;probability of transitioning from forest to host, nectar, field, forest, exurban; made up values for meadow to forest [1 1 1 0.3 1 ]] ;;probability of transitioning from exurban to host, nectar, field, forest, exurban; made up values for meadow to forest set ticks-per-day flt-hrs-per-day * 60 * 60 / seconds-per-tick set surv-B0 3.704 ;;values from Brown & Crone model 2016 Ecology set surv-B1 -0.196 ;;values from Brown & Crone model 2016 Ecology set pixel-size 10 ;;length in meters of one side of pixel (to get area, square this value) set p-ovip 0.0000306 ;;obtained from Brown & Crone model 2016 Ecology set mn-nest-size 150 ;;from Brown and Crone 2016 Conservation Biology set max-life-span ticks-per-day * 7 * 4 ;;maximum allowable life-span is 4 weeks; from Brown & Crone model 2016 Ecology set #colonies 2 set winter-surv 0.5 ;;from Brown and Crone 2016 Conservation Biology set post-surv 0.722 ;;from Brown and Crone 2016 Conservation Biology set mn-p-recruit winter-surv * post-surv ;;represents the mean recruitment probability from egg to next seasons adult ;initialize values for various counters and other variables that track values through the model set total-eggs 0 set tot-eggs-1000 0 set tot-eggs-2000 0 set total-nests 0 set tot-nests-1000 0 set tot-nests-2000 0 set #post-larv-fem 0 set sim-year 0 set sim-day 1 set season "flight" set ln-growth-1 0 set ln-growth-2 0 set Nt-1-1000 0 set Nt-1-2000 0 set yr-env-stoch 0 ;;sets the annual env. stoch. factor to 0; if env-stoch? is "Correlated", this value will be changed, if not, it will remain 0 set list-p-env-stoch [] ;;initializes this as a list variable; if env-stoch? is "Correlated" or "Off" this will remain an empty list, if it is set to "Uncorrelated" the list will change each year set #landscape-files 31 ;;number of landscape map files read-input-files ifelse density-dep? = TRUE ;;if user has chosen to include carrying capacity, [if env-stoch? = "Uncorrelated" ;; and the environmental stochasticity is uncorrelated, this calculates the patch-level carrying capacity [set p-carry-cap round (carry-cap / #host-patches)] ] ;;but if the env. stoch is correlated, no need to calculate a patch-level carrying capacity [set carry-cap 0] ;;if user has chosen not to include a carrying capacity (switch on interface), then set carrying capacity to 0 so code will work below end to read-input-files set table-#patches table:make file-open "new-scenario-#patch-lookup4.txt" let tmp file-read-line ;;reads the header line and does nothing repeat #landscape-files [table:put table-#patches file-read file-read] file-close set #host-patches table:get table-#patches landscape-file set table-dist table:make file-open "new-scenario-dist-lookup.txt" let tmp2 file-read-line ;;reads the header line and does nothing repeat #landscape-files [table:put table-dist file-read file-read] file-close set dist table:get table-dist landscape-file end to setup-patches let patch-list sort patches file-close file-open landscape-file foreach patch-list [ask ? [set habtype file-read]] file-close ask patches [ifelse habtype >= 1000 ;;host (Chelone and Plantago) patches have a habtype of 1000 (Mima Mounds, or north host patches) or 2000 (Glacial Heritage, or south habitat patches) [set pcolor red set p-rest item 0 p-rest-list set rt-log-mn item 0 rt-log-mn-list set rt-log-sd item 0 rt-log-sd-list set md-alpha item 0 md-alpha-list set md-lambda item 0 md-lambda-list set ta-mn item 0 ta-mn-list set host# habtype ;;1000+ = patches at Mima Mounds, 2000+ = patches at Glacial Heritage ifelse host# >= 2000 [set colony# 2000] [set colony# 1000] set habtype 1 ] [ifelse habtype = 2 ;;nectar meadow [set pcolor yellow set p-rest item (habtype - 1) p-rest-list set rt-log-mn item (habtype - 1) rt-log-mn-list set rt-log-sd item (habtype - 1) rt-log-sd-list set md-alpha item (habtype - 1) md-alpha-list set md-lambda item (habtype - 1) md-lambda-list set ta-mn item (habtype - 1) ta-mn-list ] [ifelse habtype = 3 ;;field [set pcolor 66 ;;lime green set p-rest item (habtype - 1) p-rest-list set rt-log-mn item (habtype - 1) rt-log-mn-list set rt-log-sd item (habtype - 1) rt-log-sd-list set md-alpha item (habtype - 1) md-alpha-list set md-lambda item (habtype - 1) md-lambda-list set ta-mn item (habtype - 1) ta-mn-list ] [ifelse habtype = 4 ;;forest [set pcolor 52 ;;dark green set p-rest item (habtype - 1) p-rest-list set rt-log-mn item (habtype - 1) rt-log-mn-list set rt-log-sd item (habtype - 1) rt-log-sd-list set md-alpha item (habtype - 1) md-alpha-list set md-lambda item (habtype - 1) md-lambda-list set ta-mn item (habtype - 1) ta-mn-list ] [if habtype = 5 ;;exurban [set pcolor brown set p-rest item (habtype - 1) p-rest-list set rt-log-mn item (habtype - 1) rt-log-mn-list set rt-log-sd item (habtype - 1) rt-log-sd-list set md-alpha item (habtype - 1) md-alpha-list set md-lambda item (habtype - 1) md-lambda-list set ta-mn item (habtype - 1) ta-mn-list ] ] ] ] ] ] set patches-1000 patch-set patches with [colony# = 1000] set patches-2000 patch-set patches with [colony# = 2000] set host-area-1000 (count patches-1000 * (pixel-size ^ 2)) / 10000 set host-area-2000 (count patches-2000 * (pixel-size ^ 2)) / 10000 end to add-butterflies ask patches with [colony# = 1000] ;;add butterflies to host patches at Mima Mounds [sprout-adults init-adults-1000 [setup-adults] ] ask patches with [colony# = 2000] [sprout-adults init-adults-2000 [setup-adults] ] set #adult-fem count adults set #adult-fem-1000 count adults with [orig-colony = 1000] set #adult-fem-2000 count adults with [orig-colony = 2000] set list-patch-pop [] let j 1000 let k 100 let i 1 repeat #colonies [repeat #host-patches [let ptch j + i set list-patch-pop lput count adults with [orig-patch = ptch] list-patch-pop set i i + 1 ] set j j + 1000 set i 1 ] end to setup-adults set size 1 set color blue set shape "butterfly" set nticks 0 ; each butterfly has its own individual record of how many ticks it has experienced set resting? FALSE set orig-colony colony# set orig-patch host# end to write-output-header ;;write header to main output file ;;if this is a behavior space run, delete previous output file version and write header (this will only run for the first behavior space run (via code in BS) ifelse behaviorspace-run-number > 0 [if file-exists? (word file-name "-output-BS.txt") [file-delete (word file-name "-output-BS.txt")] file-open (word file-name "-output-BS.txt") file-print "BS Year landscape SimYrs ES ES.std Carry.Cap Mn.Recruit patches Dist Ann.ES adults ln.lam nests eggs recruits mn.lifesp mn.res.time mn.patch.time Adults2000 ln.lam2000 nests2000 eggs2000 recruits2000 mn.res.time2000 mn.patch.time2000 Patch.Pop.Sizes: Patch.ES:" file-close ] ;;if this is not a behvior space run, ask user if previous output file (if it exists) should be deleted [set proceed? TRUE if file-exists? (word file-name "-output.txt") ;;if the output already existes... [ifelse user-yes-or-no? "Overwrite existing output files?" ;; ask user if the old file should be overwritten [file-delete (word file-name "-output.txt")] ;;if the answer is "yes", then delete it so the output for this run is not written to the bottom of the file [user-message "Move or rename old output file and run 'Setup' or 'Reset' again to proceed with simulation." ;;if the user does not want to overwrite the existing files, then display this user message and stop set proceed? FALSE stop ] ] if proceed? = TRUE [ file-open (word file-name "-output.txt") ifelse env-stoch? = "Off" OR env-stoch? = "Correlated" ;;write a different header if the user has chosen Uncorrelated environmental stochasticity [file-print "Sim-Year landscape-file SimYrs Env-Stoch? Env-Stoch-std Carrying-Capacity Mean-Recruitment Patches-per-col Dist-bw-Patches Annual-Env-Stoch #Adults-1000 ln-lam-1000 #nests-1000 #eggs-1000 #recruits-1000 Avg-Lifespan Avg-Res-Time-1000 Avg-Patch-Time-1000 #Adults-2000 ln-lam-2000 #nests-2000 #eggs-2000 #recruits-2000 Avg-Res-Time-2000 Avg-Patch-Time-2000 Patch-Pop-Sizes:"] [file-print "Sim-Year landscape-file SimYrs Env-Stoch? Env-Stoch-std Carrying-Capacity Mean-Recruitment Patches-per-col Dist-bw-Patches Annual-Env-Stoch #Adults-1000 ln-lam-1000 #nests-1000 #eggs-1000 #recruits-1000 Avg-Lifespan Avg-Res-Time-1000 Avg-Patch-Time-1000 #Adults-2000 ln-lam-2000 #nests-2000 #eggs-2000 #recruits-2000 Avg-Res-Time-2000 Avg-Patch-Time-2000 Patch-Pop-Sizes: Patch-Env-Stoch"] file-close ] ] end to reset ;;keeps landscape and patches as is but clears all counters and butterflies to reset for new simulation clear-turtles clear-all-plots reset-patches file-close-all setup-globals add-butterflies reset-totals reset-ticks clear-output write-output-header end to reset-patches ask patches [set entry-count 0 if habtype = 1 [set larvae-count 0] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;END OF SETUP PROCEDURES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GO SECTION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to go if sim-year > years-to-sim OR not any? adults ;;if all years have been simmed, or if no adults have emerged after the larval stage, then stop the simulation [calc-year-end-vals write-output if behaviorspace-run-number > 0 [set mn-grow-1 sum-grow-1 / sim-year set mn-grow-2 sum-grow-2 / sim-year set var-grow-1 (sum-sq-grow-1 - ((sum-grow-1 ^ 2) / sim-year)) / sim-year set var-grow-2 (sum-sq-grow-2 - ((sum-grow-2 ^ 2) / sim-year)) / sim-year ] stop ] rest-or-move? choose-path-and-move oviposit die? tick update-day if (not any? adults) OR (ticks = max-life-span) ;;if all adults are dead or we have reached max allowable life-span, then kill all remaining adults and move to larval stages [ask adults [ifelse orig-colony = 1000 [set resid-time-1000 resid-time-1000 + col-resid-time set patch-time-1000 patch-time-1000 + patch-resid-time ] [set resid-time-2000 resid-time-2000 + col-resid-time set patch-time-2000 patch-time-2000 + patch-resid-time ] set sum-lifespan sum-lifespan + ticks die ] determine-recruitment ;;determine how many of the eggs/larvae will be recruited to adults next year (do not yet turn into adults) calc-year-end-vals write-output emerge ;;apply post-diapause survival rate to determine how many adults will emerge for next flight period set sim-year sim-year + 1 reset-ticks reset-totals ] end to rest-or-move? ;;Decide if the inidividual will rest or move ask adults [if nticks = ticks ;;If adult is not resting during this time period then allow it to decided to move or rest [ifelse (random-float 1 < p-rest) ;;If random draw is < probability of resting (p-rest) for the adult's current habitat, then REST, otherwise MOVE [ set rest-time random-poisson (exp(random-normal rt-log-mn rt-log-sd)) ;;To rest, draw from poisson with mean equal to expoentiated log-normal deviate (determined from GLM by Brown & Crone 2016 Ecology) if rest-time = 0 [set rest-time 1] set nticks nticks + rest-time ;set rest-count rest-count + 1 ;set sum-rest-time sum-rest-time + rest-time set resting? TRUE set color 105 ;;resting butterflies are colored dark blue ] [ set resting? FALSE ;; otherwise, the butterfly will not rest and will go through the move procedure set color 85 ;;non-resting butterflies are colored light turquoise blue ] ] ] end to choose-path-and-move ask adults [if resting? = FALSE [set allow-move? FALSE while [allow-move? = FALSE] [draw-angl-dist ;;calling procedure to draw a random turning angle and distance to move ;;Test if new destination patch is outside the world, if so, draw again until it's not (reflective boundary) while [(patch-at-heading-and-distance new-heading move-dist) = nobody] [draw-angl-dist] ;;Move individual if it is moving within the same patch ifelse (patch-at-heading-and-distance new-heading move-dist) = patch-here [set new-patch? FALSE set allow-move? TRUE] ;;Otherwise, test destination patch to see if the move is allowed [set hab#-from [habtype - 1] of patch-here set hab#-to [habtype - 1] of patch-at-heading-and-distance new-heading move-dist if (random-float 1) < (item hab#-to (item hab#-from p-cross-list)) ;;this looks up the transition prob. in the p-cross-list table; the [item # (item #)] is essentially [column# (of row#)] of the table [set new-patch? TRUE set allow-move? TRUE] ] ] set heading new-heading ;;face the direction of the allowed move jump move-dist ;;move to new location set nticks nticks + 1 ] ] end to draw-angl-dist ;;get random draws for distance to move and turn angle set move-dist (random-gamma md-alpha md-lambda) / pixel-size ;;draw move distance from a gamma with habitat-specific parameters; must be divided by pixel-size to scale it to NetLogo patchsize set new-heading (heading + 2 * atan ( ((1 - ta-mn) / (1 + ta-mn)) * tan(180 * (random-float 1 - 0.5) )) 1) ; set new direction using wrapped cauchy distribution; see model notes about the details of this equation end to oviposit ask adults [if habtype = 1 ;;if the butterfly is in a host patch... [set col-resid-time col-resid-time + 1 ;; then increment its residence time counter, and... if host# = orig-patch [set patch-resid-time patch-resid-time + 1] if random-float 1 < p-ovip ;;Oviposit if the random number is less than the probability of ovipositing [set total-nests total-nests + 1 let #eggs random-poisson mn-nest-size set total-eggs total-eggs + #eggs set larvae-count larvae-count + #eggs ifelse colony# = 1000 [set tot-eggs-1000 tot-eggs-1000 + #eggs set tot-nests-1000 tot-nests-1000 + 1 ] [set tot-eggs-2000 tot-eggs-2000 + #eggs set tot-nests-2000 tot-nests-2000 + 1 ] hatch-larvae #eggs ;;creates a nest of eggs (called larvae) at the location of the adult [set shape "dot" set size 0.5 set color white set parent-colony [orig-colony] of myself set orig-colony colony# set orig-patch host# ] ] ] ] end to die? let day floor (ticks * seconds-per-tick / 60 / 60 / flt-hrs-per-day) ;;calculating what day it is in order to calculate the per-tick survival rate (which derives from the per-day survival rate) let surv-per-tick (exp(surv-B0 + surv-B1 * day) / (1 + exp(surv-B0 + surv-B1 * day))) ^ (1 / ticks-per-day) ;;calculating the per-tick survival rate ask adults [if random-float 1 > surv-per-tick [ifelse orig-colony = 1000 [set resid-time-1000 resid-time-1000 + col-resid-time set patch-time-1000 patch-time-1000 + patch-resid-time ] [set resid-time-2000 resid-time-2000 + col-resid-time set patch-time-2000 patch-time-2000 + patch-resid-time ] set sum-lifespan sum-lifespan + ticks die ] ] end to update-day if (remainder ticks ticks-per-day) = 0 ;;if the # of ticks can be evenly divided by the numbeber of ticks per day, increment the simulation day couner by 1 [set sim-day sim-day + 1] end to determine-recruitment ;;apply the gender ratio (0.5) to only consider females ask n-of (count larvae * 0.5) larvae [die] ;;if the user has chosen to include environmental stochasticity, then SET THE LEVEL OF STOCHASTICITY for this year ifelse env-stoch? = "Correlated" [set yr-env-stoch exp(random-normal 0 env-stoch-std)] [if env-stoch? = "Uncorrelated" [let i 1 repeat #host-patches [set list-p-env-stoch lput exp(random-normal 0 env-stoch-std) list-p-env-stoch set i i + 1 ] ] ] ;;TEST FOR EXCEEDING CARRYING CAPACITY IF APPLICABLE & APPLY ENV. STOCH IF APPLICABLE ;;if env. stoch is uncorrelated, need to step through each patch & if applicable, test if it meets patch carrying capacity (carry-cap/#host patches) ifelse env-stoch? = "Uncorrelated" [let i 1 let j 1000 repeat #colonies [repeat #host-patches [let col j + i set #recruit count larvae with [host# = col] * mn-p-recruit ;;calculate the number of recruits given the number of eggs laid (# female larvae) times the recruitment prob (i.e., overwinter-survival * post-diap-surival) ifelse density-dep? = TRUE AND #recruit > p-carry-cap ;;if the number of potential recruits exceeds carrying capacity, then set # of potential recruits to K + env. stochasticity (if using) [set #recruit p-carry-cap * item (i - 1) list-p-env-stoch] [set #recruit #recruit * item (i - 1) list-p-env-stoch] ;;applies the calculated number of recruits to the actual larvae, but reduces the # of recruits if not that many actual larvae are available let #larv count larvae with [host# = col] ifelse #larv > #recruit [ask n-of (#larv - #recruit) larvae with [host# = col] ;;kill off all larvae that are not recruited [die] ] [set #recruit #larv] ;;in this case the # of recruits calculated from applying ceiling and/or stochasticity exceeds available larvae, so #recruits reduced to available larvae set i i + 1 ] set j j + 1000 set i 1 ] ] ;;If env. stoch is either correlated or off, step through each colony, then depending on density dep status, and correlated or off, do different things [let col# 1000 repeat #colonies [set #recruit count larvae with [orig-colony = col#] * mn-p-recruit ;;calculate the number of recruits given the number of eggs laid (# female larvae) times the recruitment prob (i.e., overwinter-survival * post-diap-surival) ifelse density-dep? = TRUE AND #recruit > carry-cap ;;if the number of potential recruits exceeds carrying capacity, then set # of potential recruits to K + env. stochasticity (if using) [ifelse env-stoch? = "Correlated" [set #recruit carry-cap * yr-env-stoch] [set #recruit carry-cap] ] [if env-stoch? = "Correlated" ;; otherwise if #recruits does not exceed K or there's no density-dep, leave the # of recruits to number calculated above * env. stoch (if using) [set #recruit #recruit * yr-env-stoch] ] let #larv count larvae with [orig-colony = col#] ifelse #larv > #recruit [ask n-of (#larv - #recruit) larvae with [orig-colony = col#] ;;kill off all larvae that are not recruited [die] ] [set #recruit #larv] set col# col# + 1000 ] ] set #recruit-1000 count larvae with [orig-colony = 1000] set #recruit-2000 count larvae with [orig-colony = 2000] end to calc-year-end-vals ifelse #adult-fem-1000 > 0 [set avg-1000-resid-time (resid-time-1000 / #adult-fem-1000) * seconds-per-tick / 60 / 60 / flt-hrs-per-day ;;residence time within host patche in days set avg-patch-time-1000 (patch-time-1000 / #adult-fem-1000) * seconds-per-tick / 60 / 60 / flt-hrs-per-day ;;residence time within host patche in days if sim-year > 0 [set ln-growth-1 ln(#adult-fem-1000 / Nt-1-1000) if behaviorspace-run-number > 0 [set sum-grow-1 sum-grow-1 + ln-growth-1 set sum-sq-grow-1 sum-sq-grow-1 + (ln-growth-1 ^ 2) ] ] ] [if Nt-1-1000 > 0 ;;if #adult-fem is not > 0 (i.e., it equals 0) and this is the first year that the population hit zero (previous year pop size, Nt-1-1000, will be greater than 0) then set extinction time to this year [set extinctime-1 sim-year] ] ifelse #adult-fem-2000 > 0 [set avg-2000-resid-time (resid-time-2000 / #adult-fem-2000) * seconds-per-tick / 60 / 60 / flt-hrs-per-day ;;residence time within host patche in days set avg-patch-time-2000 (patch-time-2000 / #adult-fem-2000) * seconds-per-tick / 60 / 60 / flt-hrs-per-day ;;residence time within host patche in days if sim-year > 0 [set ln-growth-2 ln(#adult-fem-2000 / Nt-1-2000) if behaviorspace-run-number > 0 [set sum-grow-2 sum-grow-2 + ln-growth-2 set sum-sq-grow-2 sum-sq-grow-2 + (ln-growth-2 ^ 2) ] ] ] [if Nt-1-2000 > 0 ;;if #adult-fem is not > 0 (i.e., it equals 0) and this is the first year that the population hit zero (previous year pop size, Nt-1-2000, will be greater than 0) then set extinction time to this year [set extinctime-2 sim-year] ] set Nt-1-1000 #adult-fem-1000 set Nt-1-2000 #adult-fem-2000 if #adult-fem > 0 [set avg-lifespan (sum-lifespan / #adult-fem) * seconds-per-tick / 60 / 60 / flt-hrs-per-day] end to write-output ;;write output to file ifelse behaviorspace-run-number > 0 [file-open (word file-name "-output-BS.txt") ifelse env-stoch? = "Off" OR env-stoch? = "Correlated" [file-type behaviorspace-run-number file-write sim-year file-write landscape-file file-write years-to-sim file-write env-stoch? file-write env-stoch-std file-write carry-cap file-write mn-p-recruit file-write #host-patches file-write dist file-write yr-env-stoch file-write #adult-fem-1000 file-write ln-growth-1 file-write tot-nests-1000 file-write tot-eggs-1000 file-write #recruit-1000 file-write avg-lifespan file-write avg-1000-resid-time file-write avg-patch-time-1000 file-write #adult-fem-2000 file-write ln-growth-2 file-write tot-nests-2000 file-write tot-eggs-2000 file-write #recruit-2000 file-write avg-2000-resid-time file-write avg-patch-time-2000 file-type " " file-print list-patch-pop] [file-type behaviorspace-run-number file-write sim-year file-write landscape-file file-write years-to-sim file-write env-stoch? file-write "mixed" file-write carry-cap file-write mn-p-recruit file-write #host-patches file-write dist file-write "mixed" file-write #adult-fem-1000 file-write ln-growth-1 file-write tot-nests-1000 file-write tot-eggs-1000 file-write #recruit-1000 file-write avg-lifespan file-write avg-1000-resid-time file-write avg-patch-time-1000 file-write #adult-fem-2000 file-write ln-growth-2 file-write tot-nests-2000 file-write tot-eggs-2000 file-write #recruit-2000 file-write avg-2000-resid-time file-write avg-patch-time-2000 file-write list-patch-pop file-type " " file-print list-p-env-stoch] file-close ] [file-open (word file-name "-output.txt") ifelse env-stoch? = "Off" OR env-stoch? = "Correlated" [file-type sim-year file-write landscape-file file-write years-to-sim file-write env-stoch? file-write env-stoch-std file-write carry-cap file-write mn-p-recruit file-write #host-patches file-write dist file-write yr-env-stoch file-write #adult-fem-1000 file-write ln-growth-1 file-write tot-nests-1000 file-write tot-eggs-1000 file-write #recruit-1000 file-write avg-lifespan file-write avg-1000-resid-time file-write avg-patch-time-1000 file-write #adult-fem-2000 file-write ln-growth-2 file-write tot-nests-2000 file-write tot-eggs-2000 file-write #recruit-2000 file-write avg-2000-resid-time file-write avg-patch-time-2000 file-type " " file-print list-patch-pop] [file-type sim-year file-write landscape-file file-write years-to-sim file-write env-stoch? file-write env-stoch-std file-write carry-cap file-write mn-p-recruit file-write #host-patches file-write dist file-write "mixed" file-write #adult-fem-1000 file-write ln-growth-1 file-write tot-nests-1000 file-write tot-eggs-1000 file-write #recruit-1000 file-write avg-lifespan file-write avg-1000-resid-time file-write avg-patch-time-1000 file-write #adult-fem-2000 file-write ln-growth-2 file-write tot-nests-2000 file-write tot-eggs-2000 file-write #recruit-2000 file-write avg-2000-resid-time file-write avg-patch-time-2000 file-write list-patch-pop file-type " " file-print list-p-env-stoch] file-close ] set list-patch-pop [] end to emerge ;;larvae emerge as adults ask larvae [set breed adults] ask adults [setup-adults] set #adult-fem count adults set #adult-fem-1000 count adults with [orig-colony = 1000] set #adult-fem-2000 count adults with [orig-colony = 2000] set list-patch-pop [] let j 1000 let k 100 let i 1 repeat #colonies [repeat #host-patches [let ptch j + i set list-patch-pop lput count adults with [orig-patch = ptch] list-patch-pop set i i + 1 ] set j j + 1000 set i 1 ] end to reset-totals set sim-day 1 set total-eggs 0 set tot-eggs-1000 0 set tot-eggs-2000 0 set total-nests 0 set tot-nests-1000 0 set tot-nests-2000 0 set resid-time-1000 0 set resid-time-2000 0 set avg-1000-resid-time 0 set avg-2000-resid-time 0 set patch-time-1000 0 set patch-time-2000 0 set avg-patch-time-1000 0 set avg-patch-time-2000 0 set sum-lifespan 0 set yr-env-stoch 0 set list-p-env-stoch [] end @#$#@#$#@ GRAPHICS-WINDOW 586 10 1280 1137 -1 -1 1.0 1 10 1 1 1 0 0 0 1 0 683 -1095 0 1 1 1 ticks 30.0 BUTTON 162 11 226 44 Setup setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 306 13 369 46 Go go T 1 T OBSERVER NIL NIL NIL NIL 1 INPUTBOX 9 59 99 119 seconds-per-tick 15 1 0 Number INPUTBOX 109 60 187 120 flt-hrs-per-day 4 1 0 Number INPUTBOX 197 61 266 121 years-to-sim 10 1 0 Number BUTTON 234 12 298 45 Reset reset NIL 1 T OBSERVER NIL NIL NIL NIL 1 MONITOR 327 332 387 377 # Adults count adults 0 1 11 MONITOR 400 332 514 377 # eggs total-eggs 0 1 11 MONITOR 11 330 68 375 Year sim-year 0 1 11 PLOT 9 380 584 587 Population Size time pop size 0.0 10.0 0.0 10.0 true true "" "" PENS "Mima Mounds (1000)" 1.0 0 -2674135 true "" "plot count adults with [orig-colony = 1000]" "Glacial Heritage (2000)" 1.0 0 -14454117 true "" "plot count adults with [orig-colony = 2000]" MONITOR 77 330 134 375 Day sim-day 0 1 11 INPUTBOX 37 151 127 211 init-adults-1000 75 1 0 Number TEXTBOX 29 136 244 166 Initial number of adults per host patch cell: 11 15.0 1 MONITOR 523 332 580 377 # nests total-nests 0 1 11 CHOOSER 29 227 263 272 landscape-file landscape-file "TCB_Scen1.0b_map.txt" "TCB_Scen2.1b_map.txt" "TCB_Scen2.2b_map.txt" "TCB_Scen2.3b_map.txt" "TCB_Scen2.4b_map.txt" "TCB_Scen2.5b_map.txt" "TCB_Scen3.1b_map.txt" "TCB_Scen3.2b_map.txt" "TCB_Scen3.3b_map.txt" "TCB_Scen3.4b_map.txt" "TCB_Scen3.5b_map.txt" "TCB_Scen4.1b_map.txt" "TCB_Scen4.2b_map.txt" "TCB_Scen4.3b_map.txt" "TCB_Scen4.4b_map.txt" "TCB_Scen4.5b_map.txt" "TCB_Scen5.1b_map.txt" "TCB_Scen5.2b_map.txt" "TCB_Scen5.3b_map.txt" "TCB_Scen5.4b_map.txt" "TCB_Scen5.5b_map.txt" "TCB_Scen6.1b_map.txt" "TCB_Scen6.2b_map.txt" "TCB_Scen6.3b_map.txt" "TCB_Scen6.4b_map.txt" "TCB_Scen6.5b_map.txt" "TCB_Scen7.1b_map.txt" "TCB_Scen7.2b_map.txt" "TCB_Scen7.3b_map.txt" "TCB_Scen7.4b_map.txt" "TCB_Scen7.5b_map.txt" 25 TEXTBOX 53 273 225 315 Note: Setup must be run again after choosing new landscape file 11 15.0 1 INPUTBOX 323 117 404 177 env-stoch-std 0.25 1 0 Number INPUTBOX 133 151 221 211 init-adults-2000 0 1 0 Number SWITCH 434 65 575 98 density-dep? density-dep? 0 1 -1000 INPUTBOX 463 111 550 171 carry-cap 31000 1 0 Number CHOOSER 308 63 419 108 env-stoch? env-stoch? "Off" "Correlated" "Uncorrelated" 2 @#$#@#$#@ ## WHAT IS IT? This model was designed to test how the spatial configuration of restored habitat impacts the population dynamics of a species that undergoes irregular boom-bust population cycles that are exogenously driven. Details of the model structure and output can be found in Himes Boor et al. 2018 (Ecological Applications) along with details about its companion model, in which boom-bust dynamics are driven by endogenous factors (more about the companion model below). This exogenous model and its companion endogenous model were designed specifically to simulated Taylor's checkerspot butterflies (TCB) at Mima Mounds Natural Area Preserve and Glacial Heritage Preserve in western Washington state south of Puget Sound where TCB habitat restoration is underway or will be undertaken in the future. Although data are limited, TCB appear to exhibit boom-bust population dynamics, but the cause of these fluctuations (exogenous vs. endogenous, or both) is currently unknown. The questions addressed by this model and its companion model are: 1) Does the mechanism underlying these boom-bust dynamics matter for designing restoration for the species? 2) What is the spatial configuration of restoration that will most benefit boom-bust populations regardless of the mechanism underlying the boom-bust dynamics? This exogenous model was designed to simulate a population with abrupt density dependence imposed at a population ceiling (the simplest form of density dependence). The driver of population fluctuations in this model is random environmental variation in the height of the ceiling. Unlike in the endogenous model, in this model we did not model the interaction between Taylor’s checkerspot and its host plants. ## HOW IT WORKS The landscape consists of 5 habitat types: host plants (restored areas - red), nectar field (yellow), field (light green), exurban (brown), and forest (dark green). Adult butterflies move around this landscape (with different movement characteristics in each of the habitat types) during the adult flight period. As they move and rest, they can also oviposit eggs if they are within host plant habitat. During each time step, after having the opporutnity to move, rest, and oviposit, adults either survive until the next time step or die, based on per-time-step surival probability. Once all adults have died in a given flight period, the oviposited eggs are subject to egg survival probability, then those that survive are subject to pre- and post-diapause survival. If they make it all the way through those life stages (that occur instaneously in the model), they become adults. If the resulting adult count exceeds the ceiling (carrying capacity * environmental stochasticity factor), the adult population is reduced to the ceiling; otherwise, the number of adults proceeding to the adult flight period remains unchanged. In contrast to the compaion endogenous model, there is not any interaction between host plants and butterflies except that oviposition can only occur within host plant patches. ## HOW TO USE IT The user can vary the configuration of restored host plant patches in each area (Mima Mounds and Glacial Heritage) by choosing different landscape files on the user interface and then re-running Setup. Each landscape file is titled "TCB_Scen#.#b_map.txt" with the #-symbols replaced by real numbers indicating the configurtion of restored area. The first number (before the decimal) is an index number indicating how many patches comprise the total restored area: 1 = 1 patch (total area 1.44ha) 2 = 2 patches (total area 1.44ha) 3 = 4 patches (total area 1.44ha) 4 = 6 patches (total area 1.5ha) 5 = 8 patches (total area 1.6ha) 6 = 6 patches (total area 1.44ha) 7 = 8 patches (total area 1.44ha). Note: Scenarios 4 & 5 were not used for Himes Boor et al. 2018 (Ecological Applications) since the total area in these scenarios was not the same as the others). The second number in the landscape file name (after the decimal) indicates the distance between patches. 1 = 20m 2 = 50m 3 = 100m 4 = 200m 5 = 400m For example, the landscape file, TCB_Scen3.5_map.txt, will have 4 restored habitat patches spaced at 400m apart. Each pixel in the landscape file represents 10m x 10m. On the user Interface, the user can vary the initial density of butterflies per pixel at each site ("init-adults-1000" - Mima Mounds; "init-adults-2000" - Glacial Heritage), as well as the carrying capacity (or population ceiling) of the restored host patches at a given site ("carry-cap"). The "env-stoch?" chooser allows the user to turn environmental stochasticity off such that the population ceiling will remain at the number of individuals set under "carry-cap" and will not fluctuate year to year. If the user instead chooses "Correlated" environmental stochasticity, all patches at a site will be subject to the same stochasticity factor in a given year ("carry-cap" * env-stoch factor divided by the number of patches at the site). If the user chooses "Uncorrelated" stochasticity, a different stochasticity factor will be applied to each patch each year, such that stochasticity is uncorrelated among patches in a given year. The "env-stoch-std" variable dictates the level of stochasticity to be applied. Specifically it controls the standard deviation of the zero-mean Normal distribution from which the environmental stochasticity factor(s) is(are) drawn. Finally, the user can choose to turn off density dependence all together so that no population ceiling is enforced and the population can grow indefinitely ("density-dep?"). The output plot shows the number of adult butterflies on the landscape at any given time during the adult flight period, with the peaks of the plotted line representing the number of adults initially present after the pre- and post-diapause larval stage. The maximum length of the adult flight period is 4 weeks; if adults are still alive at 4 weeks, all remaining adults die, and the egg and larval survival rates are applied to the eggs to produce the next crop of adults for the following year. The "# eggs" monitor will update as adults oviposit eggs throughout the flight period, and will be reset to zero once egg and larval survival are applied. Note that in this model, unlike the endogenous companion model, the code is written so that it knows whether it is being run via Behavior Space or just from the user Interface, so there is no switch on the Interface for the Behavior Space option. ## THINGS TO NOTICE Notice if there are any patterns to the booms and busts in this model? Is it similar or different from the boom-bust patterns in the endogenous model? In this model, when density dependence and environmental stochasticty are turned on, you will find that fragmenting the restored host plant habitat reduces the growth rate, as in the endogenous model, but that the lower growth rate does not confer any advantage to the population through stabilization. As might be expected, fragmentation actually increases the population size variability and lowers the mean population size over time. Depending on the level of stochasticity and the level of patchiness, it can also increase the extinction risk. ## RELATED MODELS As noted above, a companion endogenous model was developed and output from this exogenous model can be compared to the output from the endogenous model to address the question posed above in the "What Is It?" section. The endogenous model explicitly models consumer-resource dynamics by simulating post-diapause larval consumption of host plants, followed by adult oviposition on host plants, but the number of eggs allowed to be oviposited per host plant is restricted by a "carrying capacity". Thus, if the population grows so large that post-diapause larvae consume most or all of the available host plants, there will be no place for adults to oviposit eggs and the population will crash. The spatial configuration of host patches has very different consequences for the Taylor's checkerspot populations under this endogenously driven boom-bust dynamics than it does under exogenously driven dynamics. The endogenous companion model is called HimesBoor_EcAp_TCB_Endog.nlogo and is also described in Himes Boor et al. 2018 (Ecological Applications). ## CREDITS AND REFERENCES This model code was developed by Dr. Gina Himes Boor at Duke University and Montana State University, with input and data from Drs. William Morris, Cheryl Schultz, and Elizabeth Crone. This work was funded by a grant from the Department of Defense Strategic Environmental Research and Development Program, RC-2119 to E.E. Crone, C.B. Schultz, and W.F. Morris. Results of this and the companion model can be found in: Himes Boor, G.K., C.B. Schultz, E.E. Crone, and W.F. Morris. 2018. Mechanism matters: the cause of fluctuations in boom-bust populations governs optimal habitat restoration strategy. Ecological Applications @#$#@#$#@ 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 caterpillar true 0 Polygon -7500403 true true 165 210 165 225 135 255 105 270 90 270 75 255 75 240 90 210 120 195 135 165 165 135 165 105 150 75 150 60 135 60 120 45 120 30 135 15 150 15 180 30 180 45 195 45 210 60 225 105 225 135 210 150 210 165 195 195 180 210 Line -16777216 false 135 255 90 210 Line -16777216 false 165 225 120 195 Line -16777216 false 135 165 180 210 Line -16777216 false 150 150 201 186 Line -16777216 false 165 135 210 150 Line -16777216 false 165 120 225 120 Line -16777216 false 165 106 221 90 Line -16777216 false 157 91 210 60 Line -16777216 false 150 60 180 45 Line -16777216 false 120 30 96 26 Line -16777216 false 124 0 135 15 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.1 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup if behaviorspace-run-number = 1 [write-output-header] go setup if behaviorspace-run-number = 1 [write-output-header] go count turtles setup set file-name "TCB_ExogDD_SEIBM_1.2-map1" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_ExogDD_SEIBM_1.2-test1" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_ExogDD_SEIBM_1.2-map2" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_ExogDD_SEIBM_1.2-map3" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_ExogDD_SEIBM_1.2-map4" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_ExogDD_SEIBM_1.2-map5" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_ExogDD_SEIBM_1.2-map6" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_ExogDD_SEIBM_1.2-map7" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.3-2" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.3-3" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.3-4" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.3-5" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.3-6" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.3-7" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.3-6x" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.4-2" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.4-3" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.4-4" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.4-5" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.4-6" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 setup set file-name "TCB_Exog_Uncor_1.4-7" if behaviorspace-run-number = 1 [write-output-header] go mn-grow-1 var-grow-1 extinctime-1 @#$#@#$#@ @#$#@#$#@ 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 @#$#@#$#@