Function GMP::Instance::GenerateStochasticProgram(MP, StochasticParameters, StochasticVariables, Scenarios, ScenarioProbability, ScenarioTreeMap, RootScenarioName, GenerationMode, Name)


The function GMP::Instance::GenerateStochasticProgram generates the deterministic equivalent of a stochastic mathematical program.

     MP,                    ! (input) a symbolic mathematical program
     StochasticParameters,  ! (input) a set of stochastic parameters
     StochasticVariables,   ! (input) a set of stochastic variables
     Scenarios,             ! (input) a set of stochastic scenarios
     ScenarioProbability,   ! (input) a double parameter
     ScenarioTreeMap,       ! (input) an element parameter
     RootScenarioName,      ! (input) a string expression
     [GenerationMode],      ! (optional) a stochatic generation mode
     [Name]                 ! (optional) a string expression


A symbolic mathematical program in the set AllMathematicalPrograms. The mathematical program should have model type LP or MIP.
A subset of AllStochasticParameters.
A subset of AllStochasticVariables.
A subset of AllStochasticScenarios.
A double parameter over Scenarios representing the objective probabilities of the scenarios.
An element parameter that defines the scenario-and-stage to scenario mapping. The range of this parameter should be the set Scenarios.
A string that holds the name of the artificial element that will be added to the set AllStochasticScenarios. This element will be used to store the solution of non-stochastic variables in their respective .Stochastic suffixes.
An element in the predefined set AllStochasticGenerationModes. The default is ‘SubstituteStochasticVariables’.
A string that holds the name for the generated stochastic mathematical program.

Return Value

A new element in the set AllGeneratedMathematicalPrograms with the name as specified by the name argument.


  • If the Name argument is not specified, or if it is the empty string, then the name of the symbolic mathematical program preceded by ‘Stochastic’ is used to create a new element in the set AllGeneratedMathematicalPrograms.
  • The objective of the symbolic mathematical program must be a defined variable.

See also

  • Stochastic programming is discussed in Chapter 19 of the Language Reference.
  • The procedure GMP::Instance::Solve.