@@ -2344,7 +2344,7 @@ def check_time_limit_reached(timing_data, config):
2344
2344
2345
2345
2346
2346
def _reformulate_eq_con_scenario_uncertainty (
2347
- working_model , discrete_set , ss_eq_con , ss_eq_con_index , ss_var_id_to_dr_expr_map
2347
+ model_data , discrete_set , ss_eq_con , ss_eq_con_index , ss_var_id_to_dr_expr_map
2348
2348
):
2349
2349
"""
2350
2350
Reformulate a second-stage equality constraint that
@@ -2359,21 +2359,22 @@ def _reformulate_eq_con_scenario_uncertainty(
2359
2359
2360
2360
Parameters
2361
2361
----------
2362
- working_model : ConcreteModel
2363
- Mostly preprocessed working model.
2362
+ model_data : ModelData
2363
+ Model data object, with mostly preprocessed working model.
2364
2364
discrete_set : UncertaintySet
2365
2365
Uncertainty set with scenario-based geometry.
2366
2366
ss_eq_con : ConstraintData
2367
2367
Second-stage equality constraint to be reformulated.
2368
2368
Expected to be a member of
2369
- ``working_model.second_stage.equality_cons``.
2369
+ ``model_data. working_model.second_stage.equality_cons``.
2370
2370
ss_eq_con_index : hashable
2371
2371
Index of the equality constraint in
2372
- ``working_model.second_stage.equality_cons``.
2372
+ ``model_data. working_model.second_stage.equality_cons``.
2373
2373
ss_var_id_to_dr_expr_map : dict
2374
2374
Mapping from object IDs of second-stage variables to
2375
2375
corresponding decision rule expressions.
2376
2376
"""
2377
+ working_model = model_data .working_model
2377
2378
con_expr_after_dr_substitution = replace_expressions (
2378
2379
expr = ss_eq_con .expr , substitution_map = ss_var_id_to_dr_expr_map
2379
2380
)
@@ -2654,7 +2655,7 @@ def reformulate_state_var_independent_eq_cons(model_data):
2654
2655
if coefficient_matching_applicable :
2655
2656
if config .uncertainty_set .geometry .name == "DISCRETE_SCENARIOS" :
2656
2657
_reformulate_eq_con_scenario_uncertainty (
2657
- working_model = working_model ,
2658
+ model_data = model_data ,
2658
2659
ss_eq_con = con ,
2659
2660
ss_eq_con_index = con_idx ,
2660
2661
discrete_set = config .uncertainty_set ,
0 commit comments