MIHS 2018 stella-hannah bio project

No preview image

1 collaborator

Default-person Stella Anderson (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.4 • Viewed 199 times • Downloaded 27 times • Run 0 times
Download the 'MIHS 2018 stella-hannah bio project' modelDownload this modelEmbed this model

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


WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

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

Click to Run Model

globals [ max-fish ]
breed [ fish a-fish ]
breed [turts turt]
turtles-own [energy]

to setup
  clear-all
  set max-fish 100
  setup-patches
  setup-turts
  setup-fish
  reset-ticks
end 

to go
  if not any? turtles [ stop ]
  if count turtles > 10000 [ user-message "The ecosystem has been overrun" ]
  move-turtles
  eat-grass
  eat-fish
  reproduce
  check-death
  regrow-grass
  tick
end 

to move-turtles
  ask turts [
    right random 100
    forward 1
    set energy energy - 3
  ]
  ask fish [
    right random 100
    forward 2
    set energy energy - 1
  ]
end 

to setup-patches
  ask patches [ set pcolor blue - 2 ]
  ask n-of 20 patches [ set pcolor orange ]
end 

to setup-turts
  create-turts 10 [ setxy random-xcor random-ycor]
  ask turtles [ set shape "turtle" ]
  ask turtles [ set size 3 ]
  ask turtles [ set energy random 100 ]
  ask turtles [ set shape "turtle" ]
  ask turtles [ set color yellow ]
end 

to setup-fish
  create-fish 50 [ setxy random-xcor random-ycor ]
  ask fish [ set energy random 100 + 25 ]
  ask fish [ set shape "fish" ]
end 

to eat-grass
  ask fish [
    if pcolor = orange [
      set pcolor blue - 2
      set energy energy + 30
    ]
    ifelse show-energy?
    [ set label energy ]
    [ set label "" ]
  ]
end 

to eat-fish
  ask turts [
    if energy > 20 [
      if random-float 100 < turt-hunting-skill [
    let prey one-of fish
    if prey != nobody [
      ask prey [ die ]
      set energy energy + 40
    ]
      ]
    ifelse show-energy?
    [ set label energy ]
    [ set label "" ]
  ]
  ]
end 

to reproduce
  ask fish [
    if energy > 10 [
      if random-float 100 < fish-reproduce [
      set energy energy - 0
      hatch 1 [ set energy 80 ]
    ]
  ]
  ]
  ask turts [
    if energy > 80 [
      if random-float 100 < turt-reproduce [
      set energy energy - 30
      hatch 1 [ set energy 70 ]
    ]
  ]
  ]
end 

to check-death
  ask fish [
    if energy <= 40 [ die ]
  ]
  ask turts [
    if energy <= 60 [ die ]
  ]
end 

to regrow-grass
  ask patches [
    if random 750 < 2 [ set pcolor orange ]
  ]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Stella Anderson over 6 years ago added turtle hunting accuracy Download this version
Stella Anderson over 6 years ago created reproduction variables to alter outcomes of the ecoystem Download this version
Stella Anderson over 6 years ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.