Skip to content

Commit

Permalink
added in a bool to avoid trying to save data when it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
huckl3b3rry87 committed Aug 31, 2018
1 parent a7ed8ab commit a06c2e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,9 @@ function postProcess!(n;kwargs...)
n.r.ocp.tst = n.r.ocp.tctr
end

stateDataExists = false
if n.r.ocp.status==:Optimal || (!n.s.mpc.onlyOptimal && n.s.mpc.on && isequal(n.mpc.v.evalNum,1))
stateDataExists = true
if (!isequal(n.r.ocp.status,:Optimal) && n.s.mpc.on && isequal(n.mpc.v.evalNum,1))
warn("There is no previous :Optimal solution to use since isequal(n.mpc.v.evalNum,1). \n
Attemting to extract: ",n.r.ocp.status," solution. \n
Expand Down Expand Up @@ -944,7 +946,7 @@ function postProcess!(n;kwargs...)
end
end
end
if n.s.ocp.save
if n.s.ocp.save && stateDataExists
push!(n.r.ocp.dfs,dvs2dfs(n))
push!(n.r.ocp.dfsCon,con2dfs(n))
if n.s.ocp.interpolationOn
Expand Down

0 comments on commit a06c2e2

Please sign in to comment.