Skip to content

Disperse Insect vereinfachen

Wie kann ich das mit den drei breeds am besten vereinfachen? Außerdem die Frage: Lässt sich der dispersal prozess noch effizienter machen?

;>>>> REPORTERS FOR DISPERSAL <<<<

to-report random-dispersal-distance [alpha theta] ;A random-gamma function is used in order to compute random dispersal based on the distances reported by Muehlbauer et al. (2014)
  report random-gamma alpha theta
end

;------------------------------------------------------;

;>>>> DISPERSE INSECTS <<<<

; The dispersal of the emerging insects is modelled based on "stream signatures" by Muehlbauer et al. (2014).
; Stream signatures represent the distance at which abundance of a given organism is at 50% and 10% of its near-stream levels, respectively.
; The respective PDF gamma functions and parameters (alpha, theta) were approximated from percentiles given in the publication.

to disperse-insects
  if spawn-caddisflies? [
    ask caddisflies with [just-spawned? = false] [
      let distance-meters-caddisflies random-dispersal-distance 0.107 (1 / 2237)
      let distance-patches-caddisflies max list (distance-meters-caddisflies / 10) 1
      let tries 0
      let max-tries 5
      let moved? false

      while [tries < max-tries and not moved?] [
        let angle random-float 360
        let dx-val distance-patches-caddisflies * cos angle
        let dy-val distance-patches-caddisflies * sin angle
        let target patch-at dx-val dy-val

        if target != nobody and [is-in-map?] of target and not [is-river?] of target [
          let pesticide-load-caddisflies pesticide-load
          let cohort-size-caddisflies cohort-size
          move-to target
          set moved? true
          ask target [
            let added-load pesticide-load-caddisflies * cohort-size-caddisflies
            set pesticide-burden pesticide-burden + added-load
            set new-pesticide-burden-per-day new-pesticide-burden-per-day + added-load
          ]
          die ; Die after successful transfer
        ]
        set tries tries + 1
      ]
    ]
  ]

  if spawn-mayflies? [
    ask mayflies with [just-spawned? = false] [
      let distance-meters-mayflies random-dispersal-distance 0.122 (1 / 459)
      let distance-patches-mayflies max list (distance-meters-mayflies / 10) 1
      let tries 0
      let max-tries 5
      let moved? false

      while [tries < max-tries and not moved?] [
        let angle random-float 360
        let dx-val distance-patches-mayflies * cos angle
        let dy-val distance-patches-mayflies * sin angle
        let target patch-at dx-val dy-val

        if target != nobody and [is-in-map?] of target and not [is-river?] of target [
          let pesticide-load-mayflies pesticide-load
          let cohort-size-mayflies cohort-size
          move-to target
          set moved? true
          ask target [
            set pesticide-burden pesticide-burden + (pesticide-load-mayflies * cohort-size-mayflies)
          ]
          die ; Die after successful transfer
        ]
        set tries tries + 1
Edited by Justin Büchel