get_master_dr_degree

(function from pyomo.contrib.pyros.master_problem_methods)

pyomo.contrib.pyros.master_problem_methods.get_master_dr_degree(master_data)[source]

Determine DR polynomial degree to enforce based on the iteration number and/or the presence of first-stage equality constraints that depend on the decision rule variables.

If there are first-stage equality constraints that depend on the decision rule variables, such as equalities derived from coefficient matching or discretization of state-variable independent equalities, then the degree is set to config.decision_rule_order.

Otherwise, the degree is set to:

  • 0 if iteration number is 0

  • min(1, config.decision_rule_order) if iteration number otherwise does not exceed number of effective uncertain parameters

  • min(2, config.decision_rule_order) otherwise.

Parameters:

master_data (MasterProblemData) – Master problem data.

Returns:

DR order, or polynomial degree, to enforce.

Return type:

int