AnyLogic
Expand
Font size

Linking controls to parameters

Controls that have state or content (such as slider, radio buttons, edit box, etc.) have value and can be linked to variables and parameters, to make the linked object change every time a user changes the state of the control (but not vice versa).

Control Type of value Can be linked to type
Checkbox boolean boolean
Edit box String String, double, int
Radio buttons int int
Slider double double, int
Combo box String String
List box String String
Demo model: Slider Linked To Parameter Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).

To link a control to a parameter

  1. In the control’s properties, select the Link to checkbox and choose the parameter/variable from the combo-box to the right:

  2. The pop-up list shows the names of all parameters and variables of the valid types, and also all the flowchart blocks present on the diagram of this agent. To link to a parameter, just select the parameter in the list.
  3. If you want to link the control to a parameter of some flowchart block (e.g. capacity of queue block), you should first select the flowchart block name from the drop-down list, and then choose the parameter from the Parameter drop-down list below:

Another way to link to a parameter is to select the required parameter or a flowchart block directly in the graphical editor.

To link a control to a parameter by selecting it in the graphical editor

  1. Select the Link to option, and then click the button to the right of the drop-down list.

  2. If you are linking your control to a parameter, select the parameter in the graphical editor. If you want to link to a parameter of a flowchart block, select the corresponding flowchart block:

  3. A dialog box will open containing the list of parameters of the flowchart block that you can link to a slider. Select the required parameter from the list, its name will be automatically inserted in the corresponding property of the control.

How can we improve this article?