mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-06 07:48:50 -06:00
Make solvers silent by default
This commit is contained in:
@@ -193,7 +193,9 @@ function create_process_node_constraints!(model::ManufacturingModel)
|
||||
end
|
||||
end
|
||||
|
||||
function solve(filename::String; milp_optimizer=Cbc.Optimizer, lp_optimizer=Clp.Optimizer)
|
||||
function solve(filename::String;
|
||||
milp_optimizer=optimizer_with_attributes(Cbc.Optimizer, "logLevel" => 0),
|
||||
lp_optimizer=optimizer_with_attributes(Clp.Optimizer, "LogLevel" => 0))
|
||||
println("Reading $filename...")
|
||||
instance = RELOG.load(filename)
|
||||
|
||||
|
||||
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user