@@ -66,8 +66,11 @@ function solve_one_step_one_alea(model,
6666
6767 # update objective
6868 if isa (model. costFunctions, Function)
69- @objective (m, Min, model. costFunctions (t, x, u, xi) + alpha)
70-
69+ try
70+ @objective (m, Min, model. costFunctions (t, x, u, xi) + alpha)
71+ catch
72+ @objective (m, Min, model. costFunctions (m, t, x, u, xi) + alpha)
73+ end
7174 elseif isa (model. costFunctions, Vector{Function})
7275 cost = getindex (m, :cost )
7376 for i in 1 : length (model. costFunctions)
@@ -92,7 +95,7 @@ function solve_one_step_one_alea(model,
9295 solved = relaxation ? solve_relaxed! (m, param,verbosity) : solve_mip! (m, param,verbosity)
9396 else
9497 status = (verbosity> 3 ) ? solve (m, suppress_warnings= false ) : solve (m, suppress_warnings= false )
95- solved = (status == :Optimal )
98+ solved = (status == :Optimal ) || (status == :Suboptimal )
9699 end
97100
98101 # get time taken by the solver:
@@ -114,6 +117,8 @@ function solve_one_step_one_alea(model,
114117 println (status)
115118 error (" Foo" )
116119 # If no solution is found, then return nothing
120+ #= println(m) =#
121+ #= error("Fail to solve") =#
117122 result = NLDSSolution ()
118123 end
119124
0 commit comments