Identifying Initial Decision and Recourse Variables

After identifying the random variables, all the remaining variables in the model are either initial decision variables or recourse variables.  These are the variables that are in our control, as opposed to being stochastic and in the control of Mother Nature.  The initial decision variables are those variables whose values must be determined at time 0, before nature has revealed values for any of the random variables.  The recourse variables are the variables whose values are decided at a later period in response to outcomes for the random variables.  Both initial decision and recourse variables are identified with the @SPSTGVAR function, with initial decision variables being distinguished by a stage of 0 and recourse variables by a stage >0.  Row stages can be established using @SPSTGROW.

@SPSTGVAR( STAGE, VARIABLE_NAME)

This function takes two arguments: an integer value equal to the stage at which the variable's value must be decided and the variable's name. Some examples follow:

Example 1:        @SPSTGVAR( 0, PURCHASE);

Flags variable PURCHASE as being an initial decision variable.

Example 2:        @FOR( TIME_ASSET( T, A): @SPSTGVAR( T - 1, INVEST( T, A)));

Flags INVEST( T, A) as being recourse variable in stage T-1 (or an initial decision variable when T-1=0).  Note that by using @SPSTGVAR in an @FOR loop, we are  able to identify multiple recourse variables.

Before an SP model can be passed to the SP solver engine, all initial and recourse variables must be assigned stage values.  Having to explicitly assign stage values to all these variables can be a tedious and error-prone process.  Fortunately, LINGO can deduce the stages for many of the variables based on the user inputting a minimal set of stages for the variables.  We refer to this process a stage deduction and it is discussed more in section The Solution below of the Gas Buying Example.  Guidelines for determining the variables that require explicit stage identification are listed below.

@SPSTGROW( STAGE, ROW_NAME)

This function takes two arguments:  an integer-valued stage at which the row's value becomes known and the row's name.  This function should generally not be required, in that LINGO can automatically deduce all row stages.  If you do use this function, you must name the rows whose stages you wish to set.  The syntax of assigning names to rows may be found in the Constraint Names section of Chapter 1.

Example:        @SPSTGROW( 4, CAPACITY);

Assigns row CAPACITY to stage 4.

Note:Guidelines for determining the variables and rows that must be explicitly staged are:

         All random variables must be assigned to a stage using @SPSTGRNDV.

         Any initial decision or recourse variable that belongs to stage N that does not depend either

            directly, or indirectly, on another variable  (random or otherwise) declared to be in stage N must

            be explicitly assigned to stage N using @SPSTGVAR.

         If you are uncertain whether a particular variable must be explicitly assigned to a stage, or

            not, then it doesn't hurt to assign it anyway using @SPSTGVAR.

         In general, stage assignment for rows should be left to LINGO.  Each row will be assigned

            to the stage equal to the maximum stage of the variables appearing in that row.  However,

            if you wish to explicitly specify a row's stage, you may always do so using @SPSTGROW.