Salmon migration and mating in the Snake River

Salmon migration and mating in the Snake River preview image

1 collaborator

Default-person Colin McCarthy (Author)

Tags

fish behaviour 

Tagged by Colin McCarthy almost 7 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0 • Viewed 196 times • Downloaded 13 times • Run 0 times
Download the 'Salmon migration and mating in the Snake River' 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

;: All credit for base model created by Amy Steimke, Boise State University
;: Further edits by Colin McCarthy, Whitman College
;: Last edit: 4/17/17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; PARAMETERS ;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; currently: 1 tick = 1 hour,
; each patch = 1 km ( with the exception of dams )

globals [ velocity
   ] ; average velocity of movement (km/hr), calculated in set-velocity procedure


turtles-own [ start-movement              ; true/false, says if they can start migrating
              movement-speed              ; fish's velocity, remains constant thru each run
              prob-death                  ; probability of death on any tick while migrating
              at-dam?                     ; if turtle is within 1 tick of a dam, goes to true
              time-at-dam                 ; total time turtle spends at dams
              probability-of-passage      ; probability of passing through a dam
              matelife                    ; time alive once at end of the model
              partner                     ; numerical value representing partner agent
              probability-of-reproduction ; probability that reproduction is successful

]

patches-own [ dam1   ; x-coordinate of Ice Harbor Dam (first one)
              dam2   ; x-coordinate of Lower Monumental Dam (second dam)
              dam3   ; x-coordinate of Little Goose Dam (third dam)
              dam4   ; x-coordinate of Lower Granite Dam (last one)
              matezone   ; x-coordinate of mating zone
]


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;:::;;;;;;;;;;;;;;;;;::: SETUP ;:;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to setup
  clear-all
  reset-ticks
  file-close
  set-velocity
  setup-patches
  setup-turtles
  destroy-dams
end 


;;; creates river corridor and locations of dams ;;;

to setup-patches
  ask patches
  [ set pcolor 55 ; sets up river banks
    set dam1 1 ; these 4 lines are x-coordinates of the dams
    set dam2 52
    set dam3 97
    set dam4 157
    set matezone 167
    if (pycor < 10) and (pycor > -10) [ set pcolor 105 ] ; sets up river corridor
    if (pxcor = dam1) [ set pcolor 2 ] ; sets up first dam
    if (pxcor = dam2) [ set pcolor 2 ] ; sets up second dam
    if (pxcor = dam3) [ set pcolor 2 ] ; sets up third dam
    if (pxcor = dam4) [ set pcolor 2 ] ; sets up last dam
    if ((pxcor = matezone and pycor < -1) or (pxcor = matezone and pycor > 1)) [set pcolor 15]
   ]
end 


;;; sets average velocity for fish ;;;

to set-velocity
  ; velocity equation from Salinger & Anderson, 2006
  let flow (FlowRate-m3/s / 1000) ; flowrate in 10^3 m3/s
  let rivertemp (( RiverTemp-farenheit - 32 ) / 1.8 ) ; change river temperature to Celsius
    ifelse rivertemp <= 16.3
     [ set velocity ((27.3 + ( 2 * rivertemp ) - (1.5 * flow)) / 24)] ; velocity in km/hr for temperatures below 16.3C
     [ set velocity ((100.7 - ( 2.5 * rivertemp) - (1.5 * flow)) / 24)] ; velocity in km/hr for temperatures above 16.3C
end 


;;; sets up initial fish variables ;;;

to setup-turtles
  create-turtles initial-number-fish
  [
    choose-sex
    set shape "fish"
    set size 2
    setxy 2 8 - random(17)  ; places fish in starting corridor
    set heading 90
    set probability-of-passage probability-making-thru-dam
    set at-dam? false
    set time-at-dam 0
    set matelife abs(round(random-normal 24 24))
    set probability-of-reproduction probability-successfully-reproducing
    set partner 0
    set start-movement false
    set movement-speed random-normal velocity speed-stdev ; normally distributes speeds based off of calculated velocity and chosen stdev from slider on interface
    if movement-speed <= 0 [set movement-speed movement-speed * -1] ; makes sure movement-speed is not negative, otherwise error occurs while checking for dams and is unrealistic
 ]
end 

to choose-sex  ;; turtle procedure for determining sex of agent
  set color one-of [magenta red];
end 

;;; procedure for destroying dams in the world, switches are on the interface ;;;

to destroy-dams
    if destroy-dam-2?        ; procedure for destroying 2nd dam
      [ask patches
        [if pxcor = dam2
         [if (pycor < 10) and (pycor > -10) [ set pcolor 105 ]]
        ]
       ]
    if destroy-dam-3?        ; procedure for destroying 3rd dam
      [ask patches
        [if pxcor = dam3
         [if (pycor < 10) and (pycor > -10) [ set pcolor 105 ]]
        ]
       ]
    if destroy-dam-4?        ; procedure for destroying 4th dam
      [ask patches
        [if pxcor = dam4
         [if (pycor < 10) and (pycor > -10) [ set pcolor 105 ]]
        ]
       ]
end 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; MOVEMENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to go
  tick
  start-migration
  move-turtles
  fish-die
  mate
  if-else Opportunity-Mating?
  [if not any? turtles with [xcor < matezone + 1 and matelife > 0]
    [stop]       ; stops ticking once all fish are past last dam and have had the chance to mate
  ]
  [if not any? turtles with [xcor < dam4 ]
      [stop]     ; stops ticking once all fish are past last dam ignoring the mating submodel
  ]
  check-for-dams
  dam-learn
end 


; procedure tells turtles when they can start moving, and when to stop movement after last dam

to start-migration
  ask turtles
  [
    if random-float 1 < probability-of-starting-migration  ; starts fish migrating
       [set start-movement true]
    if xcor > dam4 + movement-speed                        ; stops fish migrating
        [set start-movement false]
  ]
end 


; procedure checks for dams ahead of turtle in the length of their movement-speed (only get stopped once by each dam)

to check-for-dams
  ask turtles
  [
    ifelse any? patches in-cone movement-speed 1 with [pcolor = 2] ; checks for dams ahead of them
    [set at-dam? true]
    [set at-dam? false]
   if at-dam? = true
   [set time-at-dam time-at-dam + 1]  ; calculates how many ticks they are stopped by dams
  ]
end 


; procedure calls for fish who have successfully navigated previous dams in a shorter period of time to have a
; higher likelihood of navigating next dam they encounter more quickly

to dam-learn
  if dam-learning? ; switch is located on interface
  [ask turtles
    [ if at-dam? = true and xcor > dam2 and xcor < dam3 and time-at-dam <= 3      ; if second dam crossing took 3 or less ticks, they will get a higher probability for next dam
     [set probability-of-passage probability-of-passage * (random-float 1 + 1) ]  ; will multiply their previous probability anywhere from ~1.01 - 1.99

      if at-dam? = true and xcor > dam3 and xcor < dam4  and time-at-dam <= 5     ; if second & third dam crossings took 5 or less ticks, they will get a higher probability for next dam
     [set probability-of-passage probability-of-passage * (random-float 1 + 1) ]  ; will multiply their previous probability anywhere from ~1.01 - 1.99
    ]

  ]
end 

to mate
  if Opportunity-Mating?
  [ask turtles
    [if (xcor >= dam4 and xcor < dam4 + 9)
      [setxy matezone 0]
    if xcor = matezone
      [set matelife matelife - 1
      if partner = 0
        [set partner one-of other turtles with [partner = 0 and color != [color] of myself and xcor = matezone]
          ifelse partner = nobody [set partner 0] [ask partner [ set partner myself ] ]
        ]
      if matelife != nobody
        [if matelife <= 0
          [die]
      ]
      if partner != nobody
      [if partner != 0
        [if color = magenta
          [setxy matezone + 5 8 - random(17)
            set color pink]
      ]
      ]
      ]
    ]

  ]
end 


; procedure for movement; each tick turtles move their movement-speed (km/hr)
; if at-dam? is true for turtle, then turtle takes time trying to navigate/find fish ladder to cross dam

to move-turtles
  ask turtles
  [ if start-movement = true
    [ ifelse at-dam? = false
    [ set heading 90 forward movement-speed]
      [if random-float 1 < probability-of-passage ; set on interface tab, probability of fish finding the ladder
        [set heading 90 forward movement-speed]
      ]
    ]
  ]
end 


; Procedure for fish to die on each tick with probability set on interface tab
; Mortality factors - fishing, disease, unsuccessful dam crossing

to fish-die
    ask turtles
    [
      ifelse at-dam? = false
              [if xcor <= dam4
                 [set prob-death initial-mortality-constant] ; chance of dying on any turn
                  if xcor > dam4 [set prob-death 0 ] ; no death after the cross 4th dam
              ]
              [ set prob-death initial-mortality-constant * dam-death-multiplier ] ; higher likelihood of death while they are trying to cross dam
    if random-float 1 < prob-death [die] ; death procedure
    ]
end 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;; END ;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

There is only one version of this model, created almost 7 years ago by Colin McCarthy.

Attached files

File Type Description Last updated
Salmon migration and mating in the Snake River.png preview Preview for 'Salmon migration and mating in the Snake River' almost 7 years ago, by Colin McCarthy Download

This model does not have any ancestors.

This model does not have any descendants.