MIHS-17 Period 3 Katie S, Derek W

No preview image

1 collaborator

Default-person katie stoops (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.2 • Viewed 190 times • Downloaded 28 times • Run 0 times
Download the 'MIHS-17 Period 3 Katie S, Derek W' modelDownload this modelEmbed this model

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


CHANGES:

Added a third creature to the Wolf-Sheep predation system that consumes secondary consumers and consumes flowers that spawn around the field

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

breed [primaries primary]
breed [secondaries secondary]
breed [tertiaries tertiary]
breed [flowers flower]
turtles-own [energy]
patches-own [regrowthcounter]

to setup
  clear-all
  setup-turtles
  setup-patches
  reset-ticks
end 

to go
  generate-flowers
  ask primaries[
    move-turtles
    eat-grass
    reproduce-primary
    check-death
  ]
  ask secondaries[
    move-turtles
    eat-primaries
    reproduce-secondary
    check-death
  ]
  ask tertiaries[
    move-turtles
    eat-secondaries
    eat-flowers
    reproduce-tertiary
    check-death
  ]
  ask patches[
    grass-grow
  ]
  tick
end 

to move-turtles
 rt random 50
 lt random 50
 fd 0.5
 set energy energy - 0.1
end 

to eat-grass
   if pcolor = green[
   set pcolor brown
   set energy energy + energy-from-grass
   ifelse show-energy?
    [set label energy]
    [set label ""]
  ]
end 

to eat-primaries
  ifelse show-energy?
    [set label energy]
    [set label ""]
  let prey one-of primaries-here
  if prey != nobody[
    set energy [energy] of prey * (percent-taken / 100)
    ask prey[die]
  ]
end 

to eat-secondaries
  ifelse show-energy?
    [set label energy]
    [set label ""]
  let prey one-of secondaries-here
  if prey != nobody[
    set energy [energy] of prey * (percent-taken / 100)
    ask prey[die]
  ]
end 

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

to reproduce-primary
  if random 100 < 4[
    if energy > 25[
      set energy energy - 10
      hatch 1[ set energy 25 ]
    ]
  ]
end 

to reproduce-secondary
  if random 100 < 4[
    if energy > 2[
      set energy energy - 4
      hatch 1[ set energy 5 ]
    ]
  ]
end 

to reproduce-tertiary
  if random 200 < 4[
    if(energy > 40)[
      set energy energy - 40
      hatch 1[set energy 40]
    ]
  ]
end 

to check-death
  if energy <= 0 [die]
end 

to generate-flowers
  create-flowers random 3[
   setxy random-xcor random-ycor
   set color pink
   set size 2
   set shape "plant"
  ]
end 

to grass-grow
  if pcolor = brown[
    ifelse regrowthcounter <= 0
      [set pcolor green
       set regrowthcounter random grass-regrowth-time]
      [set regrowthcounter regrowthcounter - 1]
  ]
end 

to setup-turtles
  if trophic-levels >= 1[
    create-primaries starting-turtles [
      setxy random-xcor random-ycor
      set color white
      set size 1
      set energy 30
    ]
  ]
  if trophic-levels >= 2[
    create-secondaries starting-turtles / 4[
      setxy random-xcor random-ycor
      set color red
      set size 1.1
      set energy 60
    ]
  ]
  if trophic-levels >= 3[
    create-tertiaries starting-turtles / 16[
      setxy random-xcor random-ycor
      set color blue
      set size 1.2
      set energy 60
    ]
  ]
end 

to setup-patches
  ask patches [
      set pcolor one-of [ green brown ]
      ifelse pcolor = green
        [ set regrowthcounter grass-regrowth-time ]
      [ set regrowthcounter random grass-regrowth-time ] ; initialize grass regrowth clocks randomly for brown patches
    ]
end 

There is only one version of this model, created almost 8 years ago by katie stoops.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.