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

Modify leaf get range actions method #778

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

MartinBelthle
Copy link
Collaborator

@MartinBelthle MartinBelthle commented Aug 1, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

A PR modifying a real test case has been opened on farao-cucumber repository

Does this PR already have an issue describing the problem ?

  • [FAR-837] Investigate Leaf getRangeActions() method

  • This also solves the second issue of the 2 described in the internal Confluence page : "Sujets en cours", on the SWE case.

What kind of change does this PR introduce?

Bug fix.

What is the current behavior? (You can also link to an open issue here)

Current method :

@Override
public Set<RangeAction<?>> getRangeActions() {
    if (status == Status.EVALUATED) {
        return prePerimeterActivationResult.getRangeActions();
    } else if (status == Status.OPTIMIZED) {
        return postOptimResult.getRangeActions();
    } else {
        throw new FaraoException(NO_RESULTS_AVAILABLE);
    }

prePerimeterActivationResult.getRangeActions() returns every available range action in the CRAC.
On certain conditions described in the Confluence page, postOptimResult.getRangeActions() returns the same thing.

What is the new behavior (if this is a feature change)?

New method:

@Override
public Set<RangeAction<?>> getRangeActions() {
    if ((status == Status.EVALUATED) || (status == Status.OPTIMIZED)) {
        return optimizationPerimeter.getRangeActions();
    } else {
        throw new FaraoException(NO_RESULTS_AVAILABLE);
    }

The getRangeActions() method now only returns the rangeActions that belong to the optimizationPerimeter and only these ones.

Does this PR introduce a breaking change?

No

phiedw
phiedw previously approved these changes Aug 3, 2023
@phiedw phiedw merged commit 3cba638 into master Aug 4, 2023
@pet-mit pet-mit deleted the modify_Leaf_getRangeActions_method branch January 8, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants