TulipaEnergy / NearOptimalAlternatives.jl

A package implementing modelling to generate alternatives (MGA) to find near optimal alternatives to the optimal solution.
Apache License 2.0
0 stars 1 forks source link

Implement generating alternatives using metaheuristics #13

Closed marnoldus closed 2 months ago

marnoldus commented 3 months ago

Pull request details

Describe the changes made in this pull request

Implements finding alternative solutions using metaheuristics. Creates an alternative generating problem from a JuMP model that can be solved by an algorithm implemented in Metaheuristics.jl.

List of related issues or pull requests

Closes #2

Collaboration confirmation

As a contributor I confirm

marnoldus commented 3 months ago

@abelsiqueira as you can see this pull request fails on Julia 1.6. The reason for this is that the Metaheuristics package I use requires a minimum Julia version of 1.7. Using an earlier version of Metaheuristics.jl gives errors in the current code. What do you think is the best way to resolve this? Should we add a compatibility requirement in the project.toml that julia should be at least 1.7? Then we should also update the continuous integration.

abelsiqueira commented 3 months ago

Hi @marnoldus, there are two possibilities:

  1. What you described, change 1.6 to 1.7 in all places it appears.
  2. Use Package extensions to only load the relevant metaheurisitics functions if the Metaheuristics package is loaded (which should be impossible in 1.6 because it's broken) and/or check the version number and act accordingly at package load time.

Solution 1 is simpler and straightforward. I prefer it. The drawback is that the other packages are requiring 1.6, so there is some incompatibility - expectations are broken.

Solution 2 involves too many moving parts and is hard to maintain. It requires manual intervention when the LTS version of Julia changes, and it will create the false expectation that the package works normally on 1.6, which is not the case.

For me it's a clear choice to drop 1.6, but I'm tagging @clizbe for approval.

clizbe commented 3 months ago

Solution 1 sounds better. It just means the rest of Tulipa requires Julia 1.6 or later, while MGA requires Julia 1.7 or later, right?

abelsiqueira commented 3 months ago

Yes

gnawin commented 3 months ago

Thanks for all the work! I added some comments while reading the code for the first time. Most of them are about clarification from an outsider point of view, Although I can understand most after some googling/testing, but it would be nice if there can be more comments so I don't have to jump between things 😄 .

Not sure if you're still around to follow this up @marnoldus but I tag you both so you are both informed @greg-neustroev.

And there is an issue #22 with my comments for the existing code.

gnawin commented 2 months ago

Great! Thanks for this PR.