The short answer is that you created the procedure to update patch colours but you never told NetLogo to run it. You probably want to add a line to your go procedure, I think this order:
to go
if not any? turtles with [wealth > 0] [stop]
move-turtles
spend
color-patches ; this is what you are missing
tick
end
This is not relevant to your question, but I also noticed that you have this code for moving:
to move-turtles ;; turtles to stop once they are spend all their wealth
ask turtles [
ifelse wealth > 0
[rt random 360 forward 1]
[stop]
]
end
You don't need to ask every turtle and then use stop
to exit for some of them, instead it is generally easier to filter the turtles using with
. So that code could be replaced with:
to move-turtles
ask turtles with [wealth > 0] [
rt random 360
forward 1
]
end
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…