Beginners Interactive NetLogo Dictionary
Farsi / Persian
NetLogo Models Library:
Note: If you download the NetLogo application, every model in the Models Library is included.
This code example shows two different ways of visualizing data from LevelSpace child models with a parent model:
The model creates the specified number of turtles who each create a Wolf Sheep Predation child model. For each GO, turtles call GO in their child model, and then move to XY coordinates that reflect the counts of wolves and sheep in their model.
Use NUM-MODELS to decide how many models you want. Press SETUP to create the child models, and GO to run the models and visualize them.
All models start with the same number of wolves and sheep, and roughly the same amount of grass. Even then, we see heterogeneity in their outcomes after just a few ticks.
Try to add a heat map functionality to the model. We suggest adding a patch variable that turtles add to whenever they are on a patch, and then use the
palette:scale primitive to show the spatial distribution over time.
Try to change the code so that, upon setup, all models are created with the same random seed. This will ensure that all models run in the exact same way, and all turtles will keep moving to the same places. Then create a button that sets a new random seed in each model. See how long it takes before your models are so different that you can't even tell that they were exactly the same at some point in their past.
This model uses the LevelSpace extension to create many child models programmatically from inside NetLogo. It uses Headless models, but you can view the state of each model by using the
ls:show <model-id> command. If you want to view all models at the same time, try
ls:show ls:models. But if you have lots of models open, this may slow down your machine considerably.
See the Parent Model Example and the Model Interactions Example.