mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Fix julia tests
This commit is contained in:
@@ -91,28 +91,28 @@ end
|
|||||||
@timeit "solve" begin
|
@timeit "solve" begin
|
||||||
instance, model = self.data.instance, self.data.model
|
instance, model = self.data.instance, self.data.model
|
||||||
wallclock_time = 0
|
wallclock_time = 0
|
||||||
found_violations = []
|
found_lazy = []
|
||||||
|
|
||||||
while true
|
while true
|
||||||
@timeit "optimize!" begin
|
@timeit "optimize!" begin
|
||||||
JuMP.optimize!(model)
|
JuMP.optimize!(model)
|
||||||
end
|
end
|
||||||
wallclock_time += JuMP.solve_time(model)
|
wallclock_time += JuMP.solve_time(model)
|
||||||
@timeit "find_violations" begin
|
@timeit "find_violated_lazy_constraints" begin
|
||||||
violations = instance.find_violations(model)
|
violations = instance.find_violated_lazy_constraints(model)
|
||||||
end
|
end
|
||||||
@info "$(length(violations)) violations found"
|
@info "$(length(violations)) violations found"
|
||||||
if length(violations) == 0
|
if length(violations) == 0
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
append!(found_violations, violations)
|
append!(found_lazy, violations)
|
||||||
for v in violations
|
for v in violations
|
||||||
instance.build_lazy_constraint(self.data.model, v)
|
instance.build_lazy_constraint(self.data.model, v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@timeit "update solution" begin
|
@timeit "update solution" begin
|
||||||
self._update_solution()
|
self._update_solution()
|
||||||
self.data.instance.found_violations = found_violations
|
instance.found_violated_lazy_constraints = found_lazy
|
||||||
|
instance.found_violated_user_cuts = []
|
||||||
end
|
end
|
||||||
primal_bound = JuMP.objective_value(model)
|
primal_bound = JuMP.objective_value(model)
|
||||||
dual_bound = JuMP.objective_bound(model)
|
dual_bound = JuMP.objective_bound(model)
|
||||||
|
|||||||
Reference in New Issue
Block a user