Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the names more understandable #22

Open
gnawin opened this issue Jun 4, 2024 · 2 comments
Open

Make the names more understandable #22

gnawin opened this issue Jun 4, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@gnawin
Copy link
Member

gnawin commented Jun 4, 2024

Here are some (minor) suggestions that will improve the readability of the code while going through the repo.

https://github.com/TulipaEnergy/NearOptimalAlternatives.jl/blob/main/src/alternative-optimisation.jl:

  • l 23-25: maybe call them initial_objective* (or original*)
  • l 34: solution -> initial_solution
  • l 40: quite confusing to call a constraint original_objective, so original_objective -> optimality_gap_constraint
  • l 68: better to explain a bit more, e.g., by adding something like so the sum of the distance between the new solution and each of the previous solutions is maximized to the comment
  • l 69: solution -> previous_solution

https://github.com/TulipaEnergy/NearOptimalAlternatives.jl/blob/main/src/results.jl:

  • l 31: shouldn't it be push!(results.objective_values, objective_value(model))? What do we want to store here?

https://github.com/TulipaEnergy/NearOptimalAlternatives.jl/blob/2-mga-metaheuristics/src/generate-alternatives.jl:

  • l108: more explicit name?
@gnawin gnawin added enhancement New feature or request good first issue Good for newcomers labels Jun 4, 2024
@gnawin gnawin changed the title (WIP) Make the names more understandable Make the names more understandable Jun 5, 2024
@gnawin
Copy link
Member Author

gnawin commented Jun 5, 2024

@marnoldus @greg-neustroev as mentioned here (#13 (comment)) here are some extras for the existing code. Most of them are just naming suggestions, but maybe the question (for l31 in results.jl) is worth a comment from you? Thanks!

@marnoldus
Copy link
Collaborator

@gnawin what I intend to store in the results are the solutions themselves and their objective value to the original problem. The optimality gap constraint (original objective) will be something like: $c^T x \geq (1 - \gamma)c^T x^*$. I believe the value function will return the left-hand side of the constraint, so the objective value to the old problem but for the new solution. I agree that this is not completely clear from this piece of code, so a bit more documentation on this can be useful. Let me know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants