TulipaEnergy / TulipaEnergyModel.jl

An energy system optimization model that is flexible, computationally efficient, and academically robust.
Apache License 2.0
18 stars 18 forks source link

Add the Julia packages to use XPRESS, GUROBI, CPLEX in the Project.toml file #310

Closed datejada closed 7 months ago

datejada commented 7 months ago

Description

Open the project and add the following packages.

import Pkg
Pkg.add("Xpress")
Pkg.add("CPLEX")
Pkg.add("Gurobi")

Related Issues

No response

abelsiqueira commented 7 months ago

I think we actually don't want to add these, but instead leave it dependent on the user, via #246. It will also mean removing HiGHS at some point.

datejada commented 7 months ago

As I understand it, issue #246 is to choose the options and the solver to use to solve. However, you still need to have the package of the solver installed in your environment to be able to use it. Otherwise, choosing the solver will fail because the solver package isn't available in the environment. We should guarantee that we have the dependencies in the Project.toml of the solvers we are going to use in Tulipa, i.e., HiGHS, Gurobi, Xpress, and Cplex. So, the user doesn't need to add packages on his/her own. So, for me, issue #246 has a different purpose than what I meant in this issue. Maybe is my lack of knowledge of Julia, and it is not a big deal; I just want to make it easy for the user to not install extra packages on his/her own.

abelsiqueira commented 7 months ago

Adding the package tries to connect with the solver, which requires the solver to be installed: https://github.com/jump-dev/Gurobi.jl#installation In the best case, it would print a bunch of warnings. In the worst, we wouldn't be able to add the package at all. I haven't checked which one it is.

And even if it works, we also would be adding a lot of unnecessary dependencies to Tulipa, which would make the installation take longer. Maybe HiGHS could be there if you want to avoid giving more work to the user, but it doesn't look like a lot of work, to be honest. Since the user has to add TulipaEnergyModel, they might as well add HiGHS too.

For #246, one of the arguments to be passed could be the solver itself.

datejada commented 7 months ago

Ok! I see it now. I didn't know that the solver must be installed. In that case, we need to give some instructions in the documentation 😄 Thanks! I will close this issue and create a new one to add the instructions in the documentation.

datejada commented 6 months ago

The PR #384 added to the documentation how to change the solver and define its parameters