Function GMP::Stochastic::GetRelativeWeight(GMP, stage, scenario)

GMP::Stochastic::GetRelativeWeight

The function GMP::Stochastic::GetRelativeWeight returns the relative weight of a scenario at some stage in the scenario tree belonging to a stochastic mathematical program. The weight is relative to the sum of the weights of all scenarios that have the same parent at that stage.

GMP::Stochastic::GetRelativeWeight(
     GMP,            ! (input) a generated mathematical program
     stage,          ! (input) a scalar reference
     scenario        ! (input) a scenario
)

Arguments

GMP

An element in the set AllGeneratedMathematicalPrograms.

stage

An integer scalar reference to a stage.

scenario

An element in the set AllStochasticScenarios.

Return Value

In case of success, the relative weight. Otherwise it returns UNDF.

Note

The GMP should have been created by the function GMP::Instance::GenerateStochasticProgram.

See also

The routines GMP::Instance::GenerateStochasticProgram and GMP::Stochastic::GetRepresentativeScenario. See Basic Concepts of the Language Reference for more details on scenario tree, scenarios and stages.