Unified Forest Dynamic Model
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
According to Gauss competitive exclusion principle (Gauss, 1932) two species cannot exist in a same environment. However, thousands of species found coexists in tropical forests. This model discribes combined Hubbell's (2001) neutral model with non-neutral processes (e.g. disturbances, intra-specific competition, negative density dependence, demographic-trade offs (e.g. shade tolerance and shade intolerance) etc. see Wright, 2002) to explains the two macro-ecological patterns, species abundance distribution (SAD) and species area relationship (SAR). The model consists of two parts.
Meta-community
Meta-community (size JM) is very large compared to local community (size JL). Meta-community is saturated. That is there is no vacant sites (space). Meta-community has demographic fluctuations (stochastic drift). This is one of the main assumptions of neutral theroy. Trees dies and rebirth every time step. It has also mechanisam called speciation. Speciation allows new species to appear. When a tree dies the vacant space is occupied by offsprings of a randomly selected individual or from a new species (speciation is a rare event. Probability of happening that event is very very small). Number of species in the meta community depends on the fundemental bio-diversity number (theta) and the meta-community size (JM). Species are generated at the beginning using the Hubbell's (2001) species generating flow chart (pg. 291). Each species has Ji number of individuals.
Local community
Local community has demographic fluctuations (death and birth of trees). Local community is saturated. That is there is no vacant sites (space). This is one of the main assumptions of neutral theroy. Original version of the Hubbell's neutral model assumes single death in each time steps. When a tree dies randomly the vacant space is occupied by a offspring of a randomly selected individual. This randomly selected individual is either from a local community or meta-community. If its from meta-community then offspring immigrates from meta-community to local community to occupy the vacant site. If there is no immigration (m = 0) local community undergoes mono-dominance (all the sites occupied by one species). Therefore to maintain the species diversity immigration is necessary. Local community has S number of species. Species are generated at the beginning using the Hubbell's (2001) species generating flow chart (pg. 291). Number of species in the local community depends on the fundemental bio-diversity number (theta2) and the local community size (JL). Each species has Ji number of individuals.
HOW IT WORKS
Each agent has a properties called 'species, species-trait'. Species have different colors. When an agent dies an offspring of an randomly selected agent is occupied that empty space. Only agent exists in a patch.
(1) Meta-community: When an agent dies the vacant space is occupied by offsprings of a randomly selected agent or from a new type of agent (probailities are 1-v and v respectively).
(2) Local community: When an agent dies randomly the vacant space is occupied by a offspring of a randomly selected agent. This randomly selected agent is either from a local community or meta-community (probabilites are 1-m and m respectively). If its from meta-community then offspring agent immigrates from meta-community to local community to occupy the vacant site.
Maximum number of conspecific trees that can be allowed to exists around focal tree within a certain radius (called 'crowd-radius') from a focal tree for a minimal stable system is called 'conspeciifc-crowd'. Conspecific-crowd can be used to find the maximum proportion of conspecific trees that can be allowed to exists around a focal tree within crowd-radius from the focal tree. This is called 'conspecific-density' around a focal tree.
Trees die not fully randomly (not a fully stochastic model). Each time step tree in a patch is randomly selected. If number of conspecific trees within crowd-radius around the randomly selected tree exceeds conspecific-crowd then tree dies and patch is vacant. The vacant patch is replaced by a offspring of a randomly selected existing individual.
If the species have no dispersal limitation then offspring of a any individual can come to the vacant site. If species have dispersal limitation then an offspring can come to the vacant site only if the vacant patch is inside radius of the dispersal limitation of its parent.
Local community may undergoes disturbances due to tree falls. Tree fall gaps can be vary (called Disturbance-Size). The frequency of tree falls can be also vary (called Disturbance-rate-per-year). If trees fall and gap created then offsprings of randomly selected individuals come into vacant patches.
However, if shade tolerance and shade intolerance mechanisms exist then individuals from shade intolerance species within dispersal radius come to vacant sites.
HOW TO USE IT
Sliders
- w1: Used to change meta-community size. JM = (w1+1)2
- w2: Used to change the local community size. JL = (w2+1)2
- theta: Fundamental biodiversity numbers used for meta-community.
- theta2: Fundamental biodiversity numbers used for local-community.
- immigration-rate: Used to control the immigration rate (0-1).
- D: Used to defines the number of death per each time step in the local community. Hubbell's (2001) original model D = 1. Here it can takes any value from 1 to JL.
- speciation-initiation-rate: Defines the speciation rate in the Hubbell's (2001) model. Hubbell used Wright-Fisher equation to define the point mutation speciation. In this model it has additional three additional switches (off-on) that used to set the speciation rates according to either Hubbell (2001) or Moran or Etinne-Alonso-Hubbell.
- tau-protracted: Hubbell (2001) used only point mutation (instant specitation). However, this model has an slider called tau-protracted to shift from Hubbell's (2001) point mutation to Rosindell et al. protracted speciation. When tau-protracted is 0 it is Hubbell's instant point speciation, else it is protracted speciaiton (Rosindell et al. 2010).
- Equilibrium-run: use to decide the number of runs before stop the process.
- dispersal-radius: Use to decide the maximum radius offspring of an individual can move.
- Disturbance-rate-per-year: Number of disturbance cycles per year.
- Disturbance-Size: Number of patches vacant after a disturbance.
- conspecific-crowd: Maximum number of conspecific individuals exists around a focal tree within a radius called 'crowd-radius'.
- crowd-radius: Radius around focal tree.
Switches
- graphic?: switch is used to switch on-off graphics. Off graphics? speeds the process.
- Moran?: J2M. v
- Etienne-Alonso-Hubbell?: theta = JM.(JM-1). v
- Hubbell-200-Wright-Fisher?: theta = 2.JM. v
- limited-dispersal?: If switch on then then species have limited dispersal else species have no dispersal limitation.
- light-sensitivity?: If switch is on only light-sensitive species come to vacant patches.
- intra-specific-competition?: If switch is on intraspecific competition is presents within the community. Else no intraspecific competition.
- immigration-number?: If switch is on then theta2 = m.JL / (1 - m)
THINGS TO NOTICE
Monitor:
- Meta-community size: Shows the meta-community.
- Protracted Speciation events happened in the meta-community: Shows number of protrated species in the community.
- Point-mutations: Shows number of point mutations.
- Total number of deaths in the local community: Shows total number of deaths in the local community. Equals to number of ticks in netlogo.
- Meta-community species richness at time t = 0: Shows initial species richness in the meta-community.
- Meta-community species richness at time t = t: Shows the current species richness in the meta-community.
- Number of species appeared in the meta-community t = 0 to t = t: Total number of new species appeared in the meta-community.
- Effective-meta-community size: See Etienne and Alonso (2007).
- JL: Current local community size.
- JM: Current meta-community size.
- Number of temporal extinct species in the meta-community: Number of species temporally extinct from local community. Temporal extinction happens only if immigration rate is non-zero. Otherwise it is shows number permenant extinct species.
- Shade-tolerant-species: Number of shade tolerant species presents in the community.
- Shade-intolerant-species: Number of shade intolerant species presents in the community.
- Conspecifics density: Proportion of conspecifics within a crowd-radius.
Plots:
- Total speciation events happen in the meta-community: Cumulative function of speciations over time.
- Meta-community species richness: Number of meta-community species presents over time.
- Local community species richness: Number of local community species presents over time.
- Incipient species in the meta-community: "During the transition period of a lineage undergoing protracted speciation, the individuals of this lineage are interpreted as an incipient species (Rosindell et al., 2010)"
- Generic-tree meta-community: Similar to meta-community pylogenetic tree that also includes extinct lineages.
- Generic-tree local community: Similar to local-community pylogenetic tree that also includes extinct lineages.
- Species Abundance Distribution meta-community: Meta-community species abundance fluctuations.
- Species Abundance Distribution local community: Local-community species abundance fluctuations.
- Number of extinct species from local-community: Cumulative distribution of temporaly extinct species from local-community.
- Relative Species Abundance Meta Community: Species abundance (J) / Meta-community size (JM).
- Species Abundance Distribution of Meta-Community: Number of individuals from each species in the meta-community sorted.
- Number of extinct species from meta-community: Cumulative distribution of permenantly extinct species from meta-community.
- Relative Species Abundance Local Community: Species abundance (J) / Local-community size (JL).
- Species Abundance Distribution of Local-Community: Number of individuals from each species in the local community sorted.
THINGS TO TRY
- Move sliders w1 and w2 to change the meta and local community size.
- Move sliders theta and theta2 to change the fundamental Biodiversity number for meta and local community.
- Move slider immigration-rate to change the immigration rate (0-1).
- speciation-initiation-rate is determine by one of the swithces (Moran, Hubbell-2001-Wright-Fisher, Etienne-Alonso-Hubbell) usually. Off three swiches to change the speciation-initiation-rate user defines values.
- Off the switches dispersal-limitation, light-sensitivity, intra-specific competition then the model becomes a fully neutral model (i.e. Hubbell's 2001 model)
EXTENDING THE MODEL
Model can in corperate many othe non-random processes (e.g. inter-specific competition, Forest fires, Pathegons and herbivores effects, seed dispersal syndrome, habitat association of species) to increase the complexity of the model.
NETLOGO FEATURES
RELATED MODELS
Gause, G. F. (1932). "Experimental studies on the struggle for existence: 1. Mixed population of two species of yeast". Journal of Experimental Biology, 9: 389–402.
Moran, P. A. P. (1958). Random processes in genetics. Proceedings of the Cambridge Philosophical Society, 54: 28 60-71.
Ewens, W. J. (1972). The sampling theory of selectively neutral alleles. Theoretical Population Biology, 3: 87-112.
Connell, J. H. (1978). "Diversity in Tropical Rain Forests and Coral Reefs". Science, 199(4335): 1302–10.
Kimura, M. (1983). The Neutral Theory of Molecular Evolution. Cambridge, UK: Cambridge University Press.
Hubbell, S. P. (1979). Tree Dispersion, Abundance, and Diversity in a Tropical Dry Forest: That tropical trees are clumped, not spaced, alters conceptions of the organization and dynamics. Science, 203(4387), 1299–1309.
Hubbell, S. P. (1997). A unified theory of biogeography and relative species abundance and its application to tropical rain forests and coral reefs. Coral Reefs 16:S9–S21.
Hubbell, S. P. (2001). The Unified Neutral Theory of Biodiversity and Biogeography. Princeton, NJ: Princeton University Press.
Wright, J. S. (2002). Plant diversity in tropical forests: A review of mechanisms of species coexistence. Oecologia, 130(1), 1–14.
Etienne, R. S., & Alonso, D. (2007). Neutral Community Theory: How Stochasticity and Dispersal-Limitation Can Explain Species Coexistence. Journal of Statistical Physics, 128(1–2), 485–510.
Comita, L. S., & Hubbell, S. P. (2009). Local neighborhood and species’ shade tolerance influence survival in a diverse seedling bank. Ecology, 90(2), 328–334.
Rosindell, J., Cornell, S. J., Hubbell, S. P., & Etienne, R. S. (2010). Protracted speciation revitalizes the neutral theory of biodiversity. Ecology Letters, 13(6), 716-727.
Bagchi, R., Henrys, P. A., Brown, P. E., Burslem, D. F. R. P., Diggle, P. J., Gunatilleke, C. V. S., Gunatilleke, I. A. U. N., Kassim, A. R., Law, R., Noor, S., & Valencia, R. L. (2011). Spatial patterns reveal negative density dependence and habitat associations in tropical trees. Ecology, 92(9), 1723–1729.
CREDITS AND REFERENCES
For the model itself:
- Punchi-Manage, R. (2023b). NetLogo Unified Neutral Non-Neutral Model. http://netlogo/models/Unified-Neutral-Non-Neutral-Model.
Please cite the NetLogo software as:
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
Comments and Questions
extensions [table csv] globals [index meta-sp meta-time meta-a0 meta-j2 meta-a meta-set2 extinct-species number-of-meta-trees a initial-meta-richness random-number2 number time num j x-cor y-cor N richness a0 n-speciation local-set local-di-set local-off-set set-species-who-di set-species-who-off sp hist-frq rel-hist-frq s local-set0 remove-set richness-counts species-who-di di-locx di-locy species-who-off set1-species-who-off meta-set effective-meta-cmmunity-size number-of-local-trees item-x meta-set-new meta-sp-count sp-count j1 i1 k1 j2 i2 k2 meta-richness-counts meta-richness local-richness-counts local-richness hist-frq-meta rel-hist-frq-meta hist-frq-local rel-hist-frq-local neighbor-patch species0 neighbor-tree conspecifics species2 neighboring-tree specs time-spent-list abundance-list mean-time-spent mean-life-comm data extinct-species-meta] breed [meta-trees meta-tree] breed [trees tree] meta-trees-own [meta-species n-speciation-no species-trait time-system] trees-own [species h species-trait time-system] circles-own [] breed [circles a-circle] patches-own[occupied dis-patch] to setup2 clear-all ask patches [ set pcolor black set occupied 0 ] set meta-richness-counts map count table:values table:group-agents meta-trees [meta-species] set meta-richness length meta-richness-counts set n-speciation 0 set meta-set[] set meta-sp 0 set data [] set JM (w1 + 1) * (w1 + 1) resize-world 0 (w1 + w2 + 20) 0 (w1 + w2 + 20) if (Hubbell-2001-Wright-Fisher? = true) [ set speciation-rate theta / (2 * JM) set effective-meta-cmmunity-size JM] if (Moran? = true) [ set speciation-rate theta / JM set effective-meta-cmmunity-size JM ^ 2 / 2] if (Etinne-Alonso-Hubbell?) [ set speciation-rate theta / (theta + JM - 1) set effective-meta-cmmunity-size JM * (JM - 1) / 2] ;if (file-exists? "parent-species-speciation-species-time.csv") [ ;carefully ;[file-delete "parent-species-speciation-species-time.csv"] ;[print error-message] ;] ;file-open "parent-species-speciation-species-time.csv" ;file-close ;if (file-exists? "Meta-Community-extinction-species-time.csv") [ ;carefully ;[file-delete "Meta-Community-extinction-species-time.csv"] ;[print error-message] ;] ;file-open "Meta-Community-extinction-species-time.csv" ;file-close species-gen1 set hist-frq-meta sort-by > map count table:values table:group-agents meta-trees [meta-species] set rel-hist-frq-meta map [i -> i / JM] hist-frq-meta set meta-time 0 set meta-a0 1 set n-speciation 0 set extinct-species-meta 0 set meta-j2 2 set meta-a JM set a JL set sp 0 set JL (w2 + 1) * (w2 + 1) if (Immigration-number? = True) [ set theta2 immigration-rate * JL / (1 - immigration-rate) ] species-gen2 set extinct-species 0 set hist-frq-local sort-by > map count table:values table:group-agents trees [species] set rel-hist-frq-local map [i -> i / JL] hist-frq-local ;if (file-exists? "Local-Extinction-Species-Extinction-Time.csv") ;[ ;carefully [ ;file-delete "Local-Extinction-Species-Extinction-Time.csv" ;] ;[ ;print error-message ;] ;] ;file-open "Local-Extinction-Species-Extinction-Time.csv" ;file-close create-channel reset-ticks end to species-gen1 set k1 -1 while [k1 < w1 ] [ set k1 k1 + 1 set i1 -1 while [i1 < w1 ] [ set i1 i1 + 1 let random-patch one-of patches with [pycor <= w1 AND pycor >= 0 AND pxcor >= 0 AND pxcor <= w1 AND occupied = 0] create-meta-trees 1 [ setxy [pxcor] of random-patch [pycor] of random-patch set shape "circle" set size 1 set num random-float 1 set j1 j1 + 1 set species-trait random 2 if-else (num < (theta / (theta + j1 - 1 ))) [ set meta-sp meta-sp + 1 set meta-species meta-sp set color 0.5 * meta-species ] [ set meta-species [meta-species] of one-of other meta-trees set meta-sp meta-sp set color 0.5 * meta-species ] ;file-open "Metacommunityset.csv" ;file-print (meta-species) ;file-close ] ask patches [ if-else (count turtles-here > 0) [ set occupied 1 ] [ set occupied 0 ] ] set initial-meta-richness meta-sp ] ] end to species-gen2 set k2 -1 while [k2 < w2 ] [ set k2 k2 + 1 set i2 max-pxcor + 1 while [i2 <= max-pxcor + 1 AND i2 >= max-pxcor - w2 + 1] [ let random-patch one-of patches with [pycor <= max-pycor AND pycor > max-pycor - w2 - 1 AND pxcor >= 0 AND pxcor <= w2 AND occupied = 0] set i2 i2 - 1 create-trees 1 [ set h s + 1 setxy [pxcor] of random-patch [pycor] of random-patch set shape "circle" set size 1 set num random-float 1 set j2 j2 + 1 set species-trait random 2 if-else (num < (theta2 / (theta2 + j2 - 1 ))) [ set sp sp + 1 set species sp set color 5 * species + 2] [ set species [species] of one-of other trees set sp sp set color 5 * species + 2 ] ] ask patches [ if-else (count turtles-here > 0)[ set occupied 1 ] [ set occupied 0 ] ] ] ] set local-richness sp end to go2 set hist-frq-meta sort-by > map count table:values table:group-agents meta-trees [ meta-species ] set rel-hist-frq-meta map [ i -> i / JM ] hist-frq-meta forest-die-regenerate2 ask patches [ if-else (count turtles-here > 0) [ set occupied 1 ] [ set occupied 0 ] ] count-down set hist-frq-local sort-by > map count table:values table:group-agents trees [ species ] set rel-hist-frq-local map [ i -> i / JL ] hist-frq-local neut-death-birth let disturbance-rate random-float 1 if (disturbance-rate-per-year <= disturbance-rate) [ tree-falls-gaps ] forest-die4 forest-regenerate4 if-else (graphics? = true) [ update-plot1 update-plots plot-genetic-tree-Meta-Community update-plots update-plot2 update-plots plot-genetic-tree-Local-Community update-plots ] [ ] if (count trees <= Disturbance-Size) [ stop ] time-spent-system update-plot9 update-plot10 tick end to forest-die-regenerate2 set N count meta-trees set meta-richness-counts map count table:values table:group-agents meta-trees [meta-species] set meta-richness length meta-richness-counts ask one-of meta-trees [ set x-cor xcor set y-cor ycor set meta-species meta-species let meta-species0 meta-species set number-of-meta-trees count meta-trees with [meta-species = meta-species0] if (number-of-meta-trees = 1)[ set extinct-species-meta extinct-species-meta + 1 ;file-open "Meta-Community-extinction-species-time.csv" ;file-write (meta-species) ;file-write (ticks) ;file-print "" ;file-close ] die ] set random-number2 random-float 1 if-else (random-number2 > speciation-rate) [ ask one-of meta-trees [ hatch 1 setxy x-cor y-cor ] ] [ speciation ] end to count-down set time time + 1 end to speciation if (random-number2 <= speciation-rate) [ set n-speciation n-speciation + 1 set meta-sp meta-sp + 1 ask one-of meta-trees [ let parent-of-speciation meta-species hatch 1 ;set time-system time-system + 1 set n-speciation-no n-speciation set meta-j2 meta-j2 + 1 set meta-species meta-sp set color 0.5 * (a0 + 1 + meta-j2) setxy x-cor y-cor ;file-open "parent-species-speciation-species-time.csv" ;file-write (parent-of-speciation) ;file-write (meta-species) ;file-write (ticks) ;file-print "" ;file-close ] ] end to forest-die4 set N count trees count-down set remove-set [ ] set local-richness-counts map count table:values table:group-agents trees [ species ] set local-richness length local-richness-counts if-else (intra-specific-competition? = true) [ ask one-of trees [ set species species set species0 species set number-of-local-trees count trees with [species = species0] if (number-of-local-trees = 1)[ set extinct-species extinct-species + 1 ;file-open "Local-Extinction-Species-Extinction-Time.csv" ;file-write (species0) ;file-write (ticks) ;file-print "" ;file-close ] set conspecifics count trees in-radius crowd-radius with [species = species0] if (conspecifics >= conspecific-crowd) [ set di-locx xcor set di-locy ycor die ] ] ] [ ] end to forest-regenerate4 if (conspecifics >= conspecific-crowd) [ if-else (limited-dispersal? = false) [ ask one-of trees with [species != species0] [ set time-system time-system + 1 hatch 1 set h a setxy di-locx di-locy ] ] [ ask patches with [pxcor = di-locx AND pycor = di-locy] [set neighbor-tree one-of trees in-radius dispersal-radius ] ask neighbor-tree [ hatch 1 setxy di-locx di-locy ] ] ] end to tree-falls-gaps if (Disturbance-Size = 1) [ let disturbance-patch one-of patches with [count trees-here >= 1 AND dis-patch = 0 AND pycor <= max-pycor - 1 AND pycor > max-pycor - w2 AND pxcor >= 1 AND pxcor <= w2 - 1] ask disturbance-patch [ set dis-patch 1 ] ask trees-on disturbance-patch [ die ] ask disturbance-patch [ set occupied 0 ] if (Disturbance-Size > 1) [ repeat Disturbance-Size - 1 [ ask disturbance-patch [ let neighboring-patch one-of neighbors with [occupied = 1 AND pycor <= max-pycor AND pycor > max-pycor - w2 - 1 AND pxcor >= 0 AND pxcor <= w2] ask neighboring-patch [ ask trees-here [ die ] set dis-patch 1 set occupied 0 ] ] ] ] if-else (light-sensitivity = true) [ repeat Disturbance-Size [ let non-empty-patch one-of patches with [count trees-here > 1 AND pycor <= max-pycor AND pycor > max-pycor - w2 - 1 AND pxcor >= 0 AND pxcor <= w2] let empty-patch one-of patches with [count trees-here = 0 AND dis-patch = 1 AND pycor <= max-pycor AND pycor > max-pycor - w2 - 1 AND pxcor >= 0 AND pxcor <= w2] ask empty-patch [ set neighboring-tree one-of trees with [species-trait = 1] in-radius dispersal-radius if-else (neighboring-tree = true) [ ask neighboring-tree [ hatch 1 [ ;set time-system time-system + 1 setxy [pxcor] of empty-patch [pycor] of empty-patch ] ] ] [ set neighboring-tree one-of trees in-radius dispersal-radius ask neighboring-tree [ hatch 1 [ setxy [pxcor] of empty-patch [pycor] of empty-patch ] ] ] set dis-patch 0 set occupied 1 ] ] ] [repeat Disturbance-Size [ let non-empty-patch one-of patches with [count trees-here > 1 AND pycor <= max-pycor AND pycor > max-pycor - w2 - 1 AND pxcor >= 0 AND pxcor <= w2] let empty-patch one-of patches with [count trees-here = 0 AND dis-patch = 1 AND pycor <= max-pycor AND pycor > max-pycor - w2 - 1 AND pxcor >= 0 AND pxcor <= w2] ask one-of trees [ hatch 1 [ setxy [pxcor] of empty-patch [pycor] of empty-patch ] ] ask empty-patch [ set dis-patch 0 set occupied 1 ] ] ] ] end to neut-death-birth let rando-patch one-of patches with [pycor <= max-pycor AND pycor > max-pycor - w2 - 1 AND pxcor >= 0 AND pxcor <= w2] ask trees-on rando-patch [ die ] let random-number4 random-float 1 if-else (random-number4 > immigration-rate) [ ask one-of trees [ hatch 1 setxy [pxcor] of rando-patch [pycor] of rando-patch ] ] [ set species2 one-of [meta-species] of meta-trees replace-previous-immigrant move-immigrant immigration-through-channel create-trees 1 [ set species species2 set h a set shape "circle" set size 1 setxy [pxcor] of rando-patch [pycor] of rando-patch ] ] end to update-plot1 set-current-plot "Species Abundance Distribution Meta Community" set n 1 while [n <= meta-sp] [ create-temporary-plot-pen (word n) set-current-plot-pen (word n) set-plot-pen-color 5 * n + 4 plotxy ticks count meta-trees with [meta-species = n] set n n + 1 plot-pen-down ] end to update-plot2 set-current-plot "Species Abundance Distribution Local Community" set n 1 while [n <= sp] [ create-temporary-plot-pen (word n) set-current-plot-pen (word n) set-plot-pen-color 5 * n + 4 plotxy ticks count trees with [species = n] set n n + 1 plot-pen-down ] end to plot-genetic-tree-Meta-Community set meta-sp-count 0 set-current-plot "Generic-Tree Meta Community" while [meta-sp-count <= meta-sp] [ create-temporary-plot-pen (word meta-sp-count) set-current-plot-pen (word meta-sp-count) set-plot-pen-color 5 * meta-sp-count + 4 let N-sp count (meta-trees with [meta-species = meta-sp-count]) if (N-sp > 0) [ plotxy ticks meta-sp-count plot-pen-down ] set meta-sp-count meta-sp-count + 1 ] end to plot-genetic-tree-Local-Community set sp-count 0 set-current-plot "Generic-Tree Local Community" while [sp-count <= sp] [ create-temporary-plot-pen (word sp-count) set-current-plot-pen (word sp-count) set-plot-pen-color 5 * sp-count + 4 let N-sp count (trees with [species = sp-count]) if (N-sp > 0) [ plotxy ticks sp-count plot-pen-down ] set sp-count sp-count + 1 ] end to create-channel ask patches [ if (pxcor > w2 / 2 AND pxcor < ((w2 / 2) + 2) AND pycor > w1 AND pycor < w1 + 20) [ set pcolor gray ] ] end to immigration-through-channel create-circles 1 [ set color ticks set heading 0 set size 1 setxy ((w2 + 2) / 2) (w1 + 1) ] end to move-immigrant ask circles [ fd 4 ] end to replace-previous-immigrant ask circles with [ycor > (w1 + 13)] [ die ] end to time-spent-system ask trees [set time-system time-system + 1] ask meta-trees [set time-system time-system + 1] set specs 0 set time-spent-list [] set abundance-list [] set mean-time-spent [] set mean-life-comm [] set data [] while [specs <= max [species] of trees] [ let time-spent-list0 sum [time-system] of trees with [species = specs] let abundance count trees with [species = specs] set time-spent-list fput time-spent-list0 time-spent-list if (abundance > 0) [ set abundance-list fput abundance abundance-list let mean-time-spent0 time-spent-list0 / abundance set mean-time-spent fput mean-time-spent0 mean-time-spent let data0 (list mean-time-spent0 abundance) set data fput data0 data let mean-life-community mean [time-system] of trees set mean-life-comm n-values 300 [i -> mean-life-community] ] set specs specs + 1 ] end to update-plot9 set-current-plot "Average Life Time Vs. Abundance (Y vs. X)" clear-plot create-temporary-plot-pen (word "pen-0") set-current-plot-pen "pen-0" set-plot-pen-mode 2 foreach data [[pt1] -> plotxy item 1 pt1 item 0 pt1] update-plots end to update-plot10 set-current-plot "Average Life Time Vs. Abundance (Y vs. X)" create-temporary-plot-pen (word "pen-1") set-current-plot-pen "pen-1" set-plot-pen-mode 0 foreach (mean-life-comm) plot update-plots end ; Copyright 2023b Ruwan Punchi-Manage. ; See Info tab for full copyright and license.
There are 2 versions of this model.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.