NetLogo banner

 Home
 Download
 Help
 Resources
 Extensions
 FAQ
 NetLogo Publications
 Contact Us
 Donate

 Models:
 Library
 Community
 Modeling Commons

 User Manuals:
 Web
 Printable
 Chinese
 Czech
 Farsi / Persian
 Japanese
 Spanish

  Donate

NetLogo Models Library:
Code Examples

(back to the library)

Hatch Example

[screen shot]

If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web

WHAT IS IT?

This code example demonstrates the hatch command.

Blue turtles never reproduce. Pink turtles have a one-in-five chance of reproducing at each time tick. Each turtle's life lasts 50 ticks. Nine out of ten baby turtles are blue.

The turtles created by hatch are exact duplicates of their parents, so it is necessary to reset each new turtle's age to 0 inside the hatch command.

(back to the NetLogo Models Library)