diff --git a/src/core/settings.jl b/src/core/settings.jl index 063ad1cce0..beda9f133a 100644 --- a/src/core/settings.jl +++ b/src/core/settings.jl @@ -57,7 +57,7 @@ function Settings( optimizer_ = MOI.OptimizerWithAttributes(optimizer) else error( - "The provided input for optimizer is invalid. Provide a JuMP.OptimizerWithAttributes object or a valid Optimizer constructor (e.g. GLPK.Optimizer).", + "The provided input for optimizer is invalid. Provide a JuMP.OptimizerWithAttributes object or a valid Optimizer constructor (e.g. HiGHS.Optimizer).", ) end diff --git a/src/operation/emulation_model.jl b/src/operation/emulation_model.jl index cd42d60ec9..f75a7c9f36 100644 --- a/src/operation/emulation_model.jl +++ b/src/operation/emulation_model.jl @@ -536,8 +536,8 @@ keyword arguments to that function. # Examples ```julia -status = run!(model; optimizer = GLPK.Optimizer, executions = 10) -status = run!(model; output_dir = ./model_output, optimizer = GLPK.Optimizer, executions = 10) +status = run!(model; optimizer = HiGHS.Optimizer, executions = 10) +status = run!(model; output_dir = ./model_output, optimizer = HiGHS.Optimizer, executions = 10) ``` """ function run!( diff --git a/test/Project.toml b/test/Project.toml index e15b719fbc..2f4a74bacb 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,11 +1,9 @@ [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" -Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" -GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b" HydroPowerSimulations = "fc1677e0-6ad7-4515-bf3a-bd6bf20a0b1b" InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1" @@ -13,7 +11,6 @@ Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" JuMP = "4076af6c-e467-56ae-b986-b466b2749572" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" -Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655" PowerNetworkMatrices = "bed98974-b02a-5e2f-9fe0-a103f5c450dd" diff --git a/test/test_device_thermal_generation_constructors.jl b/test/test_device_thermal_generation_constructors.jl index cdb3a38813..8525b3e5e7 100644 --- a/test/test_device_thermal_generation_constructors.jl +++ b/test/test_device_thermal_generation_constructors.jl @@ -723,7 +723,7 @@ end UnitCommitmentProblem, template, sys; - optimizer = cbc_optimizer, + optimizer = HiGHS_optimizer, initialize_model = false, ) @test build!(UC; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT diff --git a/test/test_model_decision.jl b/test/test_model_decision.jl index fbcdc0392c..6b1d1abc97 100644 --- a/test/test_model_decision.jl +++ b/test/test_model_decision.jl @@ -5,7 +5,7 @@ @test_throws MethodError DecisionModel(template, c_sys5; bad_kwarg = 10) - model = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @@ -15,14 +15,14 @@ NetworkModel(CopperPlatePowerModel; use_slacks = true), ), c_sys5_re; - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, ) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT model = DecisionModel( get_thermal_dispatch_template_network(), c_sys5; - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, ) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @@ -35,7 +35,7 @@ get_thermal_dispatch_template_network(), c_sys5, my_model; - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, ) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @@ -49,10 +49,10 @@ end template, ServiceModel(VariableReserve{ReserveUp}, RangeReserve, "test"), ) - UC = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + UC = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) output_dir = mktempdir(; cleanup = true) @test build!(UC; output_dir = output_dir) == PSI.ModelBuildStatus.BUILT - @test solve!(UC; optimizer = GLPK_optimizer) == PSI.RunStatus.SUCCESSFULLY_FINALIZED + @test solve!(UC; optimizer = HiGHS_optimizer) == PSI.RunStatus.SUCCESSFULLY_FINALIZED res = OptimizationProblemResults(UC) @test isapprox(get_objective_value(res), 340000.0; atol = 100000.0) vars = res.variable_values @@ -98,7 +98,7 @@ end template, ServiceModel(VariableReserve{ReserveUp}, RangeReserve, "test"), ) - model = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT container = PSI.get_optimization_container(model) @@ -245,10 +245,10 @@ end template, ServiceModel(VariableReserve{ReserveUp}, RangeReserve, "test"), ) - UC = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + UC = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) output_dir = mktempdir(; cleanup = true) @test_throws ErrorException solve!(UC) - @test solve!(UC; optimizer = GLPK_optimizer, output_dir = output_dir) == + @test solve!(UC; optimizer = HiGHS_optimizer, output_dir = output_dir) == PSI.RunStatus.SUCCESSFULLY_FINALIZED end @@ -357,7 +357,7 @@ end c_sys5 = PSB.build_system(PSITestSystems, "c_sys5") valid_bounds = (coefficient = (min = 1.0, max = 1.0), rhs = (min = 0.4, max = 9.930296584)) - model = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @@ -387,7 +387,7 @@ end template = get_template_basic_uc_simulation() c_sys5 = PSB.build_system(PSITestSystems, "c_sys5_uc") valid_bounds = (min = 0.0, max = 6.0) - model = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @@ -494,7 +494,7 @@ end template, ServiceModel(VariableReserve{ReserveUp}, RangeReserve, "test"), ) - optimizer = GLPK_optimizer + optimizer = HiGHS_optimizer # Construct and build with default behavior that builds initial conditions. model = DecisionModel(template, sys; optimizer = optimizer) @@ -575,7 +575,7 @@ end UC = DecisionModel( template, c_sys5; - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, detailed_optimizer_stats = true, ) output_dir = mktempdir(; cleanup = true) @@ -601,7 +601,7 @@ end UC = DecisionModel( template, c_sys5; - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, detailed_optimizer_stats = true, ) output_dir = mktempdir(; cleanup = true) @@ -645,7 +645,7 @@ end UC = DecisionModel( template, c_sys5; - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, detailed_optimizer_stats = true, ) output_dir = mktempdir(; cleanup = true) @@ -672,7 +672,7 @@ end model = DecisionModel( template, c_sys5_bat; - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, ) @test build!(model; output_dir = output_dir) == PSI.ModelBuildStatus.BUILT @test solve!(model) == PSI.RunStatus.SUCCESSFULLY_FINALIZED diff --git a/test/test_model_emulation.jl b/test/test_model_emulation.jl index 9688073310..5abd81db88 100644 --- a/test/test_model_emulation.jl +++ b/test/test_model_emulation.jl @@ -7,7 +7,7 @@ force_build = true, ) - model = EmulationModel(template, c_sys5; optimizer = GLPK_optimizer) + model = EmulationModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(model; executions = 10, output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @test run!(model) == PSI.RunStatus.SUCCESSFULLY_FINALIZED @@ -20,7 +20,7 @@ force_build = true, ) set_device_model!(template, RenewableDispatch, RenewableFullDispatch) - model = EmulationModel(template, c_sys5_uc_re; optimizer = GLPK_optimizer) + model = EmulationModel(template, c_sys5_uc_re; optimizer = HiGHS_optimizer) @test build!(model; executions = 10, output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @@ -315,7 +315,7 @@ end # Deserialize with a different optimizer. @test_logs (:warn, r"Original solver was .* new solver is") match_mode = :any EmulationModel( path, - GLPK_optimizer, + HiGHS_optimizer, ) end diff --git a/test/test_network_constructors.jl b/test/test_network_constructors.jl index 2b90bb6480..70393c13c0 100644 --- a/test/test_network_constructors.jl +++ b/test/test_network_constructors.jl @@ -1,4 +1,4 @@ -# Note to devs. Use GLPK or Cbc for models with linear constraints and linear cost functions +# Note to devs. Use HiGHS for models with linear constraints and linear cost functions # Use OSQP for models with quadratic cost function and linear constraints and ipopt otherwise @testset "All PowerModels models construction" begin @@ -59,7 +59,7 @@ end ps_model_re = DecisionModel( template, PSB.build_system(PSITestSystems, "c_sys5_re"); - optimizer = GLPK_optimizer, + optimizer = HiGHS_optimizer, ) @test build!(ps_model_re; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT @@ -121,7 +121,7 @@ end ) end # PTDF input Error testing - ps_model = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + ps_model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!( ps_model; console_level = Logging.AboveMaxLevel, # Ignore expected errors. @@ -644,7 +644,7 @@ end set_device_model!(template_uc, ThermalStandard, thermal_model) ##### Solve Reduced Model #### - solver = GLPK_optimizer + solver = HiGHS_optimizer uc_model_red = DecisionModel( template_uc, new_sys; diff --git a/test/test_print.jl b/test/test_print.jl index 2a19c5956c..4bc08eb92d 100644 --- a/test/test_print.jl +++ b/test/test_print.jl @@ -22,10 +22,10 @@ end template = get_thermal_dispatch_template_network() c_sys5 = PSB.build_system(PSITestSystems, "c_sys5") - dm_model = DecisionModel(template, c_sys5; optimizer = GLPK_optimizer) + dm_model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(dm_model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT - @test solve!(dm_model; optimizer = GLPK_optimizer) == + @test solve!(dm_model; optimizer = HiGHS_optimizer) == PSI.RunStatus.SUCCESSFULLY_FINALIZED results = OptimizationProblemResults(dm_model) variables = read_variables(results) diff --git a/test/test_recorder_events.jl b/test/test_recorder_events.jl index 3de10be804..a217142658 100644 --- a/test/test_recorder_events.jl +++ b/test/test_recorder_events.jl @@ -7,7 +7,7 @@ force_build = true, ) set_device_model!(template, RenewableDispatch, RenewableFullDispatch) - model = EmulationModel(template, c_sys5_uc_re; optimizer = GLPK_optimizer) + model = EmulationModel(template, c_sys5_uc_re; optimizer = HiGHS_optimizer) @test build!(model; executions = 10, output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT diff --git a/test/test_services_constructor.jl b/test/test_services_constructor.jl index ce3d8b712c..203451baac 100644 --- a/test/test_services_constructor.jl +++ b/test/test_services_constructor.jl @@ -96,7 +96,7 @@ end ) c_sys5_uc = PSB.build_system(PSITestSystems, "c_sys5_uc"; add_reserves = true) - model = DecisionModel(template, c_sys5_uc; optimizer = cbc_optimizer) + model = DecisionModel(template, c_sys5_uc; optimizer = HiGHS_optimizer) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT moi_tests(model, 984, 0, 576, 216, 168, true) diff --git a/test/test_simulation_execute.jl b/test/test_simulation_execute.jl index d22a2efaba..4ca9b4f36d 100644 --- a/test/test_simulation_execute.jl +++ b/test/test_simulation_execute.jl @@ -329,7 +329,7 @@ end UnitCommitmentProblem, template, PSB.build_system(PSITestSystems, "c_market_bid_cost"); - optimizer = cbc_optimizer, + optimizer = HiGHS_optimizer, initialize_model = false, ), ], diff --git a/test/test_utils/mock_operation_models.jl b/test/test_utils/mock_operation_models.jl index b66d5be01c..c776c28224 100644 --- a/test/test_utils/mock_operation_models.jl +++ b/test/test_utils/mock_operation_models.jl @@ -196,8 +196,8 @@ function create_simulation_build_test_problems( ) return SimulationModels(; decision_models = [ - DecisionModel(template_uc, sys_uc; name = "UC", optimizer = GLPK_optimizer), - DecisionModel(template_ed, sys_ed; name = "ED", optimizer = GLPK_optimizer), + DecisionModel(template_uc, sys_uc; name = "UC", optimizer = HiGHS_optimizer), + DecisionModel(template_ed, sys_ed; name = "ED", optimizer = HiGHS_optimizer), ], ) end diff --git a/test/test_utils/solver_definitions.jl b/test/test_utils/solver_definitions.jl index a7ef5acdb7..795b195bb7 100644 --- a/test/test_utils/solver_definitions.jl +++ b/test/test_utils/solver_definitions.jl @@ -13,8 +13,6 @@ fast_ipopt_optimizer = JuMP.optimizer_with_attributes( "max_cpu_time" => 5.0, ) # use default print_level = 5 # set to 0 to disable -GLPK_optimizer = - JuMP.optimizer_with_attributes(GLPK.Optimizer, "msg_lev" => GLPK.GLP_MSG_OFF) scs_solver = JuMP.optimizer_with_attributes( SCS.Optimizer, "max_iters" => 100000, @@ -27,5 +25,3 @@ HiGHS_optimizer = JuMP.optimizer_with_attributes( "time_limit" => 100.0, "log_to_console" => false, ) - -cbc_optimizer = JuMP.optimizer_with_attributes(Cbc.Optimizer)