From f3a2d1d61648c53e340348c457f1117044455b7f Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Fri, 7 Jul 2023 10:05:31 -0500 Subject: [PATCH] Fix bug in _compress when plants have fixed size Capacity was being incorrectly multiplied by T twice. This happened because there were two references to the same struct in the plant sizes array. This fix replaces the second reference by an actual copy of the struct. --- src/instance/parse.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instance/parse.jl b/src/instance/parse.jl index ac7b88f..2819267 100644 --- a/src/instance/parse.jl +++ b/src/instance/parse.jl @@ -171,7 +171,7 @@ function parse(json)::Instance ), ) end - length(sizes) > 1 || push!(sizes, sizes[1]) + length(sizes) > 1 || push!(sizes, deepcopy(sizes[1])) sort!(sizes, by = x -> x.capacity) # Initial capacity