# Influence arrow

## Interpretation

To say that "A influences B" (i.e. to draw an influence arrow from A to B) means that A is used to calculate a value for B: in other words, the equation for calculating B will include A.

## Rules

You can drag an influence arrow from and to most model elements. The exceptions and special cases are noted here below. Note that if you try to drag an influence arrow to a model element that cannot receive one, then it turns blue instead of green, and you will not be able to connect them together. You can store comments associated with an influence arrow by double-clicking the arrow.

### Compartments

• Elements that influence a compartment are used only to calculate the initial value of the compartment. Thereafter, the value of the compartment is calculated by adding the flows in and subtracting the flows out. It is not common therefore to draw an influence arrow to a compartment, though it is possible (in order to calculate the initial value). For example, although one may informally say "water temperature influences fish population size", in the model, temperature must actually influence one of the processes (reproduction, death and so forth) which change the fish population size. The influence arrow from the temperature variable must therefore point to one (or more) of the flows in or out , and not to the compartment representing fish population size itself.

### Submodels

• When working with submodels, you may find that an input parameter (A) in one submodel actually corresponds to a variable (B) in another, especially when the two submodels were developed separately, then later brought together. In order to get rid of the duplication, draw an influence arrow from B to the influence arrow from A. This is the only circumstance in which it is possible to draw one influence arrow pointing to another. Input parameter A will disappear, and the influence arrows will be re-drawn to show B directly influencing the element previously influenced by A.
• You can drag an influence arrow to a submodel boundary, from either inside or outside the submodel. This has no meaningful modelling function, but acts as a temporary placeholder to the influence arrow until it is connected to an element on the other side of the boundary. In order to do this, drag an influence arrow from the head of the existing arrow to the desired element.
• You cannot drag an influence arrow from a submodel boundary, other than to complete an influence arrow drawn to the submodel boundary (as described in the previous bullet point).

### Influence and role arrows

• You cannot drag an influence to a role arrow or to another influence arrow.
• If an influence shares part of its route with one or more role arrows (in either direction), then the normal interpretation is that the values it supplies will only be those from the base model instances in the corresponding roles, or from the association model instances for which the instance containing the destination is in the appropriate role. The different interpretations are selected by prefixing the caption of the source component (or suffixing if going from association to base) with the caption of the relevant role. As of Simile v6, the interpretations can be enabled or disabled by checkboxes in the influence properties dialogue. Also the interpretation that would apply if the role arrow were not present, i.e., get values from all source model instances, is also available and can also be enabled or disabled.
• In Simile v6.1, an alternative interpretation is provided for influences within multiple-instance submodels -- the ability to get values from all instances, as if the destination were outside the submodel, rather than just from the current instance. Furthermore, for influences within special-purpose submodels, there are interpretations that provide values from just a special subset of other instances, e.g., neighbour instances. Again, any of these (as well as the default interpretation) can be enabled or disabled from the properties dialogue.
• If an interpretation is enabled that gets values from other instances than the current one, the influence arrow will be decorated with an oblique stack that it passes through, indicating that it carries values between different instances of its submodel.
• To invoke the property dialogue box for an influence arrow, double-click on the arrow, or right-click on it and select "Properties..." from the context menu.

### Calculation order

An influence arrow indicates that the value of one component is used in calculating the value of another. So it puts a constraint on the order in which the two values can be calculated each time step; the one at the head must be done after the one at the tail.

This means that if it is possible to get from a model component around a loop of influence arrows back to the same component, the model cannot be executed, because no ordering of the calculations can satisfy all the constraints. The problem is called circularity. Usually this problem indicates that a certain variable in the model should in fact be a compartment, and an influence that connects to it should instead connect to a flow going to it. But there are some circumstances in which circular influences are OK.

• Influence arrows have one further property that can be set. The property is "Use values made in same time step". The property indicates how the ambiguity associated with a circular loop of influences is to be resolved.
• Normally, the value of the component at the end of an influence is calculated after that at its start in each time step. Selecting "Use values..." removes this constraint, and shows this by drawing the arrow dashed instead of solid.
• This may be used in combination with the iteration symbol to implement many iterative methods.
• You can also use this property to create a model process that iterates a fixed number of times and stores all its intermediate results in an array. In this case you do not need the iteration symbol. If you have two components in different fixed-membership submodels, and each has the same number of instances, then they can each have an influence to the other provided one of the influences has the "Use values made in same time step" property, and the equation of the component at the end of this influence uses only values of the other component with indices lower than its own. Subject to a similar restriction it is also possible to specify iteration between a base submodel and its association submodels.

There are two functions in the equation language, "last()" and "sofar()", which also allow a model with a circular chain of influences to execute. Putting "last()" around an expression means that its value at the end of the last time step is to be used, so the component using it does not have to be evaluated after it each time step. Putting "sofar()" round a value has the same effect as selecting the "Use values..." property described above for the influences used by that value; it is used to resolve circularity problems involving intermediate variables, where there is no influence arrow on which the property could be set.