I want to delete only turtle pen lines from a halfway point in a model run. The "clear-drawing" primitive seems to achieve that, but my problem is that I can't run it directly from an agent, or use "ask observer [clear-drawing]". Is there a way to trigger this observer command from an agent context (I expect not), or is there another way of erasing turtle pen lines? My solution to re-draw using pens having the background color is rubbish.
Asked
Active
Viewed 1,782 times
1 Answers
2
Instead of redrawing using the background color, use pen-erase
. If that's equally “rubbish”, perhaps you want something more like the answers here? NetLogo turtles leaving a trail that fades with time
About clear-drawing
being observer-only though, that seems like it shouldn't be too hard to work around, something like:
to go
let clear? false
ask turtles [
...
if ... [
set clear? true
]
...
]
if clear? [ clear-drawing ]
tick
end

Community
- 1
- 1

Seth Tisue
- 29,985
- 11
- 82
- 149
-
-
thanks Seth, I had not thought of using a global Boolean to trigger an event in the go loop. Neat solution. – grrover Dec 14 '15 at 09:14