mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 00:08:52 -06:00
disable optimizer logging
This commit is contained in:
@@ -12,7 +12,10 @@ function lmp_aelmp_test()
|
|||||||
instance = UnitCommitment.read(path)
|
instance = UnitCommitment.read(path)
|
||||||
model = UnitCommitment.build_model(
|
model = UnitCommitment.build_model(
|
||||||
instance = instance,
|
instance = instance,
|
||||||
optimizer = Cbc.Optimizer,
|
optimizer = optimizer_with_attributes(
|
||||||
|
Cbc.Optimizer,
|
||||||
|
"logLevel" => 0,
|
||||||
|
),
|
||||||
variable_names = true,
|
variable_names = true,
|
||||||
)
|
)
|
||||||
JuMP.set_silent(model)
|
JuMP.set_silent(model)
|
||||||
@@ -22,7 +25,10 @@ function lmp_aelmp_test()
|
|||||||
aelmp_1 = UnitCommitment.compute_lmp(
|
aelmp_1 = UnitCommitment.compute_lmp(
|
||||||
model,
|
model,
|
||||||
AELMP(),
|
AELMP(),
|
||||||
optimizer = HiGHS.Optimizer,
|
optimizer = optimizer_with_attributes(
|
||||||
|
HiGHS.Optimizer,
|
||||||
|
"log_to_console" => false,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
@test aelmp_1["s1", "B1", 1] ≈ 231.7 atol = 0.1
|
@test aelmp_1["s1", "B1", 1] ≈ 231.7 atol = 0.1
|
||||||
|
|
||||||
@@ -33,7 +39,10 @@ function lmp_aelmp_test()
|
|||||||
allow_offline_participation = false,
|
allow_offline_participation = false,
|
||||||
consider_startup_costs = true,
|
consider_startup_costs = true,
|
||||||
),
|
),
|
||||||
optimizer = HiGHS.Optimizer,
|
optimizer = optimizer_with_attributes(
|
||||||
|
HiGHS.Optimizer,
|
||||||
|
"log_to_console" => false,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
@test aelmp_2["s1", "B1", 1] ≈ 274.3 atol = 0.1
|
@test aelmp_2["s1", "B1", 1] ≈ 274.3 atol = 0.1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,13 +3,12 @@
|
|||||||
# Released under the modified BSD license. See COPYING.md for more details.
|
# Released under the modified BSD license. See COPYING.md for more details.
|
||||||
|
|
||||||
using UnitCommitment, Cbc, HiGHS, JuMP
|
using UnitCommitment, Cbc, HiGHS, JuMP
|
||||||
import UnitCommitment: ConventionalLMP
|
|
||||||
|
|
||||||
function solve_conventional_testcase(path::String)
|
function solve_conventional_testcase(path::String)
|
||||||
instance = UnitCommitment.read(path)
|
instance = UnitCommitment.read(path)
|
||||||
model = UnitCommitment.build_model(
|
model = UnitCommitment.build_model(
|
||||||
instance = instance,
|
instance = instance,
|
||||||
optimizer = Cbc.Optimizer,
|
optimizer = optimizer_with_attributes(Cbc.Optimizer, "logLevel" => 0),
|
||||||
variable_names = true,
|
variable_names = true,
|
||||||
)
|
)
|
||||||
JuMP.set_silent(model)
|
JuMP.set_silent(model)
|
||||||
@@ -17,7 +16,10 @@ function solve_conventional_testcase(path::String)
|
|||||||
lmp = UnitCommitment.compute_lmp(
|
lmp = UnitCommitment.compute_lmp(
|
||||||
model,
|
model,
|
||||||
ConventionalLMP(),
|
ConventionalLMP(),
|
||||||
optimizer = HiGHS.Optimizer,
|
optimizer = optimizer_with_attributes(
|
||||||
|
HiGHS.Optimizer,
|
||||||
|
"log_to_console" => false,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
return lmp
|
return lmp
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user