LOGO-L> StarLogo: How does "clone" keep track of turtles? 
Author Message
 LOGO-L> StarLogo: How does "clone" keep track of turtles?

StarLogo fans,

I recently read "Turtles, Termites, and Traffic Jams" with much
interest and have a language implementation question on the "clone"
function on page 116.

The turtle procedure on page 116 describes a StarLogo version of tree
drawing using parallel recursion.  The program has draw-branch-demon
that runs again and again.  On each execution, the turtle moves
forward with its pen down.  When it is finished, it clones itself
twice and it dies.  Each of the two turtles draws the line and when
done, clones itself twice and dies.  Then four becomes eight, and so
on until the length to draw becomes too small.  The following is the
actual draw-branch-demon:

        to draw-branch-demon
        ifelse length-gene < 2
           [die]
           [forward length-gene
            clone [mutate-length-gene left 45]
            clone [mutate-length-gene right 45]
            die]
        end

While I can understand "create-turtles 360" can create an array of
turtle objects like turtle[0] to turtle[359] so that computer can keep
track of different turtles, I am puzzled as to how the computer can
keep track of one turtle from another when the "clone" function is
used.  

Your reply is appreciated.

Kenneth Cho

---------------------------------------------------------------





Sun, 05 Dec 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. LOGO-L> Turtle Tracks

2. LOGO-L>My DOS turtle needs to become an NT turtle

3. LOGO-L> copydef "fin "end

4. "ls" of only hidden files

5. Enhancing "ls -l" file listing abilities

6. couldn't execute "ls": argument list too long

7. Read "ls" output into list variable

8. exec "ls" in remote directory

9. Developing "Quicken" clone -- advice wanted

10. dup, clone, and "deep copy"

11. "Talking turtle"

12. Logo for MS-DOS ("rich logos")

 

 
Powered by phpBB® Forum Software