Lotka-Volterra competition approximation
No preview image
Model was written in NetLogo 6.0.4
•
Viewed 126 times
•
Downloaded 22 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
globals [open_space] patches-own [sp1_K sp2_K open?] turtles-own [sp my_K my_r] to Setup clear-all crt N10 [set sp 1 set color blue set my_K K set my_r r set shape "circle" set size (2.5 / K) move-to one-of patches] crt N20 [set sp 2 set color red set my_K K2 set my_r r2 set shape "circle" set size (2.5 / K2) move-to one-of patches] ask patches [update-patches] set open_space 1 reset-ticks end to Go reproduce ask patches [update-patches] set open_space 1 - (count turtles / (K * count patches)) ask n-of (0.05 * count patches) patches [ask turtles-here [die]] tick end to reproduce ask turtles [if random-float 1 < my_r [if any? patches with [open? = 1] [hatch 1 [migrate]]]] end to migrate carefully [move-to one-of patches with [open? = 1] update-patches] [die] ;move-to one-of patches ifelse open? = 1 [update-patches] [die] end to update-patches ;; Patch context only calculate_Ks carefully [ask one-of turtles-here [ifelse sp = 1 [if sp1_K < 0 [die]] [if sp2_K < 0 [die]]]] [] calculate_Ks ;;carefully [ask one-of turtles-here [ifelse sp = 1 [if sp1_K < 0 [die]] [if sp2_K < 0 [die]]]] [] ;calculate_Ks ;carefully [ask one-of turtles-here [ifelse sp = 1 [if sp1_K < 0 [die]] [if sp2_K < 0 [die]]]] [] ;ifelse count turtles-here > K [set open? 0 set pcolor 0 ask one-of turtles-here [die]] [set open? 1 set pcolor 9.9] end to calculate_Ks set sp1_K (K - count turtles-here with [sp = 1] - (alpha * (count turtles-here with [sp = 2]))) set sp2_K (K2 - count turtles-here with [sp = 2] - (beta * (count turtles-here with [sp = 1]))) ;ifelse sp1_K * sp2_K > 0 and ifelse sp1_K + sp2_K < 0 [set open? 0] [set open? 1] end ;to update-cells? ;; ask turtles [ifelse cell_type = 0 [set color red set color lput (opacity * 250) extract-rgb color] ; [set color blue set color lput (opacity * 250) extract-rgb color]] ; ask turtles [set size cell_size] ;end
There are 3 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Screen Shot 2020-10-08 at 10.59.48 AM.png | png | Preview | about 4 years ago, by William Driscoll | Download |
This model does not have any ancestors.
This model does not have any descendants.