[starlogo-users] Traffic simulation question
Kent Paul Dolan
xanthian at well.com
Mon Aug 9 17:29:08 EDT 2004
Pablo,
You are assuming that "lastCar" remains the turtle ID of
the most recently created turtle.
However, you are also destroying turtles, and so the
turtle creation mechanism may be reusing turtle IDs,
putting "lastCar" out of synch with the ID of the
newly created turtle, in which case all your "set*"
commands would be addressing a turtle that doesn't
exist.
Probably you need to find a way to directly capture or
control the ID of the newly created turtle to keep its
ID and the value of lastCar in synch.
I haven't touched StarLogo in a couple of years now,
I hope that even makes sense.
xanthian.
More information about the starlogo-users
mailing list