UndefVarError: SOI not defined
Hello, I have been trying to run the example model but I have this error when running
const SOI = StructDualDynProg.SOI
what I need to do
Which version of StructDualDynProg are you using ?
Hi
I Have
Pkg.status("StructDualDynProg")
- StructDualDynProg 0.0.1
You need to use at lease version 0.2 to have the SOI constant defined. I would recommend updating the package
Thanks, today update and now works, but as I do to know the status, objective value, solution x?
You need to do
sol = SOI.optimize!(...)
SOI.last_result(sol).lowerbound
SOI.last_result(sol).upperbound
...
You can see the other fields of the result here.
Thank you very much for all your help, I found what I want but I wanted one last question, how do I better understand this data structure of SOI.last_result (sun) .paths? for example I want to know the solution of the master node, x1, after x2, ...., xT

SOI.last_result(sol).paths gives this structure:
https://github.com/JuliaStochOpt/StructDualDynProg.jl/blob/349c9bcc3bb7338390b9293de408d70dc818fada/src/SDDP/algorithm.jl#L61-L63
As explained here:
https://github.com/JuliaStochOpt/StructDualDynProg.jl/blob/349c9bcc3bb7338390b9293de408d70dc818fada/src/SDDP/algorithm.jl#L65-L70
To get the path for the master node you need to do
SOI.last_result(sol).paths.paths[1][1][2][1]
Then you will have this structure
https://github.com/JuliaStochOpt/StructDualDynProg.jl/blob/349c9bcc3bb7338390b9293de408d70dc818fada/src/SDDP/path.jl#L36-L53
and the solution is in the pool field.
I agree that we should add a more user friendly way to access it
Hello, I wanted to thank you, I was able to better understand the data structure with typeof and fieldnames. But I have a question, how do I use model2lattice
It doesn't exist anymore. I assume you read it from the README, I just fixed it: https://github.com/JuliaStochOpt/StructDualDynProg.jl/commit/ac3b1d0e50a129db7c460d0f637c480e597848ec