Error Messages/42491


Example error text

 *Bounds check: Out of range:*

 The computed value for 'Decision_A_include_r_d_2' is not consistent with its domain
 specification because the value 'Yes' is not listed as an allowed value in the domain specification
 at cell coordinate
     A_tecs1 = 'Cellulosic ethanol' 

 Do you want to stop evaluating and edit the definition?

Proposed revised Error Text

 *Warning: Value outside Domain*
 
  Warning: The value of Decision 'X' is outside its Domain.
  It contains  'Yes'  at cell coordinate
     ''A_tecs1='Cellulosic ethanol' ''
 
 Do you want to stop evaluating and edit the definition?

Cause

This message is warning you that a computed value is inconsistent the Domain of that Variable. It is just a warning, and you can continue by pressing No or No to all. The latter will ignore all Domain warnings in this computation. But, when you see such a warning, it is a good idea to take a closer look to see if there is a possible error.

This domain check is controlled by the Check value bounds preference setting, not the Show result warnings preference.

The Domain Attribute of a variable specifies the set of allowed values for a variable.

When a result is array-valued, the domain identifies the set of possibilities for each cell of the result. In the above message, it specifies the coordinates of the first cell that is inconsistent with the domain -- it occurs in the result of Decision_A_include_r_d_2 where the index A_tecs1 has the value 'Cellulosic ethanol'. The value in question is 'Yes'. In this case, the domain specifies a type, range or set of possible values for the variable Decision_A_include_r_d_2 which does not allow the value 'Yes'.

Using the Domain Attribute to specify the set of possible values can be a good practice for catching inadvertent mistakes, especially ones that might be introduced into the model in the future. It provides a level of validation, and this message is one such message results when that validation ends up being violated.

When these errors occur, it is also a good idea to examine the definition of child variables to see if they remain consistent with this variable's domain. The inconsistency in this examine indicates that at some point someone made a change to this variable, where it previously had been using [1, 0], but they are now using ['Yes', 'No']. When you examine the children, keep an eye out for expressions like the following:

If Decision_A_include_r_d_2 = 1 Then ... Else ...

When someone changed Decision_A_include_r_d_2 to use 'Yes' instead of 1, but missed the change to the above expression, they introduced a logic error into the model. The Yes values are now taking the Else clause, which is obviously not the intention.

Remedies

The recommended remedy is press Yes to stop and fix the source of the problem. In the process, you might find a mistake in your model's logic, which is why stopping and fixing it is valuable.

A less desirable option is to simply ignore this message by pressing Yes. This does not prevent the model from evaluating. If the variable needs to be re-calculated later, you'll see the same warning again.

You can leave the domain and definition as they are and turn off bounds checking for this variable only, or you can even turn off domain bounds checking only (leaving the Check attribute test in tact) by manually setting the UseCheck attribute. Doing so will prevent the same message from appearing again. At present, however, the only way to do this from the Typescript window. To turn off all types of bounds checking for this variable (i.e., Decision_A_include_r_d_2), in typescript you would type:

UseCheck Decision_A_include_r_d_2: 0

To turn off only domain bounds checks for this variable only, type:

UseCheck Decision_A_include_r_d_2: 11

The least desirable option is to turn off bounds checking globally (from the Edit → Preferences dialog.

In the above example, when we examined the variable in question, there was indeed an accidental inconsistency that had been introduced. The Domain Attribute of the variable listed the explicit values [True, False], equivalent to [1, 0], while the cells of the variable's edit tables contained pulldowns with values ['Yes', 'No']. In this case, the cells where defined as Choice(A_yes_no1, 1, 0), pulling their possible values from A_yes_no1, so we just changed the domain to Copy From Index and selected index A_yes_no1 for the domain. (Hint: You can also do this by selecting "Expression" for the domain type and just typing the identifier)

See Also

Comments


You are not allowed to post comments.