Skip to content

Commit

Permalink
change order of check on pmin and pmax (#385)
Browse files Browse the repository at this point in the history
Signed-off-by: Ghazwa Rehili <[email protected]>
  • Loading branch information
ghazwarhili authored Dec 14, 2023
1 parent 0fb7fd2 commit 50ef1fd
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,17 @@ private void modifyGeneratorReactiveCapabilityCurvePoints(GeneratorModificationI
private Reporter modifyGeneratorActiveLimitsAttributes(GeneratorModificationInfos modificationInfos,
Generator generator, Reporter subReporter) {
Reporter subReporterLimits = null;
Report reportMaxActivePower;
Report reportMinActivePower;

Report reportMaxActivePower = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(generator::setMaxP, generator::getMaxP, modificationInfos.getMaxActivePower(), "Max active power");
Report reportMinActivePower = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(generator::setMinP, generator::getMinP, modificationInfos.getMinActivePower(), "Min active power");
if (modificationInfos.getMaxActivePower() != null && modificationInfos.getMaxActivePower().getValue() > generator.getMinP()) {
reportMaxActivePower = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(generator::setMaxP, generator::getMaxP, modificationInfos.getMaxActivePower(), "Max active power");
reportMinActivePower = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(generator::setMinP, generator::getMinP, modificationInfos.getMinActivePower(), "Min active power");

} else {
reportMinActivePower = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(generator::setMinP, generator::getMinP, modificationInfos.getMinActivePower(), "Min active power");
reportMaxActivePower = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(generator::setMaxP, generator::getMaxP, modificationInfos.getMaxActivePower(), "Max active power");
}
Report reportRatedNominalPower = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(generator::setRatedS, generator::getRatedS, modificationInfos.getRatedNominalPower(), "Rated nominal power");
if (reportMaxActivePower != null || reportMinActivePower != null || reportRatedNominalPower != null) {
subReporterLimits = subReporter.createSubReporter(LIMITS, LIMITS);
Expand Down

0 comments on commit 50ef1fd

Please sign in to comment.