|
77 | 77 | # cache interface
|
78 | 78 | cache = init(prob, Ipopt.Optimizer())
|
79 | 79 | sol = solve!(cache)
|
80 |
| - @test 10 * sol.minimum < l1 |
| 80 | + @test 10 * sol.objective < l1 |
81 | 81 |
|
82 | 82 | optprob = OptimizationFunction(rosenbrock, Optimization.AutoZygote())
|
83 | 83 | prob = OptimizationProblem(optprob, x0, _p; sense = Optimization.MinSense)
|
|
97 | 97 | "max_cpu_time" => 60.0))
|
98 | 98 | @test 10 * sol.objective < l1
|
99 | 99 |
|
| 100 | + # test stats with AbstractBridgeOptimizer |
| 101 | + sol = solve(prob, |
| 102 | + OptimizationMOI.MOI.OptimizerWithAttributes(Ipopt.Optimizer, |
| 103 | + "max_cpu_time" => 60.0, "max_iter" => 5)) |
| 104 | + |
| 105 | + @test 60 > sol.stats.time > 0 |
| 106 | + @test sol.stats.iterations == 5 |
| 107 | + |
100 | 108 | sol = solve(prob,
|
101 | 109 | OptimizationMOI.MOI.OptimizerWithAttributes(NLopt.Optimizer,
|
102 | 110 | "algorithm" => :LN_BOBYQA))
|
103 | 111 | @test 10 * sol.objective < l1
|
104 | 112 |
|
| 113 | + @test sol.stats.time > 0 |
| 114 | + |
105 | 115 | sol = solve(prob,
|
106 | 116 | OptimizationMOI.MOI.OptimizerWithAttributes(NLopt.Optimizer,
|
107 | 117 | "algorithm" => :LD_LBFGS))
|
|
165 | 175 | res = solve(optprob, minlp_solver)
|
166 | 176 | @test res.u == [0.0, 0.0, 1.0, 0.0]
|
167 | 177 | @test res.objective == -4.0
|
| 178 | + @test res.stats.time > 0 |
168 | 179 | end
|
169 | 180 |
|
170 | 181 | @testset "Integer Domain" begin
|
|
0 commit comments