hatch
hatch-<breeds>

hatch number [ commands ]
hatch-<breeds> number [ commands ]
Turtle Command

This turtle creates number new turtles. Each new turtle is identical to, and at the same location as, its parent. The new turtles then run commands. You can use the commands to give the new turtles different colors, headings, locations, or whatever. (The new turtles are created all at once, then run one at a time, in random order.)

If the hatch-<breeds> form is used, the new turtles are created as members of the given breed. Otherwise, the new turtles are the same breed as their parent.

Note: While the commands are running, no other agents are allowed to run any code (as with the without-interruption command). This ensures that if ask-concurrent is being used, the new turtles cannot interact with any other agents until they are fully initialized.

hatch 1 [ lt 45 fd 1 ]
;; this turtle creates one new turtle,
;; and the child turns and moves away
hatch-sheep 1 [ set color black ]
;; this turtle creates a new turtle
;; of the sheep breed

See also create-turtles, sprout.

Take me to the full NetLogo Dictionary