Skip to content

Conversation

@basseche
Copy link
Contributor

@basseche basseche commented Feb 4, 2026

PR Summary

Add check for massive modification on power values to respect :
Pmin < PImp< Pmax & Pmin< PCons < Pmax

concerned modifications

  • modification by formula
  • modification by filter
  • tabular creation
  • tabular modification
  • Generator modification
  • Generator Creation

@basseche basseche self-assigned this Feb 4, 2026
double minP = modificationInfos.getMinP() != null ? modificationInfos.getMinP().getValue() : generator.getMinP();
double maxP = modificationInfos.getMaxP() != null ? modificationInfos.getMaxP().getValue() : generator.getMaxP();
double targetP = modificationInfos.getTargetP() != null ? modificationInfos.getTargetP().getValue() : generator.getTargetP();
Double pImp = modificationInfos.getPlannedActivePowerSetPoint() != null ? modificationInfos.getPlannedActivePowerSetPoint().applyModification(oldValue) : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

plannedActivePowerSetpoint is better than pImp ?


public static void checkPowerValues(String errorMessage, double minP, double maxP, double targetP, Double pImp, NetworkModificationException.Type exceptionType) throws NetworkModificationException {
checkActivePowerValue(errorMessage, FIELD_ACTIVE_POWER_TARGET, targetP, minP, maxP, exceptionType);
if (pImp != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why this check ?
we have already if (modificationInfos.getPlannedActivePowerSetPoint() != null)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is not for the same function

Signed-off-by: basseche <bassel.el-cheikh_externe@rte-france.com>
@basseche basseche requested a review from ghazwarhili February 10, 2026 09:52
@sonarqubecloud
Copy link

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