0
我試圖修改以前的Netlogo Predator-Prey model以符合我的目的。我遇到的麻煩是,我想控制捕食者在遭遇獵物時殺死獵物的概率,我不知道如何去解決。我知道我在接口端需要一個滑塊,並且我具有('kill-probability'),但將它們放在代碼中是另一回事。如何控制捕食者在Netlogo Predator-Prey模型中殺死獵物的概率?
這裏是模型我試圖適應的部分:
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
任何和所有幫助將不勝感激。