Variables Connection

You can establish interaction between two objects by connecting their variables. Connected variables will have the same value at any moment of time; i.e., changes of one variable will be immediately propagated to another variable declared as dependent one. This provides for continuous and/or discrete time object interaction. 

Please note that the value of the dependent variable always depends on the value of the connected variable but not vice versa: if you modify the dependent variable, this does not affect others.

You can connect:

The figure below is the screenshot from the Population model. It illustrates the case when two embedded objects interact via connected variables.

Connection of variables of embedded objects

When connecting variables, please mind these rules:

Connecting variables

When connecting two variables, one variable should be necessarily defined as dependent one. The dependent variable always gets value of another variable. 

 To make a variable dependent
  1. Select the variable in the graphical editor or in the Projects view.
  2. In the Properties view, select the Dependent check box. 

When finished, connect variables graphically with connectors.

 To connect two variables
  1. Double-click the Connector element in the  Agent palette to activate its drawing mode. 
  2. In the graphical editor, subsequently click both variables that you want to connect.

When drawing connectors, you can notice that connector's point put correctly inside variable icon is indicated with a small green circle. In the case you do not see the green circle, it probably means that you are trying to connect variables that cannot be connected, or you have put connector's point close by a variable and you need to move it onto it.


Related topics

 Changing connector's appearance