我正在尝试制作一个 NetLogo 模型来模拟木材燃料的竞争。该模型由两个海龟品种组成:“家庭”和“树木”,随机分布在世界各地。家庭拥有的[燃料储存目标半径]。当fuel-store = 0时,家庭在最小半径1内“找到”一棵新树,如果没有树木直到达到最大半径,则将半径增加1,使用以下程序:
to FindFuelGo
ask households [
if fuel-store = 0 [
set target min-one-of trees in-radius radius [ distance myself ]
if not any? trees in-radius radius [
if radius != max-radius [
set radius radius + 1
]
]
然而,由于这个模型是模拟竞争,我如何测试一个家庭是否与另一个家庭有相同的目标(在模型运行时不可避免地会这样),如果它确实将目标分配给距离最短的家庭目标?我努力了:
ask households [
let me self
let others other households
if target != nobody [
if [ target ] of me = [ target ] of others [
首先至少确定任何具有相同变量的家庭,但这不起作用。任何想法将不胜感激。