The NetLogo world is made up by four types of agents (see figure 2), i.e.: The NetLogo world is made up of turtles, patches, links and the observer. We say most because in some models part of the code is included within the plots in the interface tab. The Info tab can be used to include the documentation of the model.įinally, the code tab contains most of the code of the model. It often contains buttons, sliders, switches, plots… Most models include a button labeled setup, which is used to initialize the model, and another button labeled go, which is used to run the model. The interface tab is used to run the model. Top bar of the NetLogo Interface tab, where you can select the tab you want to see. The main window of NetLogo contains three tabs, i.e. the interface tab, the info tab and the code tab (see figure 1). For future reference, you may wish to download our NetLogo quick guide, which is a 6-page pdf file containing the main concepts outlined here. Very basicsįeel free to skip this section if you are already familiar with NetLogo. The following table provides links to the different aspects of NetLogo programming that we cover here. By no means do we claim originality on the content of this section all credit should go to Uri Wilensky and his team. It is strongly based on the excellent NetLogo user manual, version 6.1.1 (Wilensky, 2019). Many complex systems can only be investigated by modeling.This section provides a succinct overview of the fundamentals of NetLogo. For systems consisting of a large number of independent objects, such as crowd behavior, the development of multicellular organisms, or military operations, agent modeling is most appropriate. There are many systems designed for this, for example, the Russian proprietary AnyLogic. I want to talk about the NetLogo language, which has proven itself in education, but is also suitable for adult tasks. Logo syntax is minimalistic - a space-separated sequence of names and constants with a rare grouping using or (). Names refer to built-in or programmer-defined entities - functions, variablesĬommands (procedures) are declared to имя įunctions in NetLogo are called “reporters” and are declared slightly differently: are used to create lists and group commands in a block in most constructions, () are ordinary brackets for subexpressions. The compiler knows “arity” (“valency”) about each procedure or function and does not require using the grouping again. True, functions of higher orders may be mistaken - then he needs a hint in the form of parentheses. Then you can write add add inc 1 inc 2 inc 3and get a well-deserved nine. It works the same way map inc which returns a list of. And for add you already have to write brackets ( map add )Īgents come in three forms - turtles (turtle - how can they be without them), communications (link) and spots (patch - they are places in space). Agents of the same type are combined into the corresponding set (agentset) - turtles, links and pathes.įor turtles and relationships, you can specify a user-defined breed. Representatives of the same breed are also combined into a set. A new breed is created by the team breed where ninja is the name of the breed, and ninjas is the name of the collection that brings together all the agents of this breed. There is also a special agent - the observer. The turtles are created with the create-turtles command (with the argument the number of turtles to be created), and then found by the turtle index function. The agent is “first class value” if desired, it can be stored in a variable, but this is rarely required.Īn agent or set of agents can be the context for a team. #Netlogo breeds codeĮxecuting commands in the context of agents is the main mechanism for working with them.Īsk turtles This code will ask all the turtles to take a step forward. The breed can be set dynamically ask turtle 1 #Netlogo breeds PatchĪsk patch 17 13 And this will paint the field with coordinates (17,13) in soft pink.
0 Comments
Leave a Reply. |