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

Unfeasible problem analyzer : add a new check #1689

Merged
merged 40 commits into from
Nov 3, 2023

Conversation

guilpier-code
Copy link
Contributor

@guilpier-code guilpier-code commented Oct 6, 2023

The current PR to fix issue #1682

what's done here :

  • Make a refactoring before welcoming the change (add a new analysis)
    • Remove exceptions catching a problem in the analyzer itself. Removing theses exceptions simplifies the code.
    • Simplify analyzer's interface to simplify the client calls.
    • split analyzer into : an algorithm that manages a collection of analyses and the slack variables analysis. Note that split and separation makes code more testable (in isolation).
    • Currently, when slack variables analysis cannot detect the unfeasibiliy's reason, it prints an error message. This can be misleading for users because it's not exactly an error but an inability of one analysis to catch the unfeasibility's reason. There may be another analysis that can catch it. So these messages can be printed as warnings or notice.
    • Separate the analysis manager and every analysis in different sources files
    • add some unit tests : test each class in isolation (units) and add one or two integration tests to check everything work together
    • what else ?
  • add the new check on consistency of each (original) variable bounds

@guilpier-code guilpier-code added this to the v8.7.1 milestone Oct 6, 2023
@guilpier-code guilpier-code self-assigned this Oct 6, 2023
@flomnes flomnes added the enhancement New feature or request label Oct 6, 2023
@flomnes flomnes modified the milestones: v8.7.1, v8.7.2 Oct 9, 2023
Copy link
Member

@sylvlecl sylvlecl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few more design issue + unit tests would be nice :)

src/solver/infeasible-problem-analysis/report.h Outdated Show resolved Hide resolved
src/solver/optimisation/opt_appel_solveur_lineaire.cpp Outdated Show resolved Hide resolved

namespace Antares::Optimization
{
class UnfeasibilityAnalysis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add some documentation comments on the few classes we added, to clarify their role

src/solver/optimisation/opt_appel_solveur_lineaire.cpp Outdated Show resolved Hide resolved
double upBound;
};

class VariablesBoundsConsistency : public UnfeasibilityAnalysis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add unit tests to this module, like a few tests for each component, the 2 analysis and the analyzer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can. It should be the subject of a further issue / PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be done in #1716

@a-zakir
Copy link
Contributor

a-zakir commented Oct 24, 2023

Not that i'm against it but the new file's name are not consistent with other lib name convention (we generally don't have hyphens)

Copy link

sonarqubecloud bot commented Nov 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

46.6% 46.6% Coverage
0.0% 0.0% Duplication

@sylvlecl sylvlecl merged commit 2242747 into develop Nov 3, 2023
7 checks passed
@sylvlecl sylvlecl deleted the feature/add_check_in_unfeasible_analyzer branch November 3, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants