odow / SDDP.jl

Stochastic Dual Dynamic Programming in Julia
https://sddp.dev
Other
289 stars 60 forks source link

SMPS reader #241

Closed odow closed 3 years ago

odow commented 4 years ago

@gjharsha has C code for parsing SMPS here: https://github.com/USC3DLAB/SD/blob/master/src/smps.h and has expressed interest in adding it to SDDP.jl.

There are two options

I'm not sure which requires less effort.

However, there are some licensing issues, because MPL 2.0 allows commercial use, but the SD license requires a commercial license from USC. So we might need to ask @gjharsha if he's willing to make the code (just smps.h and smps.c, not the full SD solver) available under a more permissive license.

mtanneau commented 4 years ago

Is this still topical?

I'm currently writing a pure-julia SMPS parser (actually, most of it is written I think, I'm mostly re-factoring the code and making it ready for public release).

Let me know if it would be relevant here.

odow commented 4 years ago

Is this still topical?

Yes!!!

I'm currently writing a pure-julia SMPS parser (actually, most of it is written I think, I'm mostly re-factoring the code and making it ready for public release).

💯👍 🚀

Let me know what I can do to help!

mtanneau commented 4 years ago

What I need for myself (and for which I have most of the infrastructure) is to parse two-stage stochastic LPs from SMPS files. By .smps I mean .cor, .sto and .tim files.

I'm hoping the marginal cost of supporting more time periods and quadratic terms should be OK.

Things that would be useful to discuss would be:

So far I've only worked with the tssp instances that are shipped with the PDCGM software, (see data/tssp/ in the extracted folder).

odow commented 4 years ago

Two stage LPs only sounds good by me! No need to do multistage. Data structure is template matrices and vectors, and list of element changes for second stage problems, along with their probabilities. Keep it simple as possible.

odow commented 4 years ago

@mtanneau what is the status of https://github.com/mtanneau/SMPSReader.jl?

mtanneau commented 4 years ago

I merged a PR last week with a functioning reader.

Here, "functioning" means "it parses the input files", i.e., all the code does for now is read .cor, .tim and .sto files and build corresponding data structures.

There's no post-processing to, e.g., build the deterministic equivalent (I do have code for that in another repository, but it's still private for now).

I'd say a useful discussion to have, now, is on whether you need additional functionalities for SDDP.

odow commented 4 years ago

I think it should be sufficient for me to just turn your data structures into an SDDP.jl model. I'll take a deeper look.

mtanneau commented 4 years ago

Actually, I'm submitting that paper next week, so I can open the code now.

The code I wrote is here. It's for two-stage stochastic programs, and I transform everything in standard form.

It doesn't handle:

odow commented 4 years ago

Ooo interesting! This is almost exactly what I need. What's the paper on? CG for 2-SP?

mtanneau commented 4 years ago

It's the revised paper on Tulip, which now contains some CG for 2-SP, yes.

odow commented 4 years ago

332 implements a reader/writer for StochOptFormat. At this point, we should write a SMPS -> SOF converter.

I have no interest in writing an SMPS writer.

mtanneau commented 4 years ago

Fine by me.

odow commented 3 years ago

Closing in favor of SMPSReader.