Don't Feed the Ducks

Don't Feed the Ducks preview image

1 collaborator

Default-person J K (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 1 time • Downloaded 0 times • Run 0 times
Download the 'Don't Feed the Ducks' modelDownload this modelEmbed this model

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


~~ Interpretation Note ~~ This simulation is a simplified model that seeks to illustrate concepts about behavior change and potential risks related to feeding wildlife. It does not reflect actual scientific data or specific research findings about duck behavior, population dynamics, or mortality rates. The patterns and outcomes generated by the simulation are not intended to serve as scientific predictions or precise measurements.

Instead, the purpose of the model is to encourage users to think critically about how human actions may influence animal behavior and safety.

~~ Acknowledgment ~~ This simulation was developed and guided with the use of ChatGPT. With input throughout the process, ChatGPT provided feedback, suggestions, and both technical and background knowledge related to duck behavior, learning models, simulation logic, coding design, and coding output.

Comments and Questions

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

Click to Run Model

globals [
  roadkills-wild-today
  roadkills-hab-today
  natural-deaths-wild-today
  natural-deaths-hab-today
  total-roadkills-wild
  total-roadkills-hab
  total-natural-deaths-wild
  total-natural-deaths-hab
]

breed [trees tree]
breed [feeders feeder]
breed [nonfeeders nonfeeder]
breed [pedestrians pedestrian]
breed [foods food]
breed [cars car]
breed [wildducks wildduck]
breed [habducks habduck]

wildducks-own [feed-count age curious?]
habducks-own [age]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SETUP AND GO

to setup
  clear-all
  draw-background
  spawn-initial-wildducks
  set total-roadkills-wild 0
  set total-roadkills-hab 0
  set total-natural-deaths-wild 0
  set total-natural-deaths-hab 0
  reset-ticks
end 

to go
  set roadkills-wild-today 0
  set roadkills-hab-today 0
  set natural-deaths-wild-today 0
  set natural-deaths-hab-today 0

  clear-feeders
  clear-nonfeeders
  clear-pedestrians
  clear-food
  clear-cars

  spawn-feeders
  spawn-nonfeeders
  spawn-pedestrians
  spawn-cars

  update-duck-curiosity
  ducks-eat-and-learn
  move-ducks
  detect-roadkill
  apply-natural-mortality
  apply-aging-deaths

  set total-roadkills-wild total-roadkills-wild + roadkills-wild-today
  set total-roadkills-hab total-roadkills-hab + roadkills-hab-today
  set total-natural-deaths-wild total-natural-deaths-wild + natural-deaths-wild-today
  set total-natural-deaths-hab total-natural-deaths-hab + natural-deaths-hab-today

  if ticks mod 10 = 0 and count wildducks + count habducks < 100 [
    reproduce-ducks
  ]

  update-duck-plots
  tick
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DUCK BEHAVIOR

to update-duck-curiosity
  ask wildducks [
    set curious? random-float 1.0 < 0.02
  ]
end 

to ducks-eat-and-learn
  ask wildducks [
    let nearby-food one-of foods in-radius 2
    if nearby-food != nobody and random-float 1.0 < 0.5 [
      ask nearby-food [ die ]
      set feed-count feed-count + 1
      if feed-count >= habituation-threshold [
        hatch-habducks 1 [
          set shape "duck"
          set color red
          set size 1.5
          set age [age] of myself
          setxy xcor ycor
        ]
        die
      ]
    ]
  ]
end 

to move-ducks
  let pond-min-y -9
  let pond-max-y 7

  ask wildducks [
    rt random 20 - 10
    fd 0.5
    if not curious? [
      if ycor < pond-min-y [ set ycor pond-min-y + 0.5 rt 180 ]
      if ycor > pond-max-y [ set ycor pond-max-y - 0.5 rt 180 ]
    ]
    bound-duck
    set age age + 1
  ]

  ask habducks [
    rt random 20 - 10

    ;; 5% chance to turn toward pond
    if random-float 1.0 < 0.05 [
      if ycor > 7 [ set heading 180 ]
      if ycor < -9 [ set heading 0 ]
    ]

    let terrain-color [pcolor] of patch-here

    if terrain-color = blue [
      fd 0.5  ;; swimming
    ]
    if terrain-color = gray [
      if random-float 1.0 < 0.8 [ rt 180 ]  ;; avoid road
      fd 1.0
    ]
    if terrain-color != blue and terrain-color != gray [
      fd 0.9  ;; walking on land
    ]

    bound-duck
    set age age + 1
  ]
end 

to bound-duck
  let edge-margin 2

  if xcor < (-25 + edge-margin) [
    set heading 90 + random 30
  ]
  if xcor > (25 - edge-margin) [
    set heading 270 + random 30
  ]
  if ycor < (-25 + edge-margin) [
    set heading 0 + random 30
  ]
  if ycor > (25 - edge-margin) [
    set heading 180 + random 30
  ]
end 

to detect-roadkill
  ask wildducks with [curious?] [
    let nearby-car one-of cars in-radius 1
    if nearby-car != nobody [
      set roadkills-wild-today roadkills-wild-today + 1
      die
    ]
  ]
  ask habducks [
    let nearby-car one-of cars in-radius 1
    if nearby-car != nobody [
      set roadkills-hab-today roadkills-hab-today + 1
      die
    ]
  ]
end 

to apply-natural-mortality
  ask wildducks [
    if random-float 1.0 < 0.002 [
      set natural-deaths-wild-today natural-deaths-wild-today + 1
      die
    ]
  ]
  ask habducks [
    if random-float 1.0 < 0.002 [
      set natural-deaths-hab-today natural-deaths-hab-today + 1
      die
    ]
  ]
end 

to apply-aging-deaths
  ask wildducks [
    if age >= 1000 [
      set natural-deaths-wild-today natural-deaths-wild-today + 1
      die
    ]
  ]
  ask habducks [
    if age >= 1000 [
      set natural-deaths-hab-today natural-deaths-hab-today + 1
      die
    ]
  ]
end 

to reproduce-ducks
  ask wildducks [
    if random-float 1.0 < 0.1 [
      hatch-wildducks 1 [
        set shape "duck"
        set color green
        set size 1.5
        set feed-count 0
        set age 0
        set curious? false
        setxy random-xcor one-of [-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]
      ]
    ]
  ]
  ask habducks [
    if random-float 1.0 < 0.05 [
      hatch-wildducks 1 [
        set shape "duck"
        set color green
        set size 1.5
        set feed-count 0
        set age 0
        set curious? false
        setxy random-xcor one-of [-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]
      ]
    ]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SPAWN VISITORS AND OBJECTS

to clear-feeders     ask feeders     [ die ] end

to clear-nonfeeders  ask nonfeeders  [ die ] end

to clear-pedestrians ask pedestrians [ die ] end

to clear-food        ask foods       [ die ] end

to clear-cars        ask cars        [ die ] end

to spawn-feeders
  create-feeders num-feeders [
    set shape "person"
    set color orange
    set size 1.5
    setxy random-xcor random-y-in-feeding-zone
    throw-my-food
  ]
end 

to throw-my-food
  let n random 3 + 1
  repeat n [
    hatch-foods 1 [
      set shape "circle"
      set color orange
      set size 1
      setxy random-xcor random-y-in-upper-pond
    ]
  ]
end 

to-report random-y-in-feeding-zone
  report one-of [8 9 10]
end 

to-report random-y-in-upper-pond
  report one-of [4 5 6 7]
end 

to spawn-nonfeeders
  create-nonfeeders num-nonfeeders [
    set shape "person"
    set color pink
    set size 1.5
    setxy random-xcor one-of [16 17]
  ]
end 

to spawn-pedestrians
  create-pedestrians num-pedestrians [
    set shape "person"
    set color pink
    set size 1.5
    setxy random-xcor one-of [-17 -18]
  ]
end 

to spawn-cars
  create-cars num-cars [
    set shape "car"
    set color black
    set size 2
    setxy random-xcor one-of [-21 -22 -23 -24 -25]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; INITIALIZATION

to spawn-initial-wildducks
  create-wildducks num-wildducks [
    set shape "duck"
    set color green
    set size 1.5
    set feed-count 0
    set age 0
    set curious? false
    setxy random-xcor one-of [-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; STATIC BACKGROUND

to draw-background
  draw-trees
  draw-upper-path
  draw-feeding-line
  draw-pond
  draw-lower-trees
  draw-lower-path
  draw-road
end 

to draw-trees
  let tree-y 22
  let tree-x-list [-20 -15 -10 -5 0 5 10 15 20]
  foreach tree-x-list [ x ->
    create-trees 1 [
      setxy x tree-y
      set shape "tree"
      set color green
      set size 2
    ]
  ]
end 

to draw-upper-path
  ask patches with [pycor = 18 or pycor = 15] [ set pcolor pink ]
end 

to draw-feeding-line
  ask patches with [pycor = 11] [ set pcolor orange ]
end 

to draw-pond
  ask patches with [pycor >= -9 and pycor <= 7] [ set pcolor blue ]
end 

to draw-lower-trees
  let y-list [-10 -12 -14]
  foreach y-list [ y ->
    let x-list [-20 -15 -10 -5 0 5 10 15 20]
    foreach x-list [ x ->
      create-trees 1 [
        setxy x y
        set shape "tree"
        set color green
        set size 2
      ]
    ]
  ]
end 

to draw-lower-path
  ask patches with [pycor = -16 or pycor = -19] [ set pcolor pink ]
end 

to draw-road
  ask patches with [pycor <= -20] [ set pcolor gray ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PLOTS

to update-duck-plots
  set-current-plot "Duck Population"
  plot count wildducks + count habducks

  set-current-plot "Duck Types Over Time"
  set-current-plot-pen "Wild Ducks"
  plot count wildducks
  set-current-plot-pen "Habituated Ducks"
  plot count habducks

  set-current-plot "Cumulative Natural Deaths"
  set-current-plot-pen "Wild Ducks (Natural Death)"
  plot total-natural-deaths-wild
  set-current-plot-pen "Habituated Ducks (Natural Death)"
  plot total-natural-deaths-hab

  set-current-plot "Cumulative Roadkill"
  set-current-plot-pen "Wild Ducks (Roadkill)"
  plot total-roadkills-wild
  set-current-plot-pen "Habituated Ducks (Roadkill)"
  plot total-roadkills-hab
end 

There is only one version of this model, created about 5 hours ago by J K.

Attached files

File Type Description Last updated
Don't Feed the Ducks.png preview Preview for 'Don't Feed the Ducks' about 5 hours ago, by J K Download

This model does not have any ancestors.

This model does not have any descendants.