This subroutine defines or changes a decision variable in the selected cell without using a dialog.
If a simulation runs before this subroutine is used, the simulation must be reset before the decision variable is defined.
Note: | Before calling this subroutine, select a cell. |
Table 55. CB.DefineDecVarND Parameters
Specifies the minimum (lower) bound of the decision variable. Must be an integer for the Category decision variable type; ignored for decision variable types Binary and Custom. | |||
Any positive or negative number equal to or greater than Min | Specifies the maximum (upper) bound of the decision variable. Must be an integer for the Category decision variable type; ignored for decision variable types Binary and Custom. | ||
Specifies a positive step size for discrete decision variables. If decVarType is not used, indicates whether the decision variable type is Continuous (StepSize is 0 or blank) or Discrete (StepSize is greater than 0); ignored for decision variable types Binary, Category, and Custom. | |||
Specifies how Crystal Ball identifies the decision variable. Names the decision variable. If you do not specify a name, Crystal Ball uses the first of either: the cell’s range name, text from the cell in the column immediately preceding it (to the left), text from the cell in the row immediately preceding it (above), or the cell’s coordinates. | |||
See Table 56. | Sets the decision variable type to Continuous, Discrete, Binary, Category, or Custom (described in Table 56). | ||
A list of at least two values separated by commas (,) or a reference to a range of cells containing these values; decimal values can be used. The range must be one-dimensional (adjoining cells in one row or one column). | Supplies a list of values for use with the Custom decision variable type (cbDecVarTypeCustom). |
Table 56. Named Constant and Index Values for the decVarType Parameter — Optional, Integer
Sets the decision variable type to Continuous; it can assume any value between the lower and upper bounds. Continuous is the default type if decVarType is not used and StepSize is blank or 0. | ||
Sets the decision variable type to Discrete; it can assume values at specific intervals, based on step size, between the lower and upper bounds. If decVarType is not used and StepSize is neither blank nor 0, the decision variable type is set to Discrete. | ||
Sets the decision variable type to Binary; it can assume the value 0 (represents No) or 1 (represents Yes). Also known as the “Yes-No” type. | ||
Sets the decision variable type to Category; it can assume any integer between the upper and lower bounds (inclusive) without regard to order. The bounds are also integers. The decision variable values are nominal and represent choices or categories instead of arithmetic values. For more information, see CB.DefineDecVarND Example 4. | ||
Sets the decision variable type to Custom; it can assume any value from a list of two or more specific values supplied with the customData parameter. |