How to train a biobjective problem with SDDP.jl?

Hello,

I am trying to run this SDDP.jl/papers/biobjective_sddp/BiObjectiveSDDP.jl at master · odow/SDDP.jl · GitHub and also other files in this folder SDDP.jl/papers/biobjective_sddp at master · odow/SDDP.jl · GitHub.

But I always get this warning, ERROR: UndefVarError: SingleVariable not defined in MathOptInterface
Suggestion: check for spelling errors or missing imports.

Anyone know how to solve this??
Thank you!!!

@odow Hi Oscar, could you please help me out here? Thank you!

This code was written for an older version of MathOptInterface.

I should have added version bounds to SDDP.jl/papers/biobjective_sddp/Project.toml at master · odow/SDDP.jl · GitHub, but I guess I didn’t :grimacing:

Regardless, I don’t recommend that you run the code. What are you trying to do and why? The biobjective algorithm works in theory, but not very well in practice.

Thank you for the reply!

Oh I saw this file but I didn’t realize they are relevant. I will try again.

I am writing the master’s thesis, and the topic is to incorporating carbon emissions in multi-stage lot sizing model with stochastic demand. It can be modeled in two ways: 1. minimize cost and carbon emissions as a constraint; 2. minimize cost and carbon emissions same time as a bi-objective model. Both are linear integer problem.
Thank you for asking! And I would appreciate any insights here on my topic :blush:

1 Like

The most useful part of the paper was:

  • The idea of a bi-objective policy, and that you could use SDDP to build one
  • The heuristic solution method from the last section.

The least useful part of the paper was the exact solution algorithm, since it relied on the internals of the solver, and was highly susceptible to numerical issues.

I’ve implemented the heuristic as SDDP.train_biobjective, but it isn’t well documented yet.

Take a look at this example: Biobjective hydro-thermal · SDDP.jl

After training, you can use: SDDP.set_trade_off_weight(model, weight) to fix a particular weight and then simulate like you would with a single-objective problem.

Alternatively, you could also just solve a set of independent SDDP models for different scalarization weights.

1 Like

Thank you for the valuable hints! I will think about them! Really appreciate that!

1 Like

Hello Oscar @odow, I encountered another problem running the code. Here is part of the error message:

WARNING: replacing module BiObjectiveSDDP.
WARNING: redefinition of constant thermal_ub. This may fail, cause incorrect answers, or produce other errors.
WARNING: redefinition of constant thermal_lb. This may fail, cause incorrect answers, or produce other errors.
WARNING: redefinition of constant thermal_obj. This may fail, cause incorrect answers, or produce other errors.

It seems that there is something wrong about using the data in Brazilian_data.jl and I don’t know how to get it right.
Could you help me with this please? Thank you very much in advance!

This warning happens when you include("/path/to/file.jl") a file multiple times. You shouldn’t do that.

Thank you for the quick reply!

Strange, I have not changed anything in the .zip file I downloaded, but I am still getting this error.

I searched from “include” in the files in biobjective_SDDP, no dulplicates as expected. I tried “if !@isdefined(BiObjectiveSDDP)
include(joinpath(@DIR, “BiObjectiveSDDP.jl”))
end” as well, same error. I wonder what could be wrong here…

Besides, I should run “brazilian_example.jl” right? And it is supposed to generate some content like “simple_example.jl” does?

I really want to get this running, so far still trying haha

I assume that you are running this file multiple times:

It has two includes:

You must include these files only once.

including the file does not produce output by default. It was intended to be run from the command line:

But I will caution you again: I don’t think there is value in attempting to run this code.

Thank you so much for the detailed answer!

I understood, I will definitely try to implement my model using the heuristic.

Really appreciate your help!

1 Like