HubNet Guide

NetLogo 1.1 User Manual   

HubNet is a technology that lets you use NetLogo to run participatory simulations in the classroom. In a participatory simulation, a whole class takes part in enacting the behavior of a system as each student controls a part of the system by using an individual TI-83+ calculator.

For example, in the Gridlock simulation, each student controls a traffic light in a simulated city with their calculator. The class as a whole tries to make traffic flow efficiently through the city. As the simulation runs, data is collected which can then be analyzed with the calculators afterwards.

For more information on participatory simulations and their learning potential, please visit the Participatory Simulations Project web site.

About HubNet

What do I need to get started?

NOTE: Navigator is not yet commercially available. To learn more about the system, visit Texas Instruments' site. In the future, we hope to support other input devices such as laptops and PDA's (Personal Digital Assistants).

First-time NetLogo user?

NetLogo is a programmable modeling environment. It comes with a large library of existing simulations, both participatory and traditional, that you can use and modify. Content areas include social science and economics, biology and medicine, physics and chemistry, and mathematics and computer science. You and your students can also use it to build your own simulations, if you choose.

In traditional NetLogo simulations, the simulation runs according to rules that the simulation author specifies. HubNet adds a new dimension to NetLogo by letting simulations run not just according to rules, but by direct human participation. Since HubNet builds upon NetLogo, we recommend that before trying HubNet for the first time, you should be familiar with the basics of NetLogo.

Teacher workshops

For information on up and coming workshops and NetLogo and HubNet use in the classroom, please contact us at feedback@ccl.northwestern.edu.

Getting Started With HubNet

Using NetLogo

We recommend that you become familiar with NetLogo itself before using the HubNet technology.

You can run NetLogo in either of two ways:

The application starts up faster and has some extra features. However, if your school has firewalls or proxy servers, consult the "Proxy Web Servers & Firewalls" section below.

You can become familiar with NetLogo by trying out some of the models in the Models Library. Open the Models Library from the File menu in NetLogo. Then click on a model that you want to try and press the Open button. The Information tab in each of the models gives background information and instructions.

Other sections of the NetLogo User Manual may be helpful when learning NetLogo. We suggest that beginning users focus on the section Tutorial #1: Running Models.

If you have any questions about NetLogo, feel free to E-mail us. You can reach us at feedback@ccl.northwestern.edu.

HubNet Activities

Below are the current HubNet activities that are fully developed. For each model, you will find its educational goals and suggested ways to incorporate them into your classroom.

NOTE: In addition to the discussion of learning goals and classroom techniques, these materials also contain step by step instructions and screen shots. As of June 2002, they are out of date and no longer match the actual activities in many respects. We are working on updating them; we expect these materials to be updated by July 15, 2002. In the meantime, please use these materials for the discussions, but for step by step instructions, rely instead on the QuickStart Instructions built into the activities (see next section).

Running an activity

You'll find the HubNet activities in NetLogo's Models Library, under the HubNet Activities folder.

When you open the first HubNet activity for each session of NetLogo, you will be prompted by a login dialog. This prompts you to enter information (such as User Id and Password) that is necessary for connecting to the appropriate server and running the HubNet activity. If you don't actually want to run the model, just press the Cancel button. (Be aware you may still get NetLogo Runtime errors if you do press cancel.)

In each of the activities, you'll see a box on the screen labeled "QuickStart Instructions". It contains step by step instructions on how to run that activity. Click the "Next>>>" button to advance to the next instruction.

We suggest doing a few practice runs of the activity before trying it in front of an actual class.

If you have any questions about running the activities, feel free to E-mail us. You can reach us at feedback@ccl.northwestern.edu.

Proxy web servers and firewalls

If your school uses a proxy web server or a firewall, you must use the NetLogo applet, not the NetLogo application. (You may need to adjust the preferences in your browser to let it know about your proxy server or firewall.)

If you are not sure if your school uses a proxy web server or firewall, or you need help configuring your browser to have the correct proxy settings, ask your network administrator.

We are actively working to remove this restriction on the NetLogo application. We also expect that a future version of the TI Navigator system may help address the situation. If you have any trouble running HubNet in your classroom, please contact us at feedback@ccl.northwestern.edu.

HubNet Programming Guide

This section explains how to use NetLogo to modify the existing HubNet activities or build your own, new HubNet activities.

Calculator

The calculator is able to send and receive the following data types from NetLogo:

The calculator sends and receives data by storing a set of parameters in the string "Str0". Depending upon what type of data you are trying to send or receive, "Str0" will have different values. For instance, if the modeler wanted to create and send a list of numbers in the list "L1", it would be done as follows. Set the value of the list to some numbers (in this case, 20, A, and B where A and B are number variables that are set previously in the calculator code). Then write:

{20,A,B}->L1
"1 L1"->Str0
Asm(prgmSENDVAR) 

The length of the list of numbers that a calculator sends depends on what information you want to send to the NetLogo model. Further, how those numbers are interpreted by the model is also up to you.

You can also receive data from the NetLogo model. To do this, use the following calculator code:

"4 Str6 1"->Str0
Asm(prgmGETVAR)

Let's take a look at how the values of the string "Str0" are set. The first input in the string represents the type of variable that you are trying to get. Since we are trying to get a string ("Str6"), we give the first input the value 4. (See below for the values of legal data types.) The second input is the variable in which you would like to save the data received. In this case, we want to save the data to the variable "Str6". The third input tells how you would like to save this data into this variable. (See below for values of valid commands.) It should be noted that for sending a variable, the command defaults to 0, i.e. no command.

data typeassociated value
number0
list of numbers1
matrix of numbers2
string4

command numbercommand explanation
0No Command
1Collate (Lists into a matrix, reals into a list, append strings)
2Teacher Variable
4Append Lists

You should note that you must always save the information into the variable "Str0" when you are sending or receiving information from the calculators. You can't use any other variable.

For more information on writing the calculator program portion of a HubNet Activity, please read the on-line documentation provided by TI. It is under the Help link.

Saving

The data sent by calculators or NetLogo is saved in the order that the server receives the data.

NetLogo Commands

In the model the modeler uses a set of commands to extract the data from the server. The modeler is free to interpret these numbers as anything they wish. A 5 could mean to set a particular patch's color to red or have a turtle move forward.

Setup

In order for NetLogo to communicate with the server, it is necessary for NetLogo to establish a connection with the server and for NetLogo to tell the server what variables to send to NetLogo. This is done with the following three primitives:

hubnet-reset
This logs you into the HubNet system. You must be logged in to use any of the other HubNet primitives. If this is the first time called for this NetLogo session, a HubNet properties dialog appears prompting you to input the appropriate information to be able to log into the HubNet system. Once you press the Login button, NetLogo will attempt to log you into HubNet. Once you are logged in, you are always logged in while this model is open; you log off when you close the model or quit NetLogo.
hubnet-set-tags variable-list
This sets which variables NetLogo expects from the calculators. NetLogo will only check for these variables and will ignore all others. Currently, the valid types that NetLogo will be able to receive from the calculator are the following: This primitive must be called before you try to check for data on the server using the hubnet-message-waiting? reporter.
hubnet-set-client-interface client-type activity-name
If client-type is "TI-83+", notify the user to enable the activity activity-name on the TI Navigator web site. Future versions of HubNet may support other client types, and/or change the meaning of the second input to this command.

These are usually best called from the startup procedure of the NetLogo model.

Data extraction

The data extraction primitives are:

hubnet-message-waiting?
This looks for new information on the server. It returns TRUE if there is new data, and FALSE if there is not.
hubnet-fetch-message
This retrieves any new data from the server, so that it can be accessed by hubnet-message. This will cause an error if no data is on the server. So be sure to check for data with hubnet-message-waiting? before calling this.
hubnet-message-source
This reports the user ID that sent the data. This will cause an error if no data has been fetched from the server. So be sure to fetch the data with hubnet-fetch-message before calling this.
hubnet-message-tag
This reports the variable name that was sent. This will only report one of the tags set with the hubnet-set-tags primitive. This will cause an error if no data has been fetched from the server. So be sure to fetch the data with hubnet-fetch-message before calling this.
hubnet-message
This reports the data collected by hubnet-fetch-message. This will cause an error if no data has been fetched from the server. So be sure to fetch the data with hubnet-fetch-message before calling this.

Sending data

It is also possible to send data from NetLogo to the server to be accessed by the calculators.

Note: It is not currently possible to send data from NetLogo directly to only an individual calculator. However, once the server has the data, any connected calculator can grab it. This is done using the calculators' communication facilities, rather than through NetLogo.

The primitive for sending data to the server is:

hubnet-broadcast variable-name value
This broadcasts value from NetLogo to the variable variable-name on the server. You may send a number, a string, a list of numbers, or a matrix (a list of lists) of numbers.
The examples of sending the various types of data that you can send are as follows:

data typeexample
numberhubnet-broadcast "A" 3.14
stringhubnet-broadcast "STR1" "HI THERE"
list of numbershubnet-broadcast "L2" [1 2 3]
matrix of numbershubnet-broadcast "[A]" [[1 2] [3 4]]

Examples

Study the models in the "HubNet Activities" section of the Models Library to see how these primitives are used in practice in the Procedures window. Function Activity is a good one to start with.

Appendix: HubNet Architecture

HubNet architecture diagram