Welcome to the NetLogo programming material designed specifically for this class. We assume students may not have any prior programming experience. And that’s okay! We will walk through the basics of programming in NetLogo, and also learn in class what it feels like building code for modeling social behavior.
Course Overview¶
This course teaches agent-based modeling using NetLogo, a powerful yet accessible programming environment. You’ll learn to create computational models that help answer questions about social phenomena.
This guide follows the same structure as the NetLogo documentation, but it is tailored to our course. It is not a replacement for the official documentation, but rather a complement to it. We own all the credit for this material to Ury Wilensky and the Center for Connected Learning and Computer-Based Modeling at Northwestern University Wilensky (1999). The official documentation is a great resource, and we encourage you to use it as well.
In this tutorial, we intend to provide the basic concepts and programming skills necessary to start programming in NetLogo. This tutorial is focused on programming. Come back to this part whenever you need to refresh your memory on the basic concepts of programming in NetLogo.
Learning objectives¶
By completing this tutorial series, you will be able to:
- Create agent-based models from scratch
- Understand how individual behaviors create collective patterns
- Use computational tools to explore social behavior questions
- Analyze and interpret model results
- Extend existing models for new research questions
Why NetLogo for social models?¶
- Visual programming environment reduces intimidation
- Designed specifically for modeling social phenomena
- Large community of non-CS users
- Extensive library of existing models to learn from
Learning Approach¶
This course uses a learning-by-doing approach:
- Start with exploration and experimentation
- Build understanding through hands-on activities
- Progress from simple concepts to complete models
- Focus on visual and conceptual understanding first
Tutorial Structure¶
Tutorial 0: Introduction & Interface (40 minutes)
- What is NetLogo and why use it?
- Exploring the NetLogo interface
- Running your first model
Tutorial 1: Basic Programming Concepts (50 minutes)
- Programming Without Fear (10 min)
- Core Concepts (25 min)
- Reading Code (15 min)
Tutorial 2: Working with Agents (60 minutes)
- Meet the Turtles (10 min)
- Creating and Controlling (20 min)
- Making Agents Unique (15 min)
- Agent Interactions (15 min)
Tutorial 3: Environment and Patches (40 minutes)
- Understanding Patches (10 min)
- Patch Properties and Visualization (15 min)
- Turtle-Patch Interactions (15 min)
Tutorial 4: Building Your First Complete Model (55 minutes)
- Planning Before Programming (15 min)
- Step-by-Step Model Building (30 min)
- Documentation and Sharing (10 min)
Tutorial 5: Data Collection and Analysis (45 minutes)
- Why Data Matters in Modeling (10 min)
- Using NetLogo’s Built-in Analysis Tools (20 min)
- Exporting Data for External Analysis (15 min)
Tutorial 6: Advanced Topics and Troubleshooting (45 minutes)
- Common Problems and Solutions (20 min)
- Extending Models with New Features (15 min)
- Where to Go Next in Your Modeling Journey (10 min)
Getting Started¶
Begin with: Tutorial 0: NetLogo Introduction & Interface
Prerequisites: None! Just curiosity about social phenomena and willingness to experiment.
What you’ll need:
- NetLogo software (free download from netlogo.org)
- Willingness to try things and make mistakes
- Notebook for observations and questions
Learning Path¶
Recommended progression:
- Start with basic concepts and work through each tutorial sequentially
- Complete all activities and exercises in each tutorial
- Build the example models to reinforce learning
- Use the troubleshooting guide when you encounter problems
Time commitment: Plan for approximately 5 hours total to complete all programming tutorials with activities.
Getting Help¶
If you get stuck:
- Review the troubleshooting section in Tutorial 6
- Check that you’ve completed prerequisites
- Try simplifying your code and building complexity gradually
- Ask questions during class or office hours
Ready to start exploring the world of agent-based modeling? Let’s begin!
- Wilensky, U. (1999). NetLogo http://ccl. northwestern. edu/netlogo/. Technical report, Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston.