From 028a24201f066e677259826c038df9af2ab4ab69 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <MichielCottaar@protonmail.com>
Date: Wed, 11 Sep 2024 16:51:36 +0100
Subject: [PATCH] Check min_objective within rounding error

---
 src/build_sequences.jl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/build_sequences.jl b/src/build_sequences.jl
index 9afde5b..563afaf 100644
--- a/src/build_sequences.jl
+++ b/src/build_sequences.jl
@@ -151,7 +151,7 @@ function optimise_with_cost_func!(jump_model::Model, cost_func, n_attempts)
         error("Optimisation failed to converge. The following errors were raised: $err_string. Example errors for each type are printed above.")
     end
     backend(jump_model).optimizer.model.inner.x .= min_values
-    @assert value(cost_func) == min_objective
+    @assert value(cost_func) ≈ min_objective eps(min_objective)
 end
 
 function build_sequence(f::Function, scanner::Union{Nothing, Scanner}=Default_Scanner; optimise=true, n_attempts=20, print_level=0, mu_strategy="adaptive", max_iter=1000, kwargs...)
-- 
GitLab