banner-nll

Lab 1 & 2 - Getting Started with NetLogo

What is NetLogo?

NetLogo is a programmable modeling environment for simulating natural and social phenomena. It is particularly well suited for modeling complex systems developing over time.  Modelers can give instructions to hundreds or thousands of independent "agents" all operating in parallel. This makes it possible to explore the connection between the micro-level behavior of individuals and the macro-level patterns that emerge from the interaction of many individuals.

NetLogo lets students open simulations and "play" with them, exploring their behavior under various conditions. It is also an "authoring tool" which enables students, teachers and curriculum developers to create their own models. NetLogo is simple enough that students and teachers can easily run simulations or even build their own. And, it is advanced enough to serve as a powerful tool for researchers in many fields.    - from the NetLogo User’s Manual

Before You Get Started

Before beginning the first lab, you should create a notebook for NetLogo. This should be a three-ring binder with loose-leaf paper.  Get some divider tabs, so you can include copies of the labs, and your notes. Make sure you have a section for making notes of new commands and procedures that you learn.  You could do this entirely electronically -- in a digital porfolio -- but it will probably be useful to have something “tangible” which you can scroll through when you are learning how to write programs in NetLogo.

Learning Lab 1 has four parts.


1. Work in a small group and together explore the NetLogo Sample Model. Answer the questions that are in italics on the page, and then we’ll have a brief group discussion.

2. Complete Tutorial # 1 from the NetLogo User Manual on Models. This tutorial is very important in that it explains many of the basic features that you will need to know when using NetLogo. There is a copy of this file in your Lotus Notes files.  You’ll probably want to make a copy of this.

    Take notes as you go through the tutorial.
     

3. Once you are comforable with the basics from Tutorial # 1, you can then complete Tutorial # 2 on commands

    As you learn a new command, write it down in your notebook.  Remember, the goal here is not just to “get through” the tutorial, but rather to master the skills necessary to be a NetLogo programmer.

4. Browse through the Reference section of the user manual. Get an idea what information is contained in this section.

Try the following statements on the command center and guess their meanings (you can check Primitive Dictionary on the Reference section to find out their definitions):

    ca (Observer)

    crt 50 (Observer)

    fd 10 (Turtle)

    if (random 3) = 1 [die] (Turtle)

    set heading 90 (Turtle)

    fd 5 (Turtle)

    if pxcor > 5 [set pcolor blue] (Patch)

    if (distancexy 10 0) < 5 [set pcolor red] (Patch)

    if (pcolor = blue) [fd 10 set color yellow] (Turtle)

With Support from:

The NetLogo Learning Lab is part of modelingcomplexity.org, the home of the Mesa State College Center for Agent-Based Modeling.

This website is copyright by Mesa State College, 2004. All rights are reserved.

Some materials are adapted from the NetLogo User manual, and are copyright Wilensky, U. (1999). NetLogo.  Center for Connected Learning and Computer-Based Modeling. Northwestern University, Evanston, IL.