NetLogo
NetLogo is a multi-agent programmable modeling environment designed for simulating natural and social phenomena, particularly complex systems that emerge from the bottom-up interactions of numerous individual agents.[1] It enables users to explore connections between micro-level behaviors of agents and macro-level patterns, supporting both interactive exploration of simulations and custom model creation through a simple, Logo-based programming language.[1] Authored by Uri Wilensky in 1999, NetLogo has been under continuous development at Northwestern University's Center for Connected Learning and Computer-Based Modeling (CCL), evolving as an extension of earlier languages like StarLogo to facilitate cross-platform use via the Java Virtual Machine.[1][2] At its core, NetLogo features three primary agent types: turtles, mobile entities that represent individuals such as animals, vehicles, or people moving in a two-dimensional world; patches, the static grid points forming the environment like terrain or cells; and links, dynamic connections that model relationships between turtles or between turtles and patches.[1] Users program agent behaviors using primitives for movement, interaction, and observation, allowing simulations to run in parallel across thousands of agents without explicit synchronization.[2] The environment includes an extensive Models Library with hundreds of pre-built simulations spanning biology, physics, economics, and social sciences, alongside tools like BehaviorSpace for systematic experimentation and analysis.[1] As a free and open-source tool, NetLogo emphasizes accessibility, with a low threshold for beginners yet no ceiling for advanced applications.[1][3] NetLogo is widely employed in education to teach computational thinking, scientific inquiry, and complex systems concepts, often integrated into curricula for K-12 through university levels.[2] In research, it supports investigations into emergent phenomena, such as flocking behaviors, epidemic spreading, or market dynamics, and has been extended through extensions for 3D modeling, network analysis, and integration with other software.[2] Its design philosophy prioritizes multiple levels of description—agent-level rules alongside observer perspectives—making it suitable for interdisciplinary work in fields like ecology, sociology, and computer science.[1]Introduction and History
Overview
NetLogo is an open-source, multi-agent programmable modeling environment for simulating natural, social, and engineered phenomena.[4] It allows users to construct models where populations of decentralized agents interact locally to generate complex emergent behaviors, making it particularly suited for exploring systems in fields like biology, economics, and urban planning.[4] The environment balances simplicity and depth, targeting educators, researchers, and students from middle school through graduate levels.[5] Its intuitive interface lowers the entry barrier for beginners while offering advanced customization for expert users, fostering computational thinking and scientific inquiry across educational and professional contexts.[4] At its core, NetLogo features turtles as mobile agents that navigate the simulation space, patches as static grid cells forming the underlying landscape, links for representing connections between agents, and an observer perspective for controlling and monitoring the overall model.[4] Evolving from the Logo programming language traditions, it emphasizes visual and interactive programming.[6] As free software under the GNU General Public License, NetLogo is actively maintained by Northwestern University's Center for Connected Learning and Computer-Based Modeling (CCL).[7]Development History
NetLogo was created in 1999 by Uri Wilensky at Northwestern University's Center for Connected Learning and Computer-Based Modeling (CCL) as part of initiatives to democratize agent-based modeling of complex systems for researchers, educators, and students.[8] The software's initial public release, version 1.0, arrived in April 2002, marking the start of its widespread adoption.[9] From its launch, NetLogo has undergone continuous development at CCL, initially implemented in Java for cross-platform compatibility.[10] Key milestones include the addition of 3D modeling support in version 5.0, released in February 2012, which expanded visualization options for spatial simulations.[9] Version 6.0, launched in 2017, introduced a partial rewrite using Scala alongside Java, enhancing extensibility, and debuted a web runtime enabling models to run in browsers via JavaScript compilation.[11][12] The most recent major update, version 7.0.0, was released in September 2025, followed by version 7.0.2 in October 2025, which included improvements to the graphical user interface, updates to the model file format for better compatibility, and revisions to several models in the built-in library.[13][14] Over its more than 25 years of evolution, NetLogo has benefited from institutional support within Northwestern's Connected Learning framework and active contributions from a global open-source community via GitHub.[3] NetLogo's influence extends to academia, where it has been employed in over 10,000 research papers across disciplines like ecology, social sciences, and epidemiology, as well as in numerous educational programs to teach computational thinking and systems dynamics.[15] In September 2025, Uri Wilensky was awarded the Yidan Prize for Education Research for his pioneering work in agent-based modeling and complex systems literacy, much of which centers on NetLogo.[8] It builds on the Logo language tradition, refining multi-agent paradigms from earlier tools like StarLogo to prioritize accessibility.[2]Core Features
Agent-Based Modeling Primitives
NetLogo's agent-based modeling is built upon four primary types of agents that represent the fundamental entities in simulations: turtles, patches, links, and the observer. Turtles are mobile agents that move across the environment, each occupying a position defined by decimal coordinates (xcor, ycor), and they can be specialized into breeds to represent distinct categories, such as sheep or wolves, using thebreed primitive (e.g., breed [sheep a-sheep]).[16] Patches form a fixed two-dimensional grid representing the static environment, with each patch at integer coordinates (pxcor, pycor) and capable of holding variables like color or chemical levels. Links are dynamic connections between turtles, modeling relationships or networks without independent positions, and they automatically dissolve if an endpoint turtle dies. The observer serves as the top-level controller, lacking a location and issuing global commands to other agents while overseeing the simulation.
At the core of NetLogo's design is a decentralized modeling paradigm, where complex global behaviors emerge bottom-up from simple, local rules applied independently to each agent, eschewing central control to mimic natural systems. This approach encourages modularity, with agentsets—collections like turtles or patches—processed in random order during execution to avoid artificial synchronization biases.
Key primitives enable the creation, manipulation, and querying of agents. Commands such as create-turtles n instantiate n new turtles at the origin with random headings and colors (e.g., create-turtles 50), while breed-specific variants like create-sheep 20 populate specialized agents.[17] The ask command delegates instructions to an agentset, allowing parallel execution of behaviors (e.g., ask turtles [ set color green forward 1 ] directs all turtles to turn green and move forward one unit). Movement is handled by primitives like forward n or back n, which advance or retreat a turtle by n units along its heading. Reporters provide data, such as count agentset to tally agents (e.g., count turtles returns the number of turtles) or distance target to measure Euclidean distance to another agent or location (e.g., distance patch 5 0). These primitives, run by appropriate agents (e.g., turtles for movement, observer for creation), form the syntax for defining procedures in NetLogo's Logo dialect.[18]
Spatial modeling in NetLogo revolves around a grid-based coordinate system centered at (0, 0), with the world size configurable (defaulting to 33x33 patches, or -16 to 16). The topology can be set to a torus (wrapping edges seamlessly), unbounded, or cylindrical variants via the settings, enabling simulations of periodic boundaries like planetary surfaces. Patch neighborhoods support local interactions, using Moore neighborhoods (8 surrounding patches, via neighbors) for inclusive adjacency or von Neumann neighborhoods (4 orthogonal patches, via neighbors4) for cross-like proximity, facilitating rules like diffusion or predation.
Time in NetLogo advances through discrete ticks, managed by the tick command to increment a global counter and update views or plots, or tick-advance dt for finer-grained continuous time (e.g., tick-advance 0.1). The reset-ticks primitive initializes the counter at setup. In basic models, agent actions occur randomly within each tick via ask, but advanced versions leverage the Time extension for event-based scheduling with primitives like schedule to queue procedures at specific future ticks, supporting irregular or priority-driven dynamics.[19]
User Interface and IDE
NetLogo's user interface is organized into multiple tabs that support the creation, editing, and execution of agent-based models. The Interface tab displays the model's world view and contains draggable widgets, including sliders for adjusting global variables, switches for toggling boolean states, plots for graphing data over time, and monitors for displaying real-time values from agents or the environment.[20] These widgets can be aligned precisely using the "Snap to Grid" option, enabling users to build interactive control panels without coding the interface layout.[20] The Code tab houses an integrated text editor where users write procedures in the NetLogo language, featuring syntax highlighting in both light and dark themes to improve readability and catch errors early.[21] The Info tab provides space for model documentation, including descriptions, instructions, and credits, which is essential for sharing and understanding models.[20] Additionally, a 3D view option is accessible via the Tools menu, allowing users to visualize and interact with three-dimensional extensions of models.[20] Model building follows a straightforward workflow: users drag and configure widgets onto the Interface tab to define user inputs and outputs, then implement the logic by writing procedures such assetup for initialization and go for iterative steps in the Code tab.[20] Execution begins by clicking buttons linked to these procedures or using the Command Center, an interactive console at the bottom of the Interface tab for entering and running ad-hoc commands to test model behavior.[20]
Debugging is facilitated through the Command Center for executing isolated commands and observing effects, along with agent-specific monitors—such as turtle, patch, or link monitors—that allow inspection and modification of individual variables.[20] The editor highlights syntax errors, and users can step through code indirectly by advancing ticks manually or using primitives like wait for pauses during runs.
Visualization tools include speed controls via a slider to adjust the simulation pace from slow (for detailed observation) to fast (for quick overviews), and view update modes that toggle between continuous redrawing for smooth animation or discrete updates tied to model ticks for precise event-based rendering.[20] Export options support capturing the view as PNG images through "File > Export View" or recording videos using the Vid extension, which generates H.264-encoded MP4 files for sharing simulations.[22]
For broader accessibility, NetLogo integrates with a web runtime called NetLogo Web, enabling models to run directly in modern browsers without installation, including on mobile devices.[23] Users can export desktop models as HTML via "File > Save As NetLogo Web" for browser execution, though this version imposes limitations, such as incomplete support for extensions beyond a bundled set (e.g., no file or movie primitives in some cases).[23][20]
Technical Foundation
Programming Language
NetLogo's programming language is a descendant of the Logo programming language, originally developed in the late 1960s for educational purposes, and extends its block-structured, imperative paradigm to support multi-agent simulations.[2] Unlike traditional Logo, which typically features a single "turtle" for graphics and movement, NetLogo enables the creation and management of thousands of autonomous agents, such as turtles and patches, to model complex emergent behaviors in natural and social systems.[2] This heritage emphasizes accessibility, with a "low threshold, high ceiling" design that allows beginners to start with simple commands while enabling advanced users to build sophisticated models through procedural extensions.[24] At its core, NetLogo syntax revolves around defining procedures using theto keyword followed by the procedure name and optional inputs, with the body enclosed in a block ended by end; for example, a basic setup procedure might be written as to setup clear-all create-turtles 100 end.[24] Variables are declared globally with globals [list-of-variables], such as globals [population], or owned by specific breeds of agents, like turtles-own [energy speed] for turtle-specific attributes, promoting organized data management across agent populations.[24] The language distinguishes between commands, which perform actions without returning values (e.g., forward 1 or set color red), and reporters, which compute and return values for use in expressions (e.g., count turtles or mean [energy] of turtles).[24] This separation ensures clear semantics, where reporters can be embedded in other commands or reporters, facilitating concise model logic.
A hallmark of NetLogo's semantics is its approach to parallelism through the ask command, which applies a block of instructions concurrently to an agentset—a collection of agents filtered by conditions, such as ask turtles with [color = red] [forward 1 set energy energy - 1].[24] Agentsets are processed in random order to avoid unintended biases in simulations, simulating concurrency without true multithreading; this deterministic yet non-sequential execution allows agents to act independently, mimicking real-world decentralized systems while maintaining reproducibility.[2] For instance, the observer (the top-level context) can initiate model dynamics by issuing ask commands to breeds, enabling emergent patterns from local interactions.[24]
Control structures in NetLogo include familiar imperative elements adapted for agent contexts: loops via repeat count [commands] for fixed iterations, such as repeat 10 [forward 1], or while [condition] [commands] for conditional repetition, like while [any? turtles with [energy < 0]] [ask turtles [set energy 0]].[24] Conditionals use if condition [commands] for single-branch decisions or ifelse condition [then-commands] [else-commands] for branching, often applied within ask blocks to govern agent behaviors, e.g., ask turtles [ifelse energy > 50 [set color green] [set color red]].[24] Reporters integrate seamlessly into these structures, such as using mean [energy] of turtles in a while condition to monitor aggregate states.[24]
NetLogo's extensibility stems from its support for user-defined procedures, declared as commands with to or as reporters with to-report (ending with report value), allowing modular code reuse across models.[24] Breed-specific procedures enable tailored behaviors, where code for one breed (e.g., to go-sheep) can reference breed-owned variables without classes or inheritance, fostering agent-oriented programming; for example, ask sheep [set energy energy - 1 if energy < 0 [die]] confines logic to sheep agents.[24] This design avoids object-oriented complexity, prioritizing simplicity while accommodating hierarchical agent structures through ownership and custom extensions.[2]
Implementation and Platforms
NetLogo's core implementation is primarily written in Scala since version 6.0, incorporating some legacy Java components for interoperability; the entire codebase compiles to Java Virtual Machine (JVM) bytecode, enabling high-performance execution across compatible environments.[25][26] The runtime environment utilizes an interpreter to execute NetLogo procedures, with performance optimizations introduced in version 5.0 and refined in subsequent releases through partial compilation of model code to JVM bytecode, allowing for faster simulation runs without full just-in-time compilation.[26] This hybrid approach balances the flexibility of interpreted execution for rapid prototyping with compiled efficiency for demanding computations. NetLogo supports desktop applications on Windows (versions 11 through Vista), macOS, and Linux distributions, distributing bundled Java runtimes to ensure broad compatibility.[27] For web-based use, NetLogo Web offers a platform-independent alternative that compiles NetLogo models directly to JavaScript, executing simulations within modern browsers via HTML5 and JavaScript engines, thus extending accessibility to devices without JVM support.[23][28] Version compatibility is maintained through comprehensive transition guides, such as those for upgrading from 5.x to 6.x and 6.x to 7.x, which detail syntax adjustments and API changes; notably, version 7.0 introduced the extensible .nlogox file format (and .nlogox3d for 3D models), while preserving the ability to load and convert older .nlogo and .nlogo3d files.[29][21] Performance considerations focus on scalability for agent-based models, where optimized implementations can manage populations of up to millions of agents by leveraging efficient data structures and user-configurable memory allocation—via JVM heap size adjustments in netlogo.conf or command-line flags—to handle simulations requiring hundreds of megabytes to gigabytes of RAM.[6][30] As an open-source project, NetLogo's source code is maintained in a public GitHub repository, facilitating community contributions through pull requests, issue reporting, and collaborative development under the GPL license.[3]Modeling Resources
Models Library
The NetLogo Models Library is a curated collection of pre-installed example models that accompany every NetLogo download, enabling users to immediately explore agent-based simulations without building from scratch. These models demonstrate diverse applications of the platform, from natural phenomena to social dynamics, and are designed primarily as educational tools to foster understanding of complex systems through experimentation. All models in the library are open-source, allowing users to inspect, modify, and extend the code for their own purposes, thereby serving as practical starting points for learning NetLogo's primitives and modeling techniques.[31] The library is structured into distinct sections to support different user needs: Sample Models, which consist of rigorously reviewed, high-quality demonstrations of effective coding and documentation; Curricular Models, which align with educational curricula from the Center for Connected Learning and Computer-Based Modeling (CCL) to integrate modeling into classroom activities; Code Examples, which isolate and illustrate specific NetLogo language features and primitives; and IABM Textbook models, a set of simulations tied to the textbook An Introduction to Agent-Based Modeling: Modeling Natural, Social, and Engineered Complex Systems with NetLogo by Uri Wilensky and William Rand, providing step-by-step implementations of key concepts in agent-based modeling.[31] Within the Sample Models section, models are grouped into thematic categories such as Biology, Social Science, Physics, and Mathematics to highlight interdisciplinary applications. The Biology category includes models like Wolf Sheep Predation, which implements Lotka-Volterra predator-prey dynamics where wolves hunt sheep, sheep consume grass that regrows over time, and populations exhibit oscillatory patterns influenced by energy parameters; and Ants, simulating foraging behavior where ants follow and deposit pheromone trails to locate food sources efficiently, demonstrating emergent self-organization. In Social Science, representative examples are Traffic Basic, a grid-based simulation of vehicle movement through intersections with traffic lights and phases, revealing how individual driver rules lead to global traffic jams or smooth flow; and Voting, where agents on a grid update opinions based on neighbors, modeling the spread of ideas or political polarization. The Physics category features Gas Lab: Bumping Into Things, which models ideal gas behavior with particles colliding elastically to illustrate kinetic theory concepts like pressure and temperature; while Mathematics includes Life, a cellular automaton based on Conway's Game of Life rules that generates complex patterns from simple initial conditions, and models exploring chaos such as the Logistic Map to show sensitivity to initial parameters. These categories collectively cover over 150 models, emphasizing conceptual exploration over exhaustive listings. Curricular Models extend this foundation with education-oriented examples, such as Epidemiology variants that simulate disease transmission in populations to teach public health concepts, often incorporating sliders for vaccination rates and recovery times. Code Examples focus on technical showcases, like Ask Example to demonstrate agent scheduling or Plotting Example for visualizing data trends, aiding programmers in mastering syntax without full simulations. The IABM Textbook section mirrors chapters from the referenced book, with models like Segregation adapting Schelling's spatial segregation theory, where agents relocate based on neighbor similarity thresholds to reveal unintended clustering outcomes. With the release of NetLogo 7.0 in 2025, the Models Library underwent revisions including compatibility adjustments for the new extensible .nlogox file format and the addition of several updated models to reflect modern extensions and best practices.[32]Modeling Commons
The Modeling Commons is a web-based collaborative platform hosted by the Center for Connected Learning and Computer-Based Modeling (CCL) at Northwestern University, designed for sharing and discussing user-contributed agent-based models created in NetLogo. Launched around 2010, it serves as an open repository where modelers from around the world can upload, download, modify, and create variations of models, promoting iterative development and knowledge exchange within the NetLogo community.[33][34] Key features of the Modeling Commons include built-in version control, accessible via a "history" tab that retains all revisions of a model, allowing users to review or restore earlier versions. Forking is supported through a "family" tab that visualizes parent-child relationships among models, enabling seamless remixing and evolution of simulations. Users can search models by name, keywords, or social tags; upload directly from the NetLogo IDE using the "File > Upload to Modeling Commons" option; and run models instantly in a browser via integration with NetLogo Web. A commenting system facilitates discussions, feedback, and collaboration among registered users, while downloads are available even to unregistered visitors. As of 2025, the platform hosts over 2,000 models, covering niche applications in areas such as ecology, economics, social dynamics, and artificial intelligence simulations, providing a rich resource for researchers and educators beyond the curated built-in Models Library.[35] The community-driven nature encourages remixing of existing models—such as variations on foundational simulations—with requirements for proper citations to original creators, fostering ethical collaboration and educational reuse. Models are downloadable in standard NetLogo formats for direct import into the IDE, supporting seamless workflow integration.Extensions and Advanced Tools
HubNet
HubNet is a client-server architecture integrated into NetLogo for enabling multi-user participatory simulations, where multiple participants can control individual agents or elements of a model in real time to explore emergent phenomena.[36] Introduced in 2000 as part of the Participatory Simulations Project, it allows users to engage directly with complex systems, such as traffic flow or disease spread, fostering collaborative learning and discussion.[36] The system supports a central server running the NetLogo model and distributed clients that receive updates and send inputs, promoting decentralized interaction without requiring participants to manage the full simulation.[37] To set up a HubNet activity, the teacher or facilitator launches NetLogo on a networked computer as the server, either in full GUI mode for visualization or headless for remote operation.[37] Activities are loaded from .nlogo files in the Models Library's HubNet Activities folder, and the session is initialized via thehubnet-reset primitive, which prompts for a session name and opens the HubNet Control Center for managing connections.[38] Clients, traditionally Java-based desktop applications, connect over the local network using the session name; participants log in with unique user-ids to receive personalized interfaces.[37] Recent developments include support for web-based clients through HubNet Web, a browser-compatible platform that extends access to tablets, mobiles, and Chromebooks without installations.[39]
NetLogo includes several built-in HubNet activities to demonstrate core concepts, such as the Traffic Grid (also known as Gridlock), where students control individual cars or traffic lights to simulate urban congestion and observe emergent traffic patterns.[37] Another example is the Disease activity, in which participants act as agents in a population, making choices that affect disease transmission rates and allowing real-time visualization of spread dynamics on the server.[37] Additional activities cover topics like resource management in the Tragedy of the Commons and polling for collective decision-making.[37] These can be extended or customized by authors using HubNet-specific primitives in NetLogo code, such as hubnet-send to transmit data (e.g., position updates or variable values) to a specific client by user-id, or hubnet-broadcast to send information to all connected clients simultaneously.[38]
In educational and research settings, HubNet facilitates classroom discussions on emergence by enabling participants to embody agents, input decisions via client interfaces (e.g., sliders or buttons), and collectively generate data for analysis, such as synchronized plots of system-wide behaviors.[37] It supports real-time data collection from participants, allowing the server to aggregate inputs for immediate feedback and debriefing on strategies like synchronization in traffic simulations.[36]
Updates in NetLogo 7.0 include improved citations and web links in HubNet models.[40] The introduction of HubNet Web provides enhanced synchronization for web clients, enabling smoother multi-device interactions while maintaining compatibility with traditional setups.[39]
Other Extensions
NetLogo extensions provide a modular way to extend the core functionality of the language by adding new primitives, implemented primarily in Java or Scala for the desktop version and JavaScript for NetLogo Web.[41] To incorporate an extension, users declare it at the top of the model's code tab using theextensions directive, such as extensions [gis], which makes the extension's commands and reporters available throughout the model.[41] Extensions are loaded dynamically from locations including the model's directory, the NetLogo installation's extensions folder, or the user's home directory, ensuring flexibility in deployment.[41]
Several key extensions address specialized needs in modeling. The GIS extension enables integration of geospatial data, allowing users to import vector formats like shapefiles for points, lines, and polygons, as well as raster data, and link them to the NetLogo world for spatial analysis.[42] The Network (NW) extension facilitates graph-based modeling with primitives for creating networks, computing metrics like centrality, and algorithms such as shortest path using libraries like JUNG and JGraphT. As of NetLogo 7.0 (September 2025), it supports additional import formats including GEXF, GDF, GML, Pajek NET, UCINET DL, and Netdraw VNA, with fixes for GraphML handling.[43] For numerical computations, the Matrix extension introduces a 2D array data type supporting operations like transposition, inversion, eigenvalues, and multiplication, useful for linear algebra in agent-based simulations.[43] The Sound extension adds audio capabilities, including playback of tones, MIDI notes, and WAV files, to enhance models with auditory feedback. Similarly, the Table extension handles tabular data structures, supporting import/export of CSV files, sorting, grouping, and statistical functions for data manipulation. The Speech extension, bundled since NetLogo 7.0, enables text-to-speech functionality for models.[41]
New extensions introduced in NetLogo 7.0 include the resource extension, which allows retrieval of bundled files (e.g., images, CSVs) packaged with models; the bspace extension, enabling programmatic creation and execution of BehaviorSpace experiments from code; and SimpleR, for running R scripts and integrating statistical analysis within NetLogo models.[32][44]
BehaviorSpace, while not a traditional extension, is a built-in tool for conducting systematic experiments by running models in batch mode, varying parameters across sweeps, and exporting results to tables for analysis, such as sensitivity testing or Monte Carlo simulations.[45] It integrates seamlessly with the IDE, allowing definition of experiments via a graphical interface and automation of repetitive runs.
The 3D extension, available as a separate NetLogo 3D application, supports three-dimensional modeling with features like extruded patches, 3D turtle movement, and visualization, though it remains less mature than the 2D core.[46]
Extensions can be installed through NetLogo's Extension Manager, which lists available packages for one-click download and updates, or manually by placing JAR files (for desktop) or JS modules (for web) in appropriate directories.[47] Compatibility varies: most extensions work in the desktop environment, but NetLogo Web supports a subset, including Matrix, Table, and Sound, with ongoing expansions for browser-based modeling.[48] Users should verify version compatibility, as extensions target specific NetLogo releases like 7.0.2.[41]