Begin micro-behaviour Begin description: Define a new parameter (optionally controlled by a slider or input box). End description


Begin NetLogo code:
 no interface
 add slider
 add input box (remember to change the box coordinates to be tall enough to see properly)

initial value: 

End NetLogo code


All the text areas can be changed. By clicking on the radio buttons you can choose whether the parameter should have an interface for user control and whether it should be a slider or an input box.

The BehaviourComposer can provide more support if the parameter name begins with "the-". If multiple interface elements have the same location they are placed one under another.

Related Micro-behaviours

Boolean parameter can be used to create a switch for parameters that can only have true or false as values.

How this works

This creates a NetLogo global variable. The global variable can optionally be controlled by a NetLogo slider or input box. Note that define-parameter is not a NetLogo command. NetLogo does not provide support for creating interface elements on the fly. Instead this adds the appropriate element to the NLOGO file. Interface elements are added at load time and cannot be added or removed later. Nor can they be repeated or scheduled.


Parameter was implemented by Ken Kahn on 28 September 2009.