我有一些自己环顾四周的乌龟。对于他们每个邻居,他们保存了“输出热量”的值。具有最高值的贴片将获得最高概率,并且最低值是最低概率。我希望乌龟移动到另一个补丁。移动应该取决于概率。 我的代码看起来是这样,但它不能正常工作像它应该: ask turtles-here[
let temp_ahead [(output-heat + 1)^ Freedom] of patch-at 0 1
let t
我已经创建了一个补丁自己的变量,每次代理登陆一个特定的补丁后,它会增加“1”。 它每下降一点也减少0.1。 到目前为止的代码看起来是这样的 to go-predation-risk
ask patch-here [
set predation-risk predation-risk + 1]
end
to deduct-predation-risk
ask pa
如何制作其他清单的累积金额清单? 我想这样的说法: ;;all temperatrue-values around the turtle saved in list
set temperature_values (list [(output-heat + 1)^ Freedom] of neighbors)
;;build cumulative value of temperatures
对不起,如果我讨厌你,但我的老师说这个代码[1]不够好,我应该使用代理集而不是个体值。 代码[1](第一个代码工作很不错) let temp_ahead [(output-heat + 1)^ Freedom] of patch-ahead 1
let temp_right_ahead [(output-heat + 1)^ Freedom] of patch-right-and-ahead 4