Implement BenchmarkRunner

This commit is contained in:
2021-05-25 18:18:38 -05:00
parent c6b76f57d2
commit 9689306876
13 changed files with 285 additions and 476 deletions

View File

@@ -0,0 +1,31 @@
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
using CSV
using DataFrames
using Gurobi
@testset "BenchmarkRunner" begin
# Configure benchmark suite
benchmark = BenchmarkRunner(
solvers=Dict(
"Baseline" => LearningSolver(Gurobi.Optimizer, components=[]),
"Proposed" => LearningSolver(Gurobi.Optimizer),
),
)
# Solve instances in parallel
instances = [
build_knapsack_file_instance(),
build_knapsack_file_instance(),
]
parallel_solve!(benchmark, instances)
# Write CSV
csv_filename = tempname()
write_csv!(benchmark, csv_filename)
@test isfile(csv_filename)
csv = DataFrame(CSV.File(csv_filename))
end