The OPTMODEL Procedure |
The FIX statement causes the solver to treat a list of variables, variable arrays, or variable array locations as fixed in value. The identifier-list consists of one or more variable names separated by spaces. Each member of the identifier-list is fixed to the same expression. For example, the following code fixes the variables x and y to 3:
proc optmodel; var x, y; num a = 2; fix x y=(a+1);
A variable is specified with an identifier-expression (see the section "Identifier Expressions"). An entire variable array is fixed if the identifier-expression names an array without providing an index. A new value can be specified with the expression. If the expression is a constant, then the parentheses can be omitted. For example, the following code fixes all locations in array x to 0 except x[10], which is fixed to 1:
proc optmodel; var x{1..10}; fix x = 0; fix x[10] = 1;
If expression is omitted, the variable is fixed at its current value. For example, you can fix some variables to be their optimal values after the SOLVE statement is invoked.
The effect of FIX can be reversed using the UNFIX statement.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.