sharks-seals-fish-simple

sharks-seals-fish-simple preview image

1 collaborator

Default-person Siobhan Sheehan (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.4.0 • Viewed 31 times • Downloaded 3 times • Run 0 times
Download the 'sharks-seals-fish-simple' modelDownload this modelEmbed this model

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

breed[fish fishes]
breed[seals seal]
breed[sharks shark]

patches-own [ countdown]
turtles-own [ energy]

to setup
  clear-all
  reset-ticks

  ask patches [
    set pcolor one-of [green black]
    ifelse pcolor = green
        [set countdown algae-regrowth-time]
    [set countdown random algae-regrowth-time]]

  create-sharks initial-number-sharks
    [set shape "shark"
     set color blue
     set size 2
     setxy random-xcor random-ycor
    set energy random 10]
  create-seals initial-number-seals
     [set shape "seal"
      set color white
      set size 1.5
      setxy random-xcor random-ycor
    set energy random 10]
  create-fish initial-number-fish
       [set shape "fish 3"
      set color orange
      set size 1
      setxy random-xcor random-ycor
    set energy random 10]
end 

to go
  ask sharks
     [move
      eat-seals
      eat-fish
      death
      reproduce]
  tick
  ask seals [move
    eat-fish
    death
    reproduce]
  tick
  ask fish [move
    eat-algae
    death
    reproduce]
  tick
end 

to move
    rt random 50
    lt random 50
    fd 1
  set energy energy - 1
end 

to eat-seals
  let prey one-of seals-here
  if prey != nobody
    [ask prey [die]
      set energy energy + 1]
end 

to eat-fish
  let prey one-of fish-here
  if prey != nobody
    [ask prey [die]
      set energy energy + 1]
end 

to eat-algae
  if pcolor = green
      [set pcolor black
  set energy energy + 1]
end 

to death
  if energy <= 0 [die]
end 

to reproduce
  if energy > 0 and random-float 100 < 20
  [hatch 1 [ rt random-float 360 fd 1] set energy random 10]
end 

There is only one version of this model, created 4 months ago by Siobhan Sheehan.

Attached files

File Type Description Last updated
sharks-seals-fish-simple.png preview Preview for 'sharks-seals-fish-simple' 4 months ago, by Siobhan Sheehan Download

This model does not have any ancestors.

This model does not have any descendants.