Add Optimization interface, add greedy optimizer, add some functionality to CDCost
This commit is contained in:
@@ -11,6 +11,7 @@ using Test
|
||||
include("node_reduction.jl")
|
||||
include("unit_tests_graph.jl")
|
||||
include("unit_tests_execution.jl")
|
||||
include("unit_tests_optimization.jl")
|
||||
|
||||
include("known_graphs.jl")
|
||||
end
|
||||
|
18
test/unit_tests_optimization.jl
Normal file
18
test/unit_tests_optimization.jl
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
@testset "Unit Tests Optimization" begin
|
||||
graph = parse_dag(joinpath(@__DIR__, "..", "input", "AB->AB.txt"), ABCModel())
|
||||
|
||||
@testset "Greedy Optimizer" begin
|
||||
estimator = GlobalMetricEstimator()
|
||||
optimizer = GreedyOptimizer(estimator)
|
||||
|
||||
optimize_step!(optimizer, graph)
|
||||
|
||||
@test length(graph.operationsToApply) + length(graph.appliedOperations) == 1
|
||||
|
||||
optimize!(optimizer, graph, 10)
|
||||
|
||||
@test length(graph.operationsToApply) + length(graph.appliedOperations) == 11
|
||||
end
|
||||
end
|
||||
println("Optimization Unit Tests Complete!")
|
Reference in New Issue
Block a user