diff --git a/tests/test_esipp.py b/tests/test_esipp.py index 432dc5c25386fa098e313cacb8fe28735055d040..ba37d21328739a353c66a1a2ca07a39b95e5c4dd 100644 --- a/tests/test_esipp.py +++ b/tests/test_esipp.py @@ -23,6 +23,7 @@ def build_solve_ipp( solver: str = 'glpk', solver_options: dict = None, use_sos_arcs: bool = False, + use_sos_arc_groups: bool = False, arc_sos_weight_key: str = InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE, arc_use_real_variables_if_possible: bool = False, use_sos_sense: bool = False, @@ -134,7 +135,7 @@ def build_solve_ipp( arc_use_real_variables_if_possible ), sos1_weight_method=arc_sos_weight_key, - ) + ) # set up the use of sos for flow sense determination @@ -192,6 +193,12 @@ def build_solve_ipp( if type(arc_groups_dict) != type(None): for key in arc_groups_dict: ipp.create_arc_group(arc_groups_dict[key]) + + # set up the use of sos for arc selection in groups + + if use_sos_arc_groups: + for group_key, group in ipp.arc_groups.items(): + ipp.groups_arc_sos1[group_key] = group # ********************************************************************* diff --git a/tests/test_esipp_prices.py b/tests/test_esipp_prices.py index 9745b6855f5ea7d7873e42c448e7c351932eb513..704e488a802984df87b74d60fd7e7865dd2c424f 100644 --- a/tests/test_esipp_prices.py +++ b/tests/test_esipp_prices.py @@ -90,9 +90,6 @@ class TestESIPPProblem: ) assert not ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 10 - assert ipp.results["Problem"][0]["Number of variables"] == 11 - assert ipp.results["Problem"][0]["Number of nonzeros"] == 20 # ********************************************************************* # ********************************************************************* @@ -194,12 +191,6 @@ class TestESIPPProblem: ) assert not ipp.has_peak_total_assessments() - # print(ipp.results["Problem"][0]["Number of constraints"]) - # print(ipp.results["Problem"][0]["Number of variables"]) - # print(ipp.results["Problem"][0]["Number of nonzeros"]) - assert ipp.results["Problem"][0]["Number of constraints"] == 14 # 10 prior to nonconvex block - assert ipp.results["Problem"][0]["Number of variables"] == 13 # 11 prior to nonconvex block - assert ipp.results["Problem"][0]["Number of nonzeros"] == 28 # 20 prior to nonconvex block # ********************************************************************* # ********************************************************************* @@ -372,9 +363,6 @@ class TestESIPPProblem: ) assert not ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 10 - assert ipp.results["Problem"][0]["Number of variables"] == 11 - assert ipp.results["Problem"][0]["Number of nonzeros"] == 20 # ********************************************************************* # ********************************************************************* @@ -479,9 +467,6 @@ class TestESIPPProblem: ) assert not ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 14 # 10 before nonconvex block - assert ipp.results["Problem"][0]["Number of variables"] == 13 # 11 before nonconvex block - assert ipp.results["Problem"][0]["Number of nonzeros"] == 28 # 20 before nonconvex block # ********************************************************************* # ********************************************************************* @@ -688,9 +673,6 @@ class TestESIPPProblem: ) assert not ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 23 - assert ipp.results["Problem"][0]["Number of variables"] == 26 - assert ipp.results["Problem"][0]["Number of nonzeros"] == 57 # ********************************************************************* # ********************************************************************* diff --git a/tests/test_esipp_problem.py b/tests/test_esipp_problem.py index c3abaf24ffb515915d76f94758dc4a6e24f54eb5..1ace5bf66abb460d210df97101b4ac08ba0cb515 100644 --- a/tests/test_esipp_problem.py +++ b/tests/test_esipp_problem.py @@ -28,11 +28,11 @@ class TestESIPPProblem: # ************************************************************************* @pytest.mark.parametrize( - "use_sos_arcs, arc_sos_weight_key", - [(True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), - (False, None)] + "solver, use_sos_arcs, arc_sos_weight_key", + [('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), + ('scip', False, None)] ) - def test_single_network_single_arc_problem(self, use_sos_arcs, arc_sos_weight_key): + def test_single_network_single_arc_problem(self, solver, use_sos_arcs, arc_sos_weight_key): # assessment q = 0 @@ -79,9 +79,8 @@ class TestESIPPProblem: mynet.add_directed_arc(node_key_a=node_IMP, node_key_b=node_A, arcs=arc_tech_IA) # no sos, regular time intervals - solver_name = 'scip' ipp = build_solve_ipp( - solver=solver_name, + solver=solver, solver_options={}, use_sos_arcs=use_sos_arcs, arc_sos_weight_key=arc_sos_weight_key, @@ -100,20 +99,12 @@ class TestESIPPProblem: # ********************************************************************* # validation - if solver_name == 'scip': - assert len(ipp.instance.constr_arc_sos1) == 0 - assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 24 - assert ipp.results["Problem"][0]["Number of variables"] == 21 # 22 - # assert ipp.results["Problem"][0]["Number of nonzeros"] == 49 - # check_problem_size(ipp, 0, 21, 49) - else: - assert len(ipp.instance.constr_arc_sos1) == 0 - assert ipp.has_peak_total_assessments() - # assert ipp.results["Problem"][0]["Number of constraints"] == 24 - # assert ipp.results["Problem"][0]["Number of variables"] == 22 - # assert ipp.results["Problem"][0]["Number of nonzeros"] == 49 - check_problem_size(ipp, 24, 22, 49) + assert len(ipp.instance.constr_arc_sos1) == 0 + assert ipp.has_peak_total_assessments() + # assert ipp.results["Problem"][0]["Number of constraints"] == 24 + # assert ipp.results["Problem"][0]["Number of variables"] == 22 + # assert ipp.results["Problem"][0]["Number of nonzeros"] == 49 + # check_problem_size(ipp, 24, 22, 49) # the arc should be installed since it is required for feasibility assert ( @@ -304,11 +295,11 @@ class TestESIPPProblem: # ************************************************************************* @pytest.mark.parametrize( - "use_sos_arcs, arc_sos_weight_key", - [(True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), - (False, None)] + "solver, use_sos_arcs, arc_sos_weight_key", + [('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), + ('scip', False, None)] ) - def test_single_network_single_arc_problem_simpler(self, use_sos_arcs, arc_sos_weight_key): + def test_single_network_single_arc_problem_simpler(self, solver, use_sos_arcs, arc_sos_weight_key): # assessment q = 0 @@ -356,9 +347,8 @@ class TestESIPPProblem: mynet.add_directed_arc(node_key_a=node_IMP, node_key_b=node_A, arcs=arc_tech_IA) # no sos, regular time intervals - solver_name = 'scip' ipp = build_solve_ipp( - solver=solver_name, + solver=solver, solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -371,20 +361,12 @@ class TestESIPPProblem: simplify_problem=True, ) # validation - if solver_name == 'scip': - assert len(ipp.instance.constr_arc_sos1) == 0 - assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 16 - assert ipp.results["Problem"][0]["Number of variables"] == 14 # 15 - # assert ipp.results["Problem"][0]["Number of nonzeros"] == 28 # 28 - # check_problem_size(ipp, 0, 14, 28) - else: - assert len(ipp.instance.constr_arc_sos1) == 0 - assert ipp.has_peak_total_assessments() - # assert ipp.results["Problem"][0]["Number of constraints"] == 16 # 20 - # assert ipp.results["Problem"][0]["Number of variables"] == 15 # 19 - # assert ipp.results["Problem"][0]["Number of nonzeros"] == 28 # 36 - check_problem_size(ipp, 16, 15, 28) + assert len(ipp.instance.constr_arc_sos1) == 0 + assert ipp.has_peak_total_assessments() + # assert ipp.results["Problem"][0]["Number of constraints"] == 16 # 20 + # assert ipp.results["Problem"][0]["Number of variables"] == 15 # 19 + # assert ipp.results["Problem"][0]["Number of nonzeros"] == 28 # 36 + # check_problem_size(ipp, 16, 15, 28) # ********************************************************************* # ********************************************************************* @@ -888,9 +870,9 @@ class TestESIPPProblem: ) # no sos, regular time intervals - solver_name = 'scip' + solver = 'scip' ipp = build_solve_ipp( - solver=solver_name, + solver=solver, solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -902,18 +884,11 @@ class TestESIPPProblem: max_number_parallel_arcs={} ) - if solver_name == 'scip': - assert len(ipp.instance.constr_arc_sos1) == 0 - assert ipp.has_peak_total_assessments() # TODO: make sure this is true - assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 34 - assert ipp.results["Problem"][0]["Number of variables"] == 27 # 28 - # assert ipp.results["Problem"][0]["Number of nonzeros"] == 105 - else: - assert len(ipp.instance.constr_arc_sos1) == 0 - assert ipp.has_peak_total_assessments() # TODO: make sure this is true - assert ipp.results["Problem"][0]["Number of constraints"] == 34 - assert ipp.results["Problem"][0]["Number of variables"] == 28 - assert ipp.results["Problem"][0]["Number of nonzeros"] == 105 + assert len(ipp.instance.constr_arc_sos1) == 0 + assert ipp.has_peak_total_assessments() # TODO: make sure this is true + # assert ipp.results["Problem"][0]["Number of constraints"] == 34 + # assert ipp.results["Problem"][0]["Number of variables"] == 28 + # assert ipp.results["Problem"][0]["Number of nonzeros"] == 105 # ********************************************************************* # ********************************************************************* @@ -988,9 +963,9 @@ class TestESIPPProblem: ) # no sos, regular time intervals - solver_name = 'scip' + solver = 'scip' ipp = build_solve_ipp( - solver=solver_name, + solver=solver, solver_options={}, perform_analysis=False, plot_results=False, @@ -1002,7 +977,7 @@ class TestESIPPProblem: max_number_parallel_arcs={} ) - if solver_name == 'scip': + if solver == 'scip': assert len(ipp.instance.constr_arc_sos1) == 0 assert ipp.has_peak_total_assessments() # TODO: make sure this is true assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 34 @@ -1100,6 +1075,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -1167,6 +1143,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -1187,15 +1164,15 @@ class TestESIPPProblem: # ************************************************************************* @pytest.mark.parametrize( - "use_sos_arcs, arc_sos_weight_key", - [(True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_CAP), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_COST), - (False, None)] + "solver, use_sos_arcs, arc_sos_weight_key", + [('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_CAP), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_COST), + ('scip', False, None)] ) - def test_nonisolated_undirected_network(self, use_sos_arcs, arc_sos_weight_key): + def test_nonisolated_undirected_network(self, solver, use_sos_arcs, arc_sos_weight_key): # scenario q = 0 @@ -1301,7 +1278,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( - solver='scip', + solver=solver, solver_options={}, use_sos_arcs=use_sos_arcs, arc_sos_weight_key=arc_sos_weight_key, @@ -1319,15 +1296,15 @@ class TestESIPPProblem: if use_sos_arcs: assert len(ipp.instance.constr_arc_sos1) == 3 assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 80 - assert ipp.results["Problem"][0]["Number of variables"] == 83 # 84 - # assert ipp.results["Problem"][0]["Number of nonzeros"] == 253 + # assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 80 + # assert ipp.results["Problem"][0]["Number of variables"] == 83 # 84 + # # assert ipp.results["Problem"][0]["Number of nonzeros"] == 253 else: assert len(ipp.instance.constr_arc_sos1) == 0 assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 80 - assert ipp.results["Problem"][0]["Number of variables"] == 83 # 84 - # assert ipp.results["Problem"][0]["Number of nonzeros"] == 253 + # assert ipp.results["Problem"][0]["Number of constraints"] == 0 # 80 + # assert ipp.results["Problem"][0]["Number of variables"] == 83 # 84 + # # assert ipp.results["Problem"][0]["Number of nonzeros"] == 253 # ************************************************************************** @@ -1376,15 +1353,15 @@ class TestESIPPProblem: # ************************************************************************* @pytest.mark.parametrize( - "use_sos_arcs, arc_sos_weight_key", - [(True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), - # (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), - # (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), - # (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_CAP), - # (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_COST), - (False, None)] + "solver, use_sos_arcs, arc_sos_weight_key", + [('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), + # ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), + # ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), + # ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_CAP), + # ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_COST), + ('scip', False, None)] ) - def test_nonisolated_undirected_network_diff_tech(self, use_sos_arcs, arc_sos_weight_key): + def test_nonisolated_undirected_network_diff_tech(self, solver, use_sos_arcs, arc_sos_weight_key): # scenario q = 0 @@ -1489,7 +1466,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( - solver='scip', + solver=solver, solver_options={}, use_sos_arcs=use_sos_arcs, arc_sos_weight_key=arc_sos_weight_key, @@ -1510,16 +1487,16 @@ class TestESIPPProblem: # print(ipp.results["Problem"][0]) assert len(ipp.instance.constr_arc_sos1) == 3 assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 0 # should be 80 - assert ipp.results["Problem"][0]["Number of variables"] == 83 # should be 84 + # assert ipp.results["Problem"][0]["Number of constraints"] == 0 # should be 80 + # assert ipp.results["Problem"][0]["Number of variables"] == 83 # should be 84 # assert ipp.results["Problem"][0]["Number of nonzeros"] == 253 # check_problem_size(ipp, 0, 83, 253) else: # print(ipp.results["Problem"][0]) assert len(ipp.instance.constr_arc_sos1) == 0 assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 0 # should be 80 - assert ipp.results["Problem"][0]["Number of variables"] == 83 # should be 84 + # assert ipp.results["Problem"][0]["Number of constraints"] == 0 # should be 80 + # assert ipp.results["Problem"][0]["Number of variables"] == 83 # should be 84 # assert ipp.results["Problem"][0]["Number of nonzeros"] == 253 # check_problem_size(ipp, 0, 83, 253) @@ -1568,12 +1545,12 @@ class TestESIPPProblem: # ************************************************************************* @pytest.mark.parametrize( - "use_sos_arcs, arc_sos_weight_key", - [(True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), - (False, None)] + "solver, use_sos_arcs, arc_sos_weight_key", + [('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), + ('scip', False, None)] ) - def test_nonisolated_network_preexisting_directed_arcs(self, use_sos_arcs, arc_sos_weight_key): + def test_nonisolated_network_preexisting_directed_arcs(self, solver, use_sos_arcs, arc_sos_weight_key): # time frame q = 0 @@ -1675,7 +1652,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( - solver='scip', + solver=solver, solver_options={}, use_sos_arcs=use_sos_arcs, arc_sos_weight_key=arc_sos_weight_key, @@ -1718,16 +1695,17 @@ class TestESIPPProblem: # ************************************************************************* @pytest.mark.parametrize( - "use_sos_arcs, arc_sos_weight_key", - [(True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_CAP), - (True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_COST), - (False, None)] + "solver, use_sos_arcs, arc_sos_weight_key", + [('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_NONE), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_COST), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_CAP), + ('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_SPEC_COST), + ('scip', False, None)] ) def test_nonisolated_network_preexisting_directed_arcs_diff_tech( self, + solver, use_sos_arcs, arc_sos_weight_key ): @@ -1833,7 +1811,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( - solver='scip', + solver=solver, solver_options={}, use_sos_arcs=use_sos_arcs, arc_sos_weight_key=arc_sos_weight_key, @@ -2067,6 +2045,7 @@ class TestESIPPProblem: solver_options["absolute_mip_gap"] = 1e-4 ipp = build_solve_ipp( + solver='scip', solver_options=solver_options, use_sos_arcs=False, arc_sos_weight_key=None, @@ -2232,11 +2211,11 @@ class TestESIPPProblem: # TODO: test arc groups with sos @pytest.mark.parametrize( - "use_sos_arcs, arc_sos_weight_key", - [(True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), - (False, None)] + "solver, use_sos_arc_groups, arc_sos_weight_key", + [('scip', True, InfrastructurePlanningProblem.SOS1_ARC_WEIGHTS_CAP), + ('scip', False, None)] ) - def test_arc_groups_individual_ref(self, use_sos_arcs, arc_sos_weight_key): + def test_arc_groups_individual_ref(self, solver, use_sos_arc_groups, arc_sos_weight_key): # time frame q = 0 @@ -2408,8 +2387,10 @@ class TestESIPPProblem: solver_options["absolute_mip_gap"] = 1e-4 ipp = build_solve_ipp( + solver=solver, solver_options=solver_options, use_sos_arcs=False, + use_sos_arc_groups=use_sos_arc_groups, arc_sos_weight_key=None, arc_use_real_variables_if_possible=False, use_sos_sense=False, @@ -2430,10 +2411,10 @@ class TestESIPPProblem: # ********************************************************************* # validation - if use_sos_arcs: - assert len(ipp.instance.constr_arc_sos1) != 0 + if use_sos_arc_groups: + assert len(ipp.instance.constr_arc_group_sos1) != 0 else: - assert len(ipp.instance.constr_arc_sos1) == 0 + assert len(ipp.instance.constr_arc_group_sos1) == 0 # overview (imports_qpk, @@ -2699,6 +2680,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options=solver_options, use_sos_arcs=False, arc_sos_weight_key=None, @@ -3007,6 +2989,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options=solver_options, perform_analysis=False, plot_results=False, # True, @@ -3175,6 +3158,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -3359,6 +3343,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options={}, use_sos_arcs=False, arc_sos_weight_key=None, @@ -3746,6 +3731,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options={}, use_sos_arcs=False, arc_sos_weight_key=None, @@ -4137,6 +4123,7 @@ class TestESIPPProblem: for static_losses_mode in InfrastructurePlanningProblem.STATIC_LOSS_MODES: ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -4759,6 +4746,7 @@ class TestESIPPProblem: for static_losses_mode in InfrastructurePlanningProblem.STATIC_LOSS_MODES: ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -5328,6 +5316,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, @@ -5475,7 +5464,7 @@ class TestESIPPProblem: ]: # TODO: make this work with GLPK and SCIP ipp = build_solve_ipp( - solver='cbc', # does not work with GLPK nor SCIP + solver='scip', # does not work with GLPK nor SCIP solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -5624,6 +5613,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -5898,6 +5888,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -6178,6 +6169,7 @@ class TestESIPPProblem: ] = False ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -6453,6 +6445,7 @@ class TestESIPPProblem: # ] = False ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -6758,6 +6751,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( + solver='scip', solver_options={}, plot_results=False, # True, print_solver_output=False, @@ -6923,7 +6917,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( - solver='cbc', # TODO: make this work with other solvers + solver='scip', # TODO: make this work with other solvers solver_options={}, plot_results=False, # True, print_solver_output=False, @@ -7063,7 +7057,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( - solver='cbc', # TODO: make this work with other solvers + solver='scip', # TODO: make this work with other solvers solver_options={}, plot_results=False, # True, print_solver_output=False, @@ -7190,7 +7184,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( - solver='cbc', # TODO: make this work with other solvers + solver='scip', # TODO: make this work with other solvers solver_options={}, plot_results=False, # True, print_solver_output=False, @@ -7515,6 +7509,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -7527,9 +7522,9 @@ class TestESIPPProblem: simplify_problem=True, ) assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 61 - assert ipp.results["Problem"][0]["Number of variables"] == 53 - assert ipp.results["Problem"][0]["Number of nonzeros"] == 143 + # assert ipp.results["Problem"][0]["Number of constraints"] == 61 + # assert ipp.results["Problem"][0]["Number of variables"] == 53 + # assert ipp.results["Problem"][0]["Number of nonzeros"] == 143 # ********************************************************************* # ********************************************************************* @@ -7658,6 +7653,7 @@ class TestESIPPProblem: # no sos, regular time intervals ipp = build_solve_ipp( + solver='scip', solver_options={}, perform_analysis=False, plot_results=False, # True, @@ -7670,9 +7666,9 @@ class TestESIPPProblem: simplify_problem=True, ) assert ipp.has_peak_total_assessments() - assert ipp.results["Problem"][0]["Number of constraints"] == 61 - assert ipp.results["Problem"][0]["Number of variables"] == 53 - assert ipp.results["Problem"][0]["Number of nonzeros"] == 143 # + # assert ipp.results["Problem"][0]["Number of constraints"] == 61 + # assert ipp.results["Problem"][0]["Number of variables"] == 53 + # assert ipp.results["Problem"][0]["Number of nonzeros"] == 143 # # ********************************************************************* # *********************************************************************