A fundamental component of any CCP model is its set of random variables.  The random variables are the stochastic component of the model.  Their values are not known with certainty beforehand, however, their uncertainty can be expressed with known probability distributions.  LINGO requires each random variable to be explicitly identified.  When we identify each random variable, we must also provide the stage in the scenario tree where each variable's value is revealed.  Currently, unlike SPs, CCPs are limited to single stages, given this, the stage value must always be 1.  The @SPSTGRNDV function is used for this for identifying the random variables in a CCP model:

@SPSTGRNDV( STAGE, VARIABLE_NAME)

This function takes two arguments: the random variable's name and the integer valued stage at which the random variable's value is revealed.  Note that this function merely flags a variable as being random, and does not communicate any information regarding the actual distribution of the variable.  A distribution is associated with the random variable in the Binding random variables to distribution instances, discussed below.  Some examples follow:

Example 1:        @SPSTGRNDV( 1, DEMAND);

Flags variable DEMAND as being a random variable in stage 1.

Example 2:        @FOR( CUSTOMERS( I): @SPSTGRNDV( 1, DEMAND( I))));

Flags DEMAND( I) as being a random variable in stage 1.  Note that by using @SPSTGRNDV in an @FOR loop, we are  able to identify multiple variables as being random.