14
New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Embed Size (px)

Citation preview

Page 1: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

New Mexico Computer Science For All

Interface Input in NetLogo

Maureen Psaila-Dombrowski

Page 2: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Interface Input•Can input Global Variables from the

Interface tab of NetLogo

•A quick way to change variable value

•No recoding

•Four ways:▫Sliders▫Switches▫Choosers▫Input Boxes

Page 3: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Sliders•Slider sets a global variable value to a

NUMBER•Slider has a range of values

minimum value maximum value.

•Move the slider to the desired value Increase by moving the slider to the right Decrease by moving to the left

•The current value of the variable is given on the right below the sliders

Page 4: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Create a Slider• Select slider in the drop down menu. Add it to the

Interface tab• The edit dialog box automatically opens requiring

▫ Global variable name▫ Minimum value of the variable▫ Maximum value of the variable▫ Increment ▫ Initial value

Page 5: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

•Sample program – input a slider

Page 6: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Switch•Switches are used to set the global

variable to a boolean value On/Off

•To Create Select switch in the drop down menu. Add it

to the interface. The edit dialog box automatically opens

requiring the Boolean Global variables name

Page 7: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

•Sample program – input a Switch

Page 8: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Chooser•Can set the Global variable to be any data

type: strings, numbers, booleans, etc.

•Lets you choose from a list of choices.

•List is in a drop down menu.

Page 9: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Chooser•To Create

▫Select switch in the drop down menu. Add it to the interface.

▫Input the Global Variable Name▫Input the list of choices

Page 10: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

•Sample program – input a chooser

Page 11: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Input Box•Input Boxes are used to enter global

variables that contain strings, numbers or colors. ▫Strings can be

simple strings commands/reporters (checks syntax)

▫Any type of number can be entered (more variety than sliders)

▫Color input boxes offer a color chooser using the NetLogo color table.

Page 12: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Input Box•To Create

▫Select switch in the drop down menu. Add it to the interface.

▫Enter Global Variable name▫Choose variable type

Page 13: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

•Sample program – input a input box

Page 14: New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski

Summary

•Can input Global Variable values from the Interface tab of NetLogo

•Can set the value in Four ways:▫Sliders

Choose from a range of numbers▫Switches

Boolean value▫Choosers

Choose from a list of any data type▫Input Boxes

Can be a number, string or color.