Interspecific Competition-HNDD

No preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.3.0 • Viewed 71 times • Downloaded 3 times • Run 0 times
Download the 'Interspecific Competition-HNDD' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [J N2 empty-patch-random K1 K2]
breed [species1 a-species1]
breed [species2 a-species2]
turtles-own [species]
patches-own [random-number]

to setup
  clear-all
  set J (w1 + 1) * (w1 + 1)
  resize-world 0 w1 0 w1
  set N2 J - N1
  set K1 N1
  set K2 J - N1
  while [K1 > 0] [
    set empty-patch-random one-of patches with [count turtles-here = 0]
    create-species1 1 [
      setxy [pxcor] of empty-patch-random [pycor] of empty-patch-random
      set species 1
      set size 1
      set shape "circle"
      set color orange
    ]
    set K1 K1 - 1
  ]
  while [K2 > 0] [
    set empty-patch-random one-of patches with [count turtles-here = 0]
    create-species2 1 [
      setxy [pxcor] of empty-patch-random [pycor] of empty-patch-random
      set species 2
      set size 1
      set shape "circle"
      set color blue
    ]
    set K2 K2 - 1
  ]
  reset-ticks
end 

to go
  species1-die
  species2-die
  ask turtles [species-birth]
  update-plots
  tick
end 

to species1-die
  ask species1 [
    let count-neighbors-species1 count species2-on neighbors
    if (count-neighbors-species1 > HND-sp2) [
      die
    ]
  ]
end 

to species2-die
  ask species2 [
    let count-neighbors-species2 count species1-on neighbors
    if (count-neighbors-species2 > HND-sp1) [
      die
    ]
  ]
end 

to species-birth
  let empty-patches count patches with [count turtles-here = 0]
  if (empty-patches > 0) [
    set empty-patch-random one-of patches with [count turtles-here = 0]
    ask empty-patch-random [
      let species1-count count species1-on neighbors
      let species2-count count species2-on neighbors
      if (species1-count < HND-sp1) [
        ask one-of species1 [
          hatch 1
          setxy [pxcor] of empty-patch-random [pycor] of empty-patch-random
        ]
      ]
      if (species2-count < HND-sp2) [
        ask one-of species2 [
          hatch 1
          setxy [pxcor] of empty-patch-random [pycor] of empty-patch-random
        ]
      ]
    ]
  ]
end 


; Copyright 2023l Sareena, B. & Ruwan Punchi-Manage.
; * Corresponding Email: spunchi@sci.pdn.ac.lk
; See Info tab for full copyright and license.

There is only one version of this model, created about 1 year ago by Ruwan Punchi-Manage.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.