EAT-WHEN-HUNGRY
Begin NetLogo code:whenever [random-number-between 0 1 <= .75 and my-hunger > 50 and can-pick-one all-individuals with [distance-to-me < 5]] [add-behaviour-to the-other DIE add-behaviour-to-me REDUCE-HUNGER]End NetLogo code
The level of hunger and the distance to the potential prey can be changed. Other conditions can be used.
This relies upon DIE and REDUCE-HUNGER. DIE-WHEN-TOO-HUNGRY is the behaviour for starving if too hungry. GROW-HUNGRY steadily increases hunger.
Whenever a random number between 0 and 1 turns out to be less than .75 (i.e. 75% of the time) and my-hunger is greater than 50 and anyone is less than 5 units away.
This was implemented by Ken Kahn.