diff --git a/Project.toml b/Project.toml index 6c8a8b9..f60fd0f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ConstraintLearning" uuid = "4bd09668-9077-4be7-adc9-6307a490e6df" authors = ["azzaare and contributors"] -version = "0.1.8" +version = "0.1.9" [deps] CompositionalNetworks = "4b67e4b5-442d-4ef5-b760-3f5df3a57537" diff --git a/src/icn/cbls.jl b/src/icn/cbls.jl index abb07e5..1fe08ec 100644 --- a/src/icn/cbls.jl +++ b/src/icn/cbls.jl @@ -91,8 +91,13 @@ function CompositionalNetworks.optimize!( @debug "pool" s.pool best_values(s.pool) best_values(s) s.pool.configurations # Return best values - best = BitVector(collect(best_values(s))) - weights!(icn, best) + + if has_solution(s) + weights!(icn, BitVector(collect(best_values(s)))) + else + CompositionalNetworks.generate_weights(icn) + end + best = weights(icn) return best, Dictionary{BitVector, Int}([best], [1]) end