Procedure GMP::Solution::RandomlyGenerate(GMP, solution, maxVarBound, startPoint, perturbation)


The procedure GMP::Solution::RandomlyGenerate generates random level values in a solution for all columns in a generated mathematical program. Each level value is sampled from the uniform distribution by using the lower and upper bound of the column as parameters.

     GMP,            ! (input) a generated mathematical program
     solution,       ! (input) a solution
     [maxVarBound],  ! (optional) a scalar value
     [startPoint],   ! (optional) a solution
     [perturbation]  ! (optional) a scalar value



An element in AllGeneratedMathematicalPrograms.


An integer scalar reference to a solution.


The maximal variable bound. If a column has no upper bound then the sampled level value will be smaller than the maximal variable bound, and if a column has no lower bound then the sampled level value will be greater than minus the maximal variable bound. The default is 1000.


An integer scalar reference to a solution representing a starting point. If specified then the sampled level value of a column will be around its level value in the starting point. By default no starting point is used.


Used in combination with argument startPoint. A value between 0 and 1 that represents the (relative) perturbation around the starting pount. The default is 0.1.

Return Value

The procedure returns 1 on success, or 0 otherwise.


  • This procedure should be called after calling the function GMP::Instance::CreatePresolved if it is used in combination with that function. Otherwise the sampled level values might be outside the range of the columns in the presolved model.

  • If argument startPoint is specified then for each column the sampled value will be in the range


    where \(x\) denotes the level value of the column, \(lb\) and \(ub\) its lower and upper bound respectively, and \(p\) the perturbation value.

  • startPoint cannot be equal to solution.

See also

The function GMP::Instance::CreatePresolved.