I'm trying to modify a previous Netlogo Predator-Prey model to suit my purposes. The trouble I'm running into is that I want to control the probability of the predator killing the prey when there is an encounter and I'm not sure how to go about it. I know I need a slider on the interface side and I have that ('kill-probability') but getting it into the code all together is another matter.
Here is the section of the model I'm trying to adapt:
to catch-sheep ;; wolf procedure
let prey one-of sheep-here ;; grab a random sheep
if prey != nobody ;; did we get one? if so,
[ ask prey [ die ] ;; kill it
set energy energy + wolf-gain-from-food ] ;; get energy from eating
end
Any and all help would be appreciated.