Make solvers silent by default

This commit is contained in:
2020-06-30 09:41:12 -05:00
parent c5f1750213
commit 14714c382b
2 changed files with 5 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ using RELOG, Cbc, JuMP, Printf, JSON, MathOptInterface.FileFormats
instance = RELOG.load("$basedir/../instances/s1.json")
graph = RELOG.build_graph(instance)
model = RELOG.build_model(instance, graph, Cbc.Optimizer)
set_optimizer_attribute(model.mip, "logLevel", 0)
process_node_by_location_name = Dict(n.location.location_name => n
for n in graph.process_nodes)
@@ -16,7 +17,6 @@ using RELOG, Cbc, JuMP, Printf, JSON, MathOptInterface.FileFormats
shipping_node_by_location_and_product_names = Dict((n.location.location_name, n.product.name) => n
for n in graph.plant_shipping_nodes)
@test length(model.vars.flow) == 76
@test length(model.vars.dispose) == 16
@test length(model.vars.open_plant) == 12
@@ -43,7 +43,7 @@ using RELOG, Cbc, JuMP, Printf, JSON, MathOptInterface.FileFormats
@testset "solve" begin
solution = RELOG.solve("$(pwd())/../instances/s1.json")
JSON.print(stdout, solution, 4)
#JSON.print(stdout, solution, 4)
@test "Costs" in keys(solution)
@test "Fixed operating (\$)" in keys(solution["Costs"])