Salmon migration in the Snake River

Salmon migration in the Snake River preview image

1 collaborator

Default-person Amy Steimke (Author)

Tags

fish behaviour 

Tagged by Qian li over 9 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 5.1.0 • Viewed 363 times • Downloaded 24 times • Run 0 times
Download the 'Salmon migration 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

;: Created by Amy Steimke, Boise State University
;: Last edit: 12/8/2014

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; 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

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)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;:::;;;;;;;;;;;;;;;;;::: 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
    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
   ]
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
  [
    set color red
    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 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 


;;; 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
         [set pcolor blue]
        ]
       ]
    if destroy-dam-3?        ; procedure for destroying 3rd dam
      [ask patches 
        [if pxcor = dam3
         [set pcolor blue]
        ]
       ]
    if destroy-dam-4?        ; procedure for destroying 4th dam
      [ask patches 
        [if pxcor = dam4
         [set pcolor blue]
        ]
       ]
end 


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

to go
  tick
  start-migration
  move-turtles 
  fish-die
  if not any? turtles with [xcor < dam4]
      [stop]     ; stops ticking once all fish are past last dam
  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 
    

; 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 over 9 years ago by Amy Steimke.

Attached files

File Type Description Last updated
Salmon migration in the Snake River.png preview Preview for 'Salmon migration in the Snake River' over 9 years ago, by Amy Steimke Download

This model does not have any ancestors.

Children:

Graph of models related to 'Salmon migration in the Snake River'