The OPTMODEL Procedure

UNFIX Statement

UNFIX identifier-list [ =( expression ) ];

The UNFIX statement reverses the effect of FIX statements. The solver can vary the specified variables, variable arrays, or variable array locations specified by identifier-list . The identifier-list consists of one or more variable names separated by spaces.

Variable is an identifier expression (see the section "Identifier Expressions"). The UNFIX statement affects an entire variable array if the identifier expression omits the index from an array name. The expression specifies a new initial value that will be stored in each element of the identifier-list.

The following example demonstrates the UNFIX command:

  
    proc optmodel; 
       var x{1..3}; 
       fix x;       /* fixes entire array to 0 */ 
       unfix x[1];  /* x[1] can now be varied again */ 
       unfix x[2] = 2;  /* x[2] is given an initial value 2 */ 
       				   /* and can be varied now */ 
       unfix x;  /* all x indices can now be varied */
 

After the following code is executed, the variables x[1] and x[2] are not fixed. They each hold the value 4. The variable x[3] is fixed at a value of 2.

  
    proc optmodel; 
       var x{1..3} init 2; 
       num a = 1; 
       fix x; 
       unfix x[1] x[2]=(a+3);
 

Previous Page | Next Page | Top of Page