Beach Management Unit Kenya

Beach Management Unit Kenya preview image

2 collaborators

Default-person Richard Taylor (Author)
Default-person Ankita Anirban (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.2 • Viewed 925 times • Downloaded 78 times • Run 0 times
Download the 'Beach Management Unit Kenya' 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

globals [time season minutes hours day sea land coast shallow deep reef farmland abroad]

breed [spinners spinner] ; clock in top right corner

breed [fishers fisher] ; people
breed [BMUs BMU]
breed [captains captain]
breed [farmers farmer]

breed [canoes canoe] ; vessels
breed [m-canoes m-canoe]
breed [b-boats b-boat]

breed [rabbitfishes rabbitfish] ; species of schools of fish
breed [kingfishes kingfish]
breed [tunas tuna]


breed [basket-traps basket-trap] ;;rabbitfish ;;canoe
breed [troll-lines troll-line] ;;kingfish ; m-canoe                                                                                                                                                                                                               
breed [ring-nets ring-net] ;;tuna ;; b-boat

breed [storms storm] ; bad weather
breed [black-flags black-flag]

undirected-link-breed [boat-links boat-link]
directed-link-breed [crew-links crew-link]

canoes-own [c-status c-destination c-fish-catch]
m-canoes-own [m-status m-destination m-fish-catch]
b-boats-own [b-status b-destination b-fish-catch]

patches-own [reef-health] ;general variable which affects whether the fish population can grow

rabbitfishes-own [r-fish-stock] ; fish stock in each school
kingfishes-own [k-fish-stock]
tunas-own [t-fish-stock] 

BMUs-own [BMU-balance BMU-income]
fishers-own [f-status f-balance f-income f-boat-type f-decision]
captains-own [boat-type status cpt-income cpt-balance cpt-decision]

to setup
  
 ct 
 
 ;landscape setup
 ask patches [
   if pcolor = black [set pcolor blue]
   if pcolor > 10 and pcolor < 16 [set pcolor 104]
   if pcolor >= 60 and pcolor < 66 [set pcolor 106]
   if pcolor != blue and pcolor != 104 and pcolor != 106 [set pcolor green]
   if pcolor = green and pycor > 30 [set pcolor 54]
   if pcolor = green and pycor < -30 [set pcolor 56]
 ] 
   ask patches with [pcolor = 54 and not any? neighbors4 with [pcolor = 54] ]
     [set pcolor blue]
   ask patches with [pcolor = green   or pcolor = 54 or pcolor = 56 and any? neighbors with [ pcolor = 106 ]] [
   set pcolor yellow]
   
   ask patches with [ pcolor = 104 and any? neighbors with [ pcolor = blue ] ] [
   set pcolor white]
 
 set sea patches with [pcolor = blue]
 set shallow patches with [pcolor = 106]
 set deep patches with [pcolor = 104]
 set land patches with [pcolor = green]
 set coast patches with [pcolor = yellow]
 set reef patches with [pcolor = white]
 set farmland patches with [pcolor = 54]
 set abroad patches with [pcolor = 56]
 
 ;clock
 create-spinners 1 [
    set shape "clock"
    setxy (max-pxcor - 5) (max-pycor - 5)
    set color gray - 1.5
    set size 10
    set heading 0 
 ]
 
 
 set-default-shape farmers "person" ; create people
 create-farmers 10 [
   move-to one-of farmland
   set size 2
   set color black
  ]
    
 set-default-shape fishers "person"
 create-fishers 30 [
   move-to one-of land
   set size 2
   set color blue
   set f-balance 100 + random 500 ;; initial balance so they don't migrate immediately
 ]
 
 set-default-shape captains "person"
 create-captains 18 [
   move-to one-of land
   set size 2
   set color red
   set cpt-balance 500 + random 1000 ;;initial balance so that they don't migrate immediately
 ]
 
  ask n-of 14 captains with [boat-type = 0] [ ; ideally this will depend on income, but not sure how to keep the number of people and number of boats consistent
   set boat-type "canoe"]
 ask n-of 3 captains with [boat-type = 0] [
   set boat-type "m-canoe"]
 ask n-of 1 captains with [boat-type = 0] [
   set boat-type "b-boat"]
 
 
 create-canoes 14 [ ; create vessels
   move-to one-of coast
   set size 5
   set shape "boat"
]
 
 create-m-canoes 3 [
   move-to one-of coast
   set size 5
   set shape "boat top"
 ]

 create-b-boats 1 [
   move-to one-of coast
   set size 10
   set color red
   set shape "boat"
 ]
  
 
 ask patch -7 14 [
   sprout-BMUs 1 [
   set size 5
   set shape "house"
   set color red
   set BMU-balance 1000 ; initial balance
   ]
 ]
 
 let r count sea / 1000 ; create fish
 ask n-of r sea [
     sprout-rabbitfishes 1 [
       set size 2 + random 5 ; initial random size of fish stock *ought to be verified*
       set color [102 0 0 125]
       set shape "circle"
       set r-fish-stock size * 100
     ]
 ]
     
 let k count sea / 1000
 ask n-of k sea [
     sprout-kingfishes 1 [
       set size 2 + random 5
       set color [94 0 0 90]
       set shape "circle"
       set k-fish-stock size * 100
     ]
 ]
     
 let t count sea / 1000
 ask n-of t sea [
     sprout-tunas 1 [
       set size 2 + random 5
       set color [84 0 0 60]
       set shape "circle"
       set t-fish-stock size * 100
     ]    
 ]

ask reef [set reef-health 100] ; arbitrary "reef health" as this affects whether fish population can grow



reset-ticks
end 

to go
  
   clock   ;; to keep things moving with "real time"
     
   timings
   
   go-fishing
  
   decide-to-fish ; fisher's actions
   migrate
   spend
   
   
   damage-reef ; environmental actions
   move-fishes
   
   bad-weather
   
      
   ask rabbitfishes [
     set label round r-fish-stock]
   ask kingfishes [
     set label round k-fish-stock]
   ask tunas [
     set label round t-fish-stock]
     

   tick
end 

to decide-to-fish ;only go fishing in good weather unless income is below certain amount
  if hours = 1 [
  ask captains [
      if not any? storms [
        set cpt-decision "yes"]
      if any? storms and cpt-balance < 500 [ ; *min balance required to choose to prioritise safety*
        set cpt-decision "yes"]
    ]
   ask fishers [
       if not any? storms [
        set f-decision "yes"]
      if any? storms and f-balance < 500 [
        set f-decision "yes"]
    ]
  ]
end 

to go-fishing ;; all the functions which control fishing - crew choice, going out to sea, paying BMU fees etc
   choose-crew ; captains and fishers
   board ; only captains
   leave-vessels ; only boats
   fish-vessels  ; boats 
   return-vessels ; boats
   pay-BMU-fees ; captains, fishers, BMU
   income ; captains fishers
   go-home ; captains, fishers, boats
end 

to migrate ; if balance falls under minimum, they choose to migrate to farming
  if hours = 8[
  ask captains [
    if cpt-balance < 50 [ ; *min balance required to stay fishing*
      go-home
      move-to one-of farmland
      set breed farmers
      set color black 
     ]
  ]
  ask fishers [
    if f-balance < 50 [
      go-home
      move-to one-of farmland
      set breed farmers
      set color black
    ]
  ]
  ]
end 

to pay-BMU-fees ;paying BMU fees
  let cbmuf 0 ; the fees from the captain
  let fbmuf 0 ; fees from fisher
  if hours = 6 and minutes = 0 [ ; payment after a day of fishing
  ask captains [
    set cbmuf cbmuf + (BMU-fees * (cpt-income / 200) ) ; fees are *input fees* times the number of fish caught or kg of fish caught (/200 as income is fish-catch *200)
    set cpt-income cpt-income - (BMU-fees * (cpt-income / 200) ) ; now taken away from income
    set cpt-balance cpt-balance + cpt-income ; balance set with new income
    set cpt-income 0 ; income is reset daily
  ]
  ask fishers [
    set f-income f-income - (BMU-fees * (f-income / 200 ) )
    set fbmuf fbmuf + (BMU-fees * (f-income / 200 ) )
    set f-balance f-balance + f-income
    set f-income 0
  ]
  ask BMUs [
    set BMU-income cbmuf + fbmuf ; BMU income received from fees from fishers and captains
    set BMU-balance BMU-balance + BMU-income
    set BMU-income 0
  ]
  ]
end 

to choose-crew ; captains link with nearest X number of fishers depending on the type of boat they have
  
  ask captains [
    if status = "choosing-crew" [
      let willing-fishers fishers with [ f-decision = "yes"] 
      
      if boat-type = "canoe" [
        ifelse any? willing-fishers with [not any? my-in-links]
        [ create-crew-link-to one-of willing-fishers with [not any? my-in-links] [tie] 
          set status "crew-chosen"]
        [ set status "no-crew" ]
      ]
        
      if boat-type = "m-canoe" [
        ifelse count willing-fishers with [not any? my-in-links] > 2
        [ create-crew-links-to n-of 3 willing-fishers with [not any? my-in-links][tie]
          set status "crew-chosen"]
        [ set status "no-crew" ]
      ]
     
      if boat-type = "b-boat" [
        ifelse count willing-fishers with [not any? my-in-links] > 6
        [ create-crew-links-to n-of 7 willing-fishers with [not any? my-in-links][tie]
          set status "crew-chosen"]
        [set status "no-crew"]
      ]
    ]
  ]
     
      ask fishers [
        if any? my-in-links [
          move-to first [other-end] of my-in-links
          set f-boat-type [boat-type] of one-of captains-here 
          ]
      ]     
end 

to spend ;;daily cost of living is taken away from balance. same for captains and fishers. 
  if hours = 7 and minutes = 0 [
    ask fishers [
      set f-balance f-balance - cost-of-living
    ]
    ask captains [
      set cpt-balance cpt-balance - cost-of-living
    ]
  ]
end 

to income
  ask captains with [status = "fishing"][ ;; income is fishcatch* 200 - 200 KSH earned for each kg of fish caught. *same amount for each type of fish*
    if boat-type = "canoe" [
      set cpt-income ((([c-fish-catch] of min-one-of canoes [distance myself] ) * 200) * 0.75) ;; 75% of the income goes to the captain
    ]
    if boat-type = "m-canoe" [
      set cpt-income ((([m-fish-catch] of min-one-of m-canoes [distance myself] ) * 200) * 0.67) ;; 67% of the income goes to the captain
  ]
    if boat-type = "b-boat" [
      set cpt-income ((([b-fish-catch] of min-one-of b-boats [distance myself] ) * 200) * 0.51) ;; 51% of the income goes to the captain
    ]
  ]
  
  ask fishers with [f-status = "fishing"] [
    if f-boat-type = "canoe" [
      set f-income ((([c-fish-catch] of min-one-of canoes [distance myself] ) * 200) * 0.25) ;; 25% goes to the fisher
    ]
    if f-boat-type = "m-canoe" [
        set f-income ((([m-fish-catch] of min-one-of m-canoes [distance myself] ) * 200) * 0.11) ;; 11% goes to each fisher
    ]
    if f-boat-type = "b-boat" [
      set f-income ((([b-fish-catch] of min-one-of b-boats [distance myself] ) * 200) * 0.7) ;; 7% goes to each fisher
    ]
]
end 

to board ; captains and fishers move to their boats
  ask captains with [boat-type = "canoe"] [
    if status = "crew-chosen" [
      move-to one-of canoes with [not any? my-links]
      create-boat-link-with min-one-of canoes [distance myself] [tie]
      set status "boat-chosen"
        ]
  ]
  ask captains with [boat-type = "m-canoe"] [
    if status = "crew-chosen" [
      move-to one-of m-canoes with [not any? my-links]
      create-boat-link-with min-one-of m-canoes [distance myself] [tie]
      set status "boat-chosen"
        ]
  ]
  ask captains with [boat-type = "b-boat"] [
    if status = "crew-chosen" [
      move-to one-of b-boats with [not any? my-links]
      create-boat-link-with min-one-of b-boats [distance myself] [tie]
      set status "boat-chosen"
        ]
  ]
end 

to go-home ; kill the links and return to land
  ask captains [
    if status = "release-crew" [
      ask my-links [die]
      move-to one-of land
    
    ask fishers [
      move-to one-of land
    ]
    ask canoes [
      move-to one-of coast
      set c-fish-catch 0
    ]
    ask m-canoes [
      move-to one-of coast
      set m-fish-catch 0
    ]
    ask b-boats [
      set b-fish-catch 0
      move-to one-of coast
    ]
    set status "home"
    ]
   ]
end 

to deplete-fish ;; fish stocks and size of schools affected by fishing
  ask canoes [
    avoid-coast
    if any? rabbitfishes in-radius (size / 2) with [ size > 2] [ ; fish caught when boats are on the school of fish, only is the school is over *certain size*
      let cfc ([r-fish-stock] of min-one-of rabbitfishes [distance myself] * 0.001);; here fc is temp fish catch so that the cumulative catch throughout the day is c-fish-catch, *0.1% of fish caught*
      set c-fish-catch c-fish-catch + cfc
     
      ask rabbitfishes in-radius (size / 2) with [ size > 2] [
        set r-fish-stock (r-fish-stock - (r-fish-stock * 0.001))
        set size r-fish-stock / 100
    ]
   ]
  ]
  
  ask m-canoes [
    avoid-coast
    if any? kingfishes in-radius (size / 2) with [ size > 2] [
     let mfc ([k-fish-stock] of min-one-of kingfishes [distance myself] * 0.001)
     set m-fish-catch m-fish-catch + mfc
      
      ask kingfishes in-radius (size / 2) with [ size > 2] [
        set k-fish-stock (k-fish-stock - (k-fish-stock * 0.001))
        set size k-fish-stock / 100
    ]
   ]
    
  ]
  
  ask b-boats [
    avoid-coast 
    if any? tunas in-radius (size / 2) with [ size > 2] [
      let bfc ([t-fish-stock] of min-one-of tunas [distance myself] * 0.001)
      set b-fish-catch b-fish-catch + bfc
      
      ask tunas in-radius (size / 2) with [ size > 2] [
        set t-fish-stock (t-fish-stock - (t-fish-stock * 0.001))
        set size t-fish-stock / 100
    ]
   ]
    
  ]
end 

to fish-vessels ;moving around in the sea and hovering over schools of fish
  ask canoes [
    if c-status = "fishing" [
      right random 360 fd 2
    
      if any? rabbitfishes in-radius size [
        move-to min-one-of rabbitfishes [distance myself]
    ]
      avoid-coast
      avoid-vessels
      deplete-fish
   ]
  ]
  ask m-canoes [
    if m-status = "fishing" [
      right random 360 fd 3
    
      if any? kingfishes in-radius size [
        move-to min-one-of kingfishes [distance myself]
    ]
      avoid-coast
      avoid-vessels
      deplete-fish
   ]
  ]
  ask b-boats [
    if b-status = "fishing" [
      right random 360 fd 4
    
      if any? tunas in-radius size [
        move-to min-one-of rabbitfishes [distance myself]
    ]
      avoid-coast
      avoid-vessels
      deplete-fish
   ]
  ]
end 

to leave-vessels ; set off from the coast
  ask canoes [
    if c-status = "leaving" [
    avoid-coast
    face one-of sea 
    forward random 5
    ]
 ]
  ask m-canoes [
    if m-status = "leaving" [
    avoid-coast
    face one-of sea 
    forward random 5
    ]
 ]
  ask b-boats [
    if b-status = "leaving" [
    avoid-coast
    face one-of sea 
    forward random 5
    ]
 ]
end 

to return-vessels ; return at the end of the session to BMU
  ask canoes [
  if c-status = "returning"[
      face one-of BMUs
      forward 5
      ]
     ]
  ask m-canoes [
  if m-status = "returning"[
      face one-of BMUs
      forward 5
      ]
     ]
  ask b-boats [
  if b-status = "returning"[
      face one-of BMUs
      forward 5
      ]
     ]
end 

to avoid-vessels ; avoid other vessels, the radius depending on each type of boat
    ask canoes [
    if any? (turtle-set canoes m-canoes b-boats) in-radius 5 [
    if-else any? neighbors with [not any? (turtle-set canoes m-canoes b-boats)] 
    [
      move-to one-of neighbors with [not any? (turtle-set canoes m-canoes b-boats)]
      ]
    [
    ]
  ]
    ]
    ask m-canoes [
    if any? (turtle-set canoes m-canoes b-boats) in-radius 10 [
    if-else any? neighbors with [not any? (turtle-set canoes m-canoes b-boats)] 
    [
      move-to one-of neighbors with [not any? (turtle-set canoes m-canoes b-boats)]
      ]
    [
    ]
  ]
    ]
    ask b-boats [
    if any? (turtle-set canoes m-canoes b-boats) in-radius 15 [
    if-else any? neighbors with [not any? (turtle-set canoes m-canoes b-boats)] 
    [
      move-to one-of neighbors with [not any? (turtle-set canoes m-canoes b-boats)]
      ]
    [
    ]
  ]
    ]
end 

to avoid-coast ;; keeps fish and boats away from the land
    if [ pcolor ] of patch-here = 106 [
      face min-one-of sea [distance myself]
      fd 0.1
      ]
end 

to change-in-size [ n ] ;;changes population of fish
    ask rabbitfishes [
      if any? reef in-radius 1 and reef-health > 10 [ ;grows when near reef and reef-health over *certain amount*
        if size < 10  [
           let change 1 + random 5 ; *equation of population size change*
           set size size + change
        ]
      ]
    ]
    ask kingfishes [
      if any? reef in-radius 1 and reef-health > 10 [
        if size < 10  [
           let change 1 + random 5  
           set size size + change
        ]
      ]
    ]
    ask tunas [
      if any? reef in-radius 1 and reef-health > 10 [
        if size < 10  [
           let change 1 + random 5 
           set size size + change
        ]
      ]
    ]
end 

to move-fishes ; all move randomly in the same way
    ask rabbitfishes [
      set heading heading + (20 - random 40)
      fd 0.1 
    avoid-coast
    change-in-size size 
    ]
    ask kingfishes [
      set heading heading + (20 - random 40)
      fd 0.1 
    avoid-coast
    change-in-size size 
    ]
    ask tunas [
      set heading heading + (20 - random 40)
      fd 0.1 
    avoid-coast
    change-in-size size 
    ]
end 

to damage-reef ;; reef damaged by boats which affects if fish stock can replenish
  ask reef [
    if any? canoes in-radius 5  or any? m-canoes in-radius 5 or any? b-boats in-radius 5[
      set reef-health reef-health - 0.5
    ]
  ]
end  

to bad-weather
  if ticks = storm-freq * random 10[ ;;every *storm-freq* a storm happens, for 10 storms....
    ask one-of deep [
      sprout-storms 1 [
      set size 20
      set shape "circle"
      set color [black 0 0 100]
     ]
      ask patch -8 15 [
        sprout-black-flags 1 [ ; black flag goes up for dangerous fishing
          set size 10
          set shape "flag"
          set color black
        ]
      ]
    ]
   ]
  ask storms [ ; move towards coast and grow
    set size size + 1
    face min-one-of coast [distance myself] 
    fd 10
    if size > 200 [
      ask black-flags [die]
      die
      ]
 ]
end 

to timings ; used to set statuses depending on the time of day. the statuses are used to call the other functions
  
ask captains [
  if cpt-decision = "yes" [
    if hours = 1 and minutes = 30 [
      set status "choosing-crew"
  ]
    if hours > 2 and minutes > 10 and hours < 5 [
      set status "fishing"
  ]
    if hours = 6 and minutes = 0[
      set status "release-crew"
  ]
 ]
]

ask fishers [
  if f-decision = "yes" [
  if hours > 2 and minutes > 10 and hours < 5 [
    set f-status "fishing"
  ]
]
]
  
 
ask canoes [
  if any? captains-here [
    if hours = 2 and minutes = 0 [
      set c-status "leaving"]
    if hours > 2 and minutes > 10 and hours < 5 [
      set c-status "fishing"]
    if hours = 5 or any? black-flags [
      set c-status "returning"]
    if hours >= 6 [
      set c-status "home"]
  ]
]

ask m-canoes [
  if any? captains-here [
    if hours = 2 and minutes = 0 [
      set m-status "leaving"]
    if hours > 2 and minutes > 10 and hours < 5 [
      set m-status "fishing"]
    if hours = 5 or any? black-flags [
      set m-status "returning"]
    if hours >= 6 [
      set m-status "home"]
  ]
]

ask b-boats [
  if any? captains-here [
    if hours = 2 and minutes = 0 [
      set b-status "leaving"]
    if hours > 2 and minutes > 10 and hours < 5 [
      set b-status "fishing"]
    if hours = 5 or any? black-flags [
      set b-status "returning"]
    if hours >= 6 [
      set b-status "home"]
  ]
]
end 

to clock
  set minutes minutes + 1 
  
  if minutes = 60 [
    set hours hours + 1
  ]
  
  if minutes = 60 [
    set minutes 0
  ]
  
  if hours = 24 [
    set day day + 1
  ]
  
  if hours = 24 [
    set hours 0 
  ]
  
  ask spinners [
    set heading hours * 30
    set label hours
  ]
end 

There are 6 versions of this model.

Uploaded by When Description Download
Richard Taylor over 11 years ago Reverted to older version Download this version
Richard Taylor over 11 years ago Reverted to older version Download this version
Richard Taylor over 11 years ago I have tried to correct the path to the map Download this version
Richard Taylor over 11 years ago I have tried to correct the path to the map Download this version
Richard Taylor over 11 years ago I have tried to correct the path to the map Download this version
Ankita Anirban over 11 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Beach Management Unit Kenya.png preview screenshot almost 11 years ago, by Richard Taylor Download
mombasa-coast.jpg jpeg Map almost 11 years ago, by Ankita Anirban Download

This model does not have any ancestors.

This model does not have any descendants.