Skip to content

Commit 231efbd

Browse files
committed
Code structure to parse FZN output.
1 parent 8d8c520 commit 231efbd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/FlatZincOptimizer.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ function _FznResults()
8888
)
8989
end
9090

91+
function _parse_to_fznresults(str::String)::Vector{_FznResults}
92+
# There may be several results returned by the solver. Each solution is
93+
# separated from the others by `'-' ^ 10`.
94+
results = _FznResults[]
95+
96+
str_split = split(str, '-' ^ 10)[1:(end - 1)]
97+
n_results = length(str_split)
98+
sizehint!(results, n_results)
99+
100+
for i in 1:n_results
101+
102+
end
103+
104+
return results
105+
end
106+
91107
mutable struct Optimizer <: MOI.AbstractOptimizer
92108
inner::CP.FlatZinc.Optimizer
93109
solver_command::AbstractFznSolverCommand

0 commit comments

Comments
 (0)