Error Messages/42515


Error message

 Variable B has a self-index conflict.  The result of evaluating the definition of B has an 
 implicit dimension, which should be promoted to become the self-index of B.  But B also contains 
 a domain with explicit values and the "Domain acts as self index" preference is on, indicating that
 these domain values should also serve as the self-index of B.

Cause

Prior to Analytica 4.3, Analytica had a quirk in that a variable's domain values doubled as its self-index values. This isn't consistent with the real purpose of the domain values -- which is to specify what the possible values are -- but was done to allow Choice, ProbTable and DetermTable to treat the possible values as an index.

As a result of that quirk, a conflict is introduced if you define your variable to return an implicit dimension, such as a list result. The conflict is that both the domain values, and the list, want to become the self-index of the variable.

Starting with Analytica 4.3, the quirk that leads to this conflict has been eliminated; however, in order to support backward compatibility with legacy models, Analytica 4.3 exposes a preference setting called "Domain acts as self index" that preserves this behavior. When that preference is on, then the domain should serve as the self-index, and hence the conflict exists.

Remedies

The best solution is to turn off the "Domain acts as self index" preference. The setting is most likely on just because your model was originally created in Analytica 4.2 or earlier, so it was enabled automatically just to ensure backward compatibility. It is uncommon for models to contain expressions that are impacted by this, and for those that do, it is bad style to use the domain values as if they are an index of the variable, so if turning the preference setting off breaks something else, it is better style to fix the other areas that break.

If, however, too many other things break when the preference is turned off, then you can fix the problem at the problematic node by changing the definition to eliminate the implicit index. This is done by using a local index instead, or by re-indexing the result only to an existing index. For example:

Variable A := 3..6
Domain of A := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Change to:

Variable A := Index I := 3..6 Do I
Domain of A := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

See Also

Comments


You are not allowed to post comments.